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
ea54644a
Commit
ea54644a
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
f7a57f27
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
18 deletions
+23
-18
CHANGES.md
CHANGES.md
+3
-2
src/converse-rosterview.js
src/converse-rosterview.js
+19
-15
webpack.html
webpack.html
+1
-1
No files found.
CHANGES.md
View file @
ea54644a
...
...
@@ -3,8 +3,9 @@
## 6.0.0 (Unreleased)
-
#129: Add support for XEP-0156: Disovering Alternative XMPP Connection Methods. Only XML is supported for now.
-
#1691 Fix
`collection.chatbox is undefined`
errors
-
#1733 New message notifications for a minimized chat stack on top of each other
-
#1089: When filtering the roster for
`online`
users, show all non-offline users.
-
#1691: Fix
`collection.chatbox is undefined`
errors
-
#1733: New message notifications for a minimized chat stack on top of each other
-
Prevent editing of sent file uploads.
-
Initial support for sending custom emojis. Currently only between Converse
instances. Still working out a wire protocol for compatibility with other clients.
...
...
src/converse-rosterview.js
View file @
ea54644a
...
...
@@ -593,13 +593,14 @@ converse.plugins.add('converse-rosterview', {
return
u
.
slideIn
(
this
.
contacts_el
);
},
/* 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.
* @private
* @method _converse.RosterGroupView#filterOutContacts
* @param { Array } contacts
*/
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.
*/
let
shown
=
0
;
this
.
model
.
contacts
.
forEach
(
contact
=>
{
const
contact_view
=
this
.
get
(
contact
.
get
(
'
id
'
));
...
...
@@ -617,10 +618,15 @@ converse.plugins.add('converse-rosterview', {
}
},
/**
* 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
)
{
/* Given the filter query "q" and the filter type "type",
* return a list of contacts that need to be filtered out.
*/
if
(
q
.
length
===
0
)
{
return
[];
}
...
...
@@ -631,15 +637,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
)
=>
{
...
...
webpack.html
View file @
ea54644a
...
...
@@ -29,7 +29,7 @@
muc_domain
:
'
conference.chat.example.org
'
,
muc_respect_autojoin
:
true
,
password
:
'
secret
'
,
view_mode
:
'
overlayed
'
,
view_mode
:
'
fullscreen
'
,
websocket_url
:
'
ws://chat.example.org:5380/xmpp-websocket
'
,
whitelisted_plugins
:
[
'
converse-debug
'
],
});
...
...
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