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
1bdb1716
Commit
1bdb1716
authored
Nov 04, 2018
by
Christoph Scholz
Committed by
JC Brand
Nov 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added option notification_delay
parent
cc3735ff
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
CHANGES.md
CHANGES.md
+1
-0
docs/source/configuration.rst
docs/source/configuration.rst
+9
-1
src/converse-notification.js
src/converse-notification.js
+7
-3
No files found.
CHANGES.md
View file @
1bdb1716
...
...
@@ -7,6 +7,7 @@
-
#1188 Feature request: drag and drop file to HTTP Upload
-
#1268 Switch from SASS variables to CSS custom properties
-
#1278 Replace the default avatar with a SVG version
-
#1306 added option
`notification_delay`
## 4.0.4 (2018-10-29)
...
...
docs/source/configuration.rst
View file @
1bdb1716
...
...
@@ -1005,6 +1005,15 @@ notified of all messages received in a room.
You can also pass an array of room JIDs to this option, to only apply it to
certain rooms.
notification_delay
------------------
* Default: ``5000``
Desktop notifications will be shown for a time of ``notification_delay``
ms. Setting this to ``0`` will make the notification stay until dismissed by
the user (requires browser support).
notification_icon
-----------------
...
...
@@ -1013,7 +1022,6 @@ notification_icon
This option specifies which icon is shown in HTML5 notifications, as provided
by the ``src/converse-notification.js`` plugin.
oauth_providers
---------------
...
...
src/converse-notification.js
View file @
1bdb1716
...
...
@@ -33,7 +33,8 @@ converse.plugins.add('converse-notification', {
// ^ a list of JIDs to ignore concerning chat state notifications
play_sounds
:
true
,
sounds_path
:
'
sounds/
'
,
notification_icon
:
'
logo/conversejs-filled.svg
'
notification_icon
:
'
logo/conversejs-filled.svg
'
,
notification_delay
:
5000
});
_converse
.
isOnlyChatStateNotification
=
(
msg
)
=>
...
...
@@ -180,9 +181,12 @@ converse.plugins.add('converse-notification', {
const
n
=
new
Notification
(
title
,
{
'
body
'
:
body
,
'
lang
'
:
_converse
.
locale
,
'
icon
'
:
_converse
.
notification_icon
'
icon
'
:
_converse
.
notification_icon
,
'
requireInteraction
'
:
!
_converse
.
notification_delay
});
setTimeout
(
n
.
close
.
bind
(
n
),
5000
);
if
(
_converse
.
notification_delay
)
{
setTimeout
(
n
.
close
.
bind
(
n
),
_converse
.
notification_delay
);
}
};
_converse
.
showChatStateNotification
=
function
(
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