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
ae6a7f4b
Commit
ae6a7f4b
authored
Mar 18, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Option to ignore certain JIDs' chat state notifications
parent
9a449e36
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
docs/CHANGES.md
docs/CHANGES.md
+1
-0
docs/source/configuration.rst
docs/source/configuration.rst
+17
-0
src/converse-notification.js
src/converse-notification.js
+6
-0
No files found.
docs/CHANGES.md
View file @
ae6a7f4b
...
...
@@ -6,6 +6,7 @@
As a result
`converse.listen.on('message');`
has been deprecated, use
`converse.stanza.on('message');`
instead. [jcbrand]
-
Emit an event
`chatBoxInitialized`
once a chat box's initialize method has been called. [jcbrand]
-
Emit an event
`statusInitialized`
once the user's own status has been initialized upon startup. [jcbrand]
-
New config option
[
chatstate_notification_blacklist
](
https://conversejs.org/docs/html/configuration.html#chatstate_notification_blacklist
)
[
jcbrand
]
-
Split converse.js up into different plugin modules. [jcbrand]
-
Don't play sound notifications for OTR messages which are setting up an
encrypted session. [jcbrand]
...
...
docs/source/configuration.rst
View file @
ae6a7f4b
...
...
@@ -298,6 +298,23 @@ This setting can only be used together with ``allow_otr = true``.
to retrieve your private key and read your all the chat messages in your
current session. Previous sessions however cannot be decrypted.
chatstate_notification_blacklist
---------------------------------
* Default: ``[]``
A list of JIDs to be ignored when showing desktop notifications of changed chat states.
Some user's clients routinely connect and disconnect (likely on mobile) and
each time a chat state notificaion is received (``online`` when connecting and
then ``offline`` when disconnecting).
When desktop notifications are turned on (see `show-desktop-notifications`_),
then you'll receive notification messages each time this happens.
Receiving constant notifications that a user's client is connecting and disconnecting
is annoying, so this option allows you to ignore those JIDs.
csi_waiting_time
----------------
...
...
src/converse-notification.js
View file @
ae6a7f4b
...
...
@@ -31,6 +31,8 @@
this
.
updateSettings
({
show_desktop_notifications
:
true
,
chatstate_notification_blacklist
:
[],
// ^ a list of JIDs to ignore concerning chat state notifications
play_sounds
:
false
,
sounds_path
:
'
/sounds/
'
,
notification_icon
:
'
/logo/conversejs.png
'
...
...
@@ -127,6 +129,10 @@
/* Creates an HTML5 Notification to inform of a change in a
* contact's chat state.
*/
if
(
_
.
contains
(
converse
.
chatstate_notification_blacklist
,
contact
.
get
(
'
jid
'
)))
{
// Don't notify if the user is being ignored.
return
;
}
var
chat_state
=
contact
.
chat_status
,
message
=
null
;
if
(
chat_state
===
'
offline
'
)
{
...
...
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