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
bce8dc91
Commit
bce8dc91
authored
Sep 24, 2019
by
Christoph Scholz
Committed by
JC Brand
Sep 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1714
don't notify if only message delivery receipt
parent
e29849fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
CHANGES.md
CHANGES.md
+1
-0
src/converse-notification.js
src/converse-notification.js
+1
-0
src/headless/utils/core.js
src/headless/utils/core.js
+12
-0
No files found.
CHANGES.md
View file @
bce8dc91
...
...
@@ -7,6 +7,7 @@
-
#1712:
`TypeError: plugin._features is not a function`
-
Bugfix: process stanzas from mam one-by-one in order to correctly process message
receipts
-
#1714 Bugfix: Don't notify the user in case we're receiving a message delivery receipt only
## 5.0.3 (2019-09-13)
...
...
src/converse-notification.js
View file @
bce8dc91
...
...
@@ -87,6 +87,7 @@ converse.plugins.add('converse-notification', {
}
const
is_me
=
Strophe
.
getBareJidFromJid
(
message
.
getAttribute
(
'
from
'
))
===
_converse
.
bare_jid
;
return
!
u
.
isOnlyChatStateNotification
(
message
)
&&
!
u
.
isOnlyMessageDeliveryReceipt
(
message
)
&&
!
is_me
&&
(
_converse
.
show_desktop_notifications
===
'
all
'
||
_converse
.
isMessageToHiddenChat
(
message
));
};
...
...
src/headless/utils/core.js
View file @
bce8dc91
...
...
@@ -148,6 +148,18 @@ u.isOnlyChatStateNotification = function (msg) {
return
msg
[
'
chat_state
'
]
&&
u
.
isEmptyMessage
(
msg
);
};
u
.
isOnlyMessageDeliveryReceipt
=
function
(
msg
)
{
if
(
msg
instanceof
Element
)
{
// See XEP-0184 Message Delivery Receipts
return
(
msg
.
querySelector
(
'
body
'
)
===
null
)
&&
(
msg
.
querySelector
(
'
received
'
)
!==
null
);
}
if
(
msg
instanceof
Backbone
.
Model
)
{
msg
=
msg
.
attributes
;
}
return
msg
[
'
received
'
]
&&
u
.
isEmptyMessage
(
msg
);
};
u
.
isHeadlineMessage
=
function
(
_converse
,
message
)
{
const
from_jid
=
message
.
getAttribute
(
'
from
'
);
if
(
message
.
getAttribute
(
'
type
'
)
===
'
headline
'
)
{
...
...
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