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
5f009875
Commit
5f009875
authored
Dec 06, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix. Pass original_stanza to `isDuplicate`
parent
79bfb456
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
3 deletions
+65
-3
CHANGES.md
CHANGES.md
+1
-0
spec/mam.js
spec/mam.js
+61
-1
src/headless/converse-muc.js
src/headless/converse-muc.js
+3
-2
No files found.
CHANGES.md
View file @
5f009875
...
...
@@ -4,6 +4,7 @@
-
Don't render http (i.e. non-TLS) resources
-
Bugfix: Converse caused
`RID out of range`
errors on Prosody
-
Bugfix: MUC messages sometimes appear twice after resync.
-
#1331 Fix missing checkmarks in old muc messages
-
#1333 Don't send receipt requests in MUCs
...
...
spec/mam.js
View file @
5f009875
...
...
@@ -15,7 +15,7 @@
describe
(
"
Archived Messages
"
,
function
()
{
it
(
"
aren't shown as duplicates
"
,
it
(
"
aren't shown as duplicates
by comparing their stanza-id attribute
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
discoInitialized
'
],
{},
async
function
(
done
,
_converse
)
{
...
...
@@ -57,7 +57,67 @@
done
();
}));
it
(
"
aren't shown as duplicates by comparing their queryid attribute
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
discoInitialized
'
],
{},
async
function
(
done
,
_converse
)
{
await
test_utils
.
openAndEnterChatRoom
(
_converse
,
'
discuss
'
,
'
conference.conversejs.org
'
,
'
dummy
'
);
const
view
=
_converse
.
chatboxviews
.
get
(
'
discuss@conference.conversejs.org
'
);
let
stanza
=
Strophe
.
xmlHtmlNode
(
`<message xmlns="jabber:client"
to="discuss@conference.conversejs.org"
type="groupchat" xml:lang="en"
from="discuss@conference.conversejs.org/prezel">
<stanza-id xmlns="urn:xmpp:sid:0" id="7a9fde91-4387-4bf8-b5d3-978dab8f6bf3" by="discuss@conference.conversejs.org"/>
<body>looks like omemo fails completely with "bundle is undefined" when there is a device in the devicelist that has no keys published</body>
<x xmlns="http://jabber.org/protocol/muc#user">
<item affiliation="none" jid="prezel@blubber.im" role="participant"/>
</x>
</message>`
).
firstElementChild
;
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
await
test_utils
.
waitUntil
(()
=>
view
.
content
.
querySelectorAll
(
'
.chat-msg
'
).
length
);
stanza
=
Strophe
.
xmlHtmlNode
(
`<message xmlns="jabber:client" to="dummy@localhost/resource" from="discuss@conference.conversejs.org">
<result xmlns="urn:xmpp:mam:2" queryid="06fea9ca-97c9-48c4-8583-009ff54ea2e8" id="7a9fde91-4387-4bf8-b5d3-978dab8f6bf3">
<forwarded xmlns="urn:xmpp:forward:0">
<delay xmlns="urn:xmpp:delay" stamp="2018-12-05T04:53:12Z"/>
<message xmlns="jabber:client" to="discuss@conference.conversejs.org" type="groupchat" xml:lang="en" from="discuss@conference.conversejs.org/prezel">
<body>looks like omemo fails completely with "bundle is undefined" when there is a device in the devicelist that has no keys published</body>
<x xmlns="http://jabber.org/protocol/muc#user">
<item affiliation="none" jid="prezel@blubber.im" role="participant"/>
</x>
</message>
</forwarded>
</result>
</message>`
).
firstElementChild
;
spyOn
(
view
.
model
,
'
isDuplicate
'
).
and
.
callThrough
();
view
.
model
.
onMessage
(
stanza
);
await
test_utils
.
waitUntil
(()
=>
view
.
model
.
isDuplicate
.
calls
.
count
());
expect
(
view
.
model
.
isDuplicate
.
calls
.
count
()).
toBe
(
1
);
expect
(
view
.
content
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
1
);
stanza
=
Strophe
.
xmlHtmlNode
(
`<message xmlns="jabber:client" to="dummy@localhost/resource" from="discuss@conference.conversejs.org">
<result xmlns="urn:xmpp:mam:2" queryid="06fea9ca-97c9-48c4-8583-009ff54ea2e8" id="7a9fde91-4387-4bf8-b5d3-978dab8f6bf3">
<forwarded xmlns="urn:xmpp:forward:0">
<delay xmlns="urn:xmpp:delay" stamp="2018-12-05T04:53:12Z"/>
<message xmlns="jabber:client" to="discuss@conference.conversejs.org" type="groupchat" xml:lang="en" from="discuss@conference.conversejs.org/prezel">
<body>looks like omemo fails completely with "bundle is undefined" when there is a device in the devicelist that has no keys published</body>
<x xmlns="http://jabber.org/protocol/muc#user">
<item affiliation="none" jid="prezel@blubber.im" role="participant"/>
</x>
</message>
</forwarded>
</result>
</message>`
).
firstElementChild
;
view
.
model
.
onMessage
(
stanza
);
expect
(
view
.
model
.
isDuplicate
.
calls
.
count
()).
toBe
(
2
);
expect
(
view
.
content
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
1
);
done
();
}))
});
describe
(
"
The archive.query API
"
,
function
()
{
...
...
src/headless/converse-muc.js
View file @
5f009875
...
...
@@ -915,7 +915,8 @@ converse.plugins.add('converse-muc', {
return
data
;
},
isDuplicate
(
message
)
{
isDuplicate
(
message
,
original_stanza
)
{
// XXX: original_stanza is not used here, but in converse-mam
const
msgid
=
message
.
getAttribute
(
'
id
'
),
jid
=
message
.
getAttribute
(
'
from
'
);
...
...
@@ -958,7 +959,7 @@ converse.plugins.add('converse-muc', {
if
(
forwarded
)
{
stanza
=
forwarded
.
querySelector
(
'
message
'
);
}
if
(
this
.
isDuplicate
(
stanza
))
{
if
(
this
.
isDuplicate
(
stanza
,
original_stanza
))
{
return
;
}
const
jid
=
stanza
.
getAttribute
(
'
from
'
),
...
...
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