Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
7002e47b
Commit
7002e47b
authored
Oct 17, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1089. When filtering by `online`, show all non-offline users
parent
4e6827db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
15 deletions
+19
-15
src/converse-rosterview.js
src/converse-rosterview.js
+19
-15
No files found.
src/converse-rosterview.js
View file @
7002e47b
...
...
@@ -594,13 +594,14 @@ converse.plugins.add('converse-rosterview', {
return
u
.
slideIn
(
this
.
contacts_el
);
},
filterOutContacts
(
contacts
=
[])
{
/* Given a list of contacts, make sure they're filtered out
* (aka hidden) and that all other contacts are visible.
*
* If all contacts are hidden, then also hide the group
* title.
* If all contacts are hidden, then also hide the group title.
* @private
* @method _converse.RosterGroupView#filterOutContacts
* @param { Array } contacts
*/
filterOutContacts
(
contacts
=
[])
{
let
shown
=
0
;
this
.
model
.
contacts
.
forEach
(
contact
=>
{
const
contact_view
=
this
.
get
(
contact
.
get
(
'
id
'
));
...
...
@@ -618,10 +619,15 @@ converse.plugins.add('converse-rosterview', {
}
},
getFilterMatches
(
q
,
type
)
{
/
* Given the filter query "q" and the filter type "type",
/**
* Given the filter query "q" and the filter type "type",
* return a list of contacts that need to be filtered out.
* @private
* @method _converse.RosterGroupView#getFilterMatches
* @param { String } q - The filter query
* @param { String } type - The filter type
*/
getFilterMatches
(
q
,
type
)
{
if
(
q
.
length
===
0
)
{
return
[];
}
...
...
@@ -632,15 +638,13 @@ converse.plugins.add('converse-rosterview', {
// When filtering by chat state, we still want to
// show requesting contacts, even though they don't
// have the state in question.
matches
=
this
.
model
.
contacts
.
filter
(
(
contact
)
=>
!
_
.
includes
(
contact
.
presence
.
get
(
'
show
'
),
q
)
&&
!
contact
.
get
(
'
requesting
'
)
);
matches
=
this
.
model
.
contacts
.
filter
(
c
=>
!
_
.
includes
(
c
.
presence
.
get
(
'
show
'
),
q
)
&&
!
c
.
get
(
'
requesting
'
));
}
else
if
(
q
===
'
unread_messages
'
)
{
matches
=
this
.
model
.
contacts
.
filter
({
'
num_unread
'
:
0
});
}
else
if
(
q
===
'
online
'
)
{
matches
=
this
.
model
.
contacts
.
filter
(
c
=>
[
"
offline
"
,
"
unavailable
"
].
includes
(
c
.
presence
.
get
(
'
show
'
)));
}
else
{
matches
=
this
.
model
.
contacts
.
filter
(
(
contact
)
=>
!
_
.
includes
(
contact
.
presence
.
get
(
'
show
'
),
q
)
);
matches
=
this
.
model
.
contacts
.
filter
(
c
=>
!
_
.
includes
(
c
.
presence
.
get
(
'
show
'
),
q
));
}
}
else
{
matches
=
this
.
model
.
contacts
.
filter
((
contact
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment