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
9ce315de
Commit
9ce315de
authored
Jan 14, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix. Handle stanza that clears the MUC subject
parent
5128bc9e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
5 deletions
+30
-5
CHANGES.md
CHANGES.md
+4
-1
spec/muc.js
spec/muc.js
+25
-3
src/headless/converse-muc.js
src/headless/converse-muc.js
+1
-1
No files found.
CHANGES.md
View file @
9ce315de
# Changelog
# Changelog
## 6.0.1 (Unreleased)
-
Bugfix. Handle stanza that clears the MUC subject
-
#1313: Stylistic improvements to the send button
-
#1313: Stylistic improvements to the send button
-
#1793: Send button doesn't appear in Firefox in 1:1 chats
-
#1793: Send button doesn't appear in Firefox in 1:1 chats
-
#1822: Don't log error if user has no bookmarks
-
#1822: Don't log error if user has no bookmarks
-
#1820: Set focus on jid field after controlbox is loaded
-
#1820: Set focus on jid field after controlbox is loaded
-
#1823: New config options
[
muc_roomid_policy
](
https://conversejs.org/docs/html/configuration.html#muc-roomid-policy
)
-
#1823: New config options
[
muc_roomid_policy
](
https://conversejs.org/docs/html/configuration.html#muc-roomid-policy
)
and
[
muc_roomid_policy_hint
](
https://conversejs.org/docs/html/configuration.html#muc-roomid-policy-hint
)
and
[
muc_roomid_policy_hint
](
https://conversejs.org/docs/html/configuration.html#muc-roomid-policy-hint
)
-
#1826: A user can now add himself as a contact
-
#1826: A user can now add himself as a contact
## 6.0.0 (2020-01-09)
## 6.0.0 (2020-01-09)
...
...
spec/muc.js
View file @
9ce315de
...
@@ -2167,12 +2167,22 @@
...
@@ -2167,12 +2167,22 @@
</message>`
);
</message>`
);
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
await
new
Promise
(
resolve
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
await
new
Promise
(
resolve
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
expect
(
sizzle
(
'
.chat-topic
'
).
length
).
toBe
(
1
);
expect
(
sizzle
(
'
.chat-topic
'
,
view
.
el
).
length
).
toBe
(
1
);
expect
(
sizzle
(
'
.chat-msg__subject
'
).
length
).
toBe
(
1
);
expect
(
sizzle
(
'
.chat-msg__subject
'
,
view
.
el
).
length
).
toBe
(
1
);
expect
(
sizzle
(
'
.chat-msg__subject
'
).
pop
().
textContent
.
trim
()).
toBe
(
'
This is a message subject
'
);
expect
(
sizzle
(
'
.chat-msg__subject
'
,
view
.
el
).
pop
().
textContent
.
trim
()).
toBe
(
'
This is a message subject
'
);
expect
(
sizzle
(
'
.chat-msg__text
'
).
length
).
toBe
(
1
);
expect
(
sizzle
(
'
.chat-msg__text
'
).
length
).
toBe
(
1
);
expect
(
sizzle
(
'
.chat-msg__text
'
).
pop
().
textContent
.
trim
()).
toBe
(
'
This is a message
'
);
expect
(
sizzle
(
'
.chat-msg__text
'
).
pop
().
textContent
.
trim
()).
toBe
(
'
This is a message
'
);
expect
(
view
.
el
.
querySelector
(
'
.chatroom-description
'
).
textContent
.
trim
()).
toBe
(
text
);
expect
(
view
.
el
.
querySelector
(
'
.chatroom-description
'
).
textContent
.
trim
()).
toBe
(
text
);
// Removes current topic
stanza
=
u
.
toStanza
(
`<message xmlns="jabber:client" to="jc@opkode.com/_converse.js-60429116" type="groupchat" from="jdev@conference.jabber.org/ralphm">
<subject/>
</message>`
);
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
await
new
Promise
(
resolve
=>
view
.
model
.
once
(
'
change:subject
'
,
resolve
));
expect
(
view
.
el
.
querySelector
(
'
.chatroom-description
'
).
textContent
.
trim
()).
toBe
(
""
);
expect
(
view
.
el
.
querySelector
(
'
.chat-info:last-child
'
).
textContent
.
trim
()).
toBe
(
"
Topic cleared by ralphm
"
);
done
();
done
();
}));
}));
...
@@ -3266,6 +3276,18 @@
...
@@ -3266,6 +3276,18 @@
'
<message from="romeo@montague.lit/orchard" to="lounge@montague.lit" type="groupchat" xmlns="jabber:client">
'
+
'
<message from="romeo@montague.lit/orchard" to="lounge@montague.lit" type="groupchat" xmlns="jabber:client">
'
+
'
<subject xmlns="jabber:client">This is yet another subject</subject>
'
+
'
<subject xmlns="jabber:client">This is yet another subject</subject>
'
+
'
</message>
'
);
'
</message>
'
);
// Check unsetting the topic
textarea
.
value
=
'
/topic
'
;
view
.
onKeyDown
({
target
:
textarea
,
preventDefault
:
function
preventDefault
()
{},
keyCode
:
13
});
expect
(
Strophe
.
serialize
(
sent_stanza
).
toLocaleString
()).
toBe
(
'
<message from="romeo@montague.lit/orchard" to="lounge@montague.lit" type="groupchat" xmlns="jabber:client">
'
+
'
<subject xmlns="jabber:client"></subject>
'
+
'
</message>
'
);
done
();
done
();
}));
}));
...
...
src/headless/converse-muc.js
View file @
9ce315de
...
@@ -1477,7 +1477,7 @@ converse.plugins.add('converse-muc', {
...
@@ -1477,7 +1477,7 @@ converse.plugins.add('converse-muc', {
* @param { object } attrs - The message attributes
* @param { object } attrs - The message attributes
*/
*/
subjectChangeHandled
(
attrs
)
{
subjectChangeHandled
(
attrs
)
{
if
(
attrs
.
subject
&&
!
attrs
.
thread
&&
!
attrs
.
message
)
{
if
(
isString
(
attrs
.
subject
)
&&
!
attrs
.
thread
&&
!
attrs
.
message
)
{
// https://xmpp.org/extensions/xep-0045.html#subject-mod
// https://xmpp.org/extensions/xep-0045.html#subject-mod
// -----------------------------------------------------
// -----------------------------------------------------
// The subject is changed by sending a message of type "groupchat" to the <room@service>,
// The subject is changed by sending a message of type "groupchat" to the <room@service>,
...
...
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