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
97400ed5
Commit
97400ed5
authored
Mar 31, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also identify sent carbons as such.
parent
b8107afa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
dist/converse.js
dist/converse.js
+5
-4
src/headless/converse-chatboxes.js
src/headless/converse-chatboxes.js
+6
-6
No files found.
dist/converse.js
View file @
97400ed5
...
...
@@ -62583,7 +62583,7 @@ _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add('converse-cha
// TODO: currently Strophe has no way to register a handler
// for stanzas without a `type` attribute.
// We could update it to accept null to mean no attribute,
// but that would be a backward-incompatible chnge
// but that would be a backward-incompatible ch
a
nge
return true; // Gets handled above.
}
...
...
@@ -62716,9 +62716,9 @@ _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add('converse-cha
if (!_.isNull(forwarded)) {
const forwarded_message = forwarded.querySelector('message'),
forwarded_from = forwarded_message.getAttribute('from')
;
is_carbon = !_.isNull(stanza.querySelector(`received[xmlns="${Strophe.NS.CARBONS}"]`))
;
is_
mam = sizzle(`message > result[xmlns="${Strophe.NS.MAM
}"]`, stanza).length > 0;
forwarded_from = forwarded_message.getAttribute('from')
,
xmlns = Strophe.NS.CARBONS
;
is_
carbon = sizzle(`received[xmlns="${xmlns
}"]`, stanza).length > 0;
if (is_carbon && Strophe.getBareJidFromJid(forwarded_from) !== from_jid) {
// Prevent message forging via carbons
...
...
@@ -62726,6 +62726,7 @@ _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add('converse-cha
return true;
}
is_mam = sizzle(`message > result[xmlns="${Strophe.NS.MAM}"]`, stanza).length > 0;
stanza = forwarded_message;
from_jid = stanza.getAttribute('from');
to_jid = stanza.getAttribute('to');
src/headless/converse-chatboxes.js
View file @
97400ed5
...
...
@@ -336,7 +336,7 @@ converse.plugins.add('converse-chatboxes', {
},
getDuplicateMessage
(
stanza
)
{
return
this
.
findDuplicateFromOriginID
(
stanza
)
||
this
.
findDuplicateFromStanzaID
(
stanza
);
return
this
.
findDuplicateFromOriginID
(
stanza
)
||
this
.
findDuplicateFromStanzaID
(
stanza
);
},
findDuplicateFromOriginID
(
stanza
)
{
...
...
@@ -773,7 +773,7 @@ converse.plugins.add('converse-chatboxes', {
// TODO: currently Strophe has no way to register a handler
// for stanzas without a `type` attribute.
// We could update it to accept null to mean no attribute,
// but that would be a backward-incompatible chnge
// but that would be a backward-incompatible ch
a
nge
return
true
;
// Gets handled above.
}
this
.
onMessage
(
stanza
);
...
...
@@ -900,15 +900,15 @@ converse.plugins.add('converse-chatboxes', {
if
(
!
_
.
isNull
(
forwarded
))
{
const
forwarded_message
=
forwarded
.
querySelector
(
'
message
'
),
forwarded_from
=
forwarded_message
.
getAttribute
(
'
from
'
);
is_carbon
=
!
_
.
isNull
(
stanza
.
querySelector
(
`received[xmlns="
${
Strophe
.
NS
.
CARBONS
}
"]`
));
is_mam
=
sizzle
(
`message > result[xmlns="
${
Strophe
.
NS
.
MAM
}
"]`
,
stanza
).
length
>
0
;
forwarded_from
=
forwarded_message
.
getAttribute
(
'
from
'
),
xmlns
=
Strophe
.
NS
.
CARBONS
;
is_carbon
=
sizzle
(
`received[xmlns="
${
xmlns
}
"]`
,
stanza
).
length
>
0
;
if
(
is_carbon
&&
Strophe
.
getBareJidFromJid
(
forwarded_from
)
!==
from_jid
)
{
// Prevent message forging via carbons
// https://xmpp.org/extensions/xep-0280.html#security
return
true
;
}
is_mam
=
sizzle
(
`message > result[xmlns="
${
Strophe
.
NS
.
MAM
}
"]`
,
stanza
).
length
>
0
;
stanza
=
forwarded_message
;
from_jid
=
stanza
.
getAttribute
(
'
from
'
);
to_jid
=
stanza
.
getAttribute
(
'
to
'
);
...
...
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