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
e8eea632
Commit
e8eea632
authored
Dec 14, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MUC: Send XEP-0333 markers with the MUC stanza id
See:
https://xmpp.org/extensions/xep-0333.html#rules-muc
parent
c4570815
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
CHANGES.md
CHANGES.md
+1
-0
src/headless/plugins/muc/muc.js
src/headless/plugins/muc/muc.js
+20
-0
No files found.
CHANGES.md
View file @
e8eea632
...
...
@@ -10,6 +10,7 @@
-
File structure reordering: All plugins are now in
`./plugins`
folders.
-
New configuration setting:
[
show_tab_notifications
](
https://conversejs.org/docs/html/configuration.html#show-tab-notifications
)
-
New configuration setting:
[
muc_clear_messages_on_leave
](
https://conversejs.org/docs/html/configuration.html#muc-clear-messages-on-leave
)
-
Use the MUC stanza id when sending XEP-0333 markers
### Breaking Changes
...
...
src/headless/plugins/muc/muc.js
View file @
e8eea632
...
...
@@ -178,6 +178,26 @@ const ChatRoomMixin = {
}
},
/**
* Given the passed in MUC message, send a XEP-0333 chat marker.
* @param { _converse.MUCMessage } msg
* @param { ('received'|'displayed'|'acknowledged') } [type='displayed']
* @param { Boolean } force - Whether a marker should be sent for the
* message, even if it didn't include a `markable` element.
*/
sendMarkerForMessage
(
msg
,
type
=
'
displayed
'
,
force
=
false
)
{
if
(
!
msg
)
return
;
if
(
msg
?.
get
(
'
is_markable
'
)
||
force
)
{
const
id
=
msg
.
get
(
`stanza_id
${
this
.
get
(
'
jid
'
)}
`
);
if
(
!
id
)
{
log
.
error
(
`Can't send marker for message without stanza ID:
${
msg
}
`
);
return
;
}
const
from_jid
=
Strophe
.
getBareJidFromJid
(
msg
.
get
(
'
from
'
));
this
.
sendMarker
(
from_jid
,
id
,
type
,
msg
.
get
(
'
type
'
));
}
},
/**
* Handler that gets called when the 'hidden' flag is toggled.
* @private
...
...
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