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
dbcf6002
Commit
dbcf6002
authored
Feb 12, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1442
parent
84e0ce66
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
7 deletions
+61
-7
CHANGES.md
CHANGES.md
+5
-4
dist/converse.js
dist/converse.js
+9
-1
spec/messages.js
spec/messages.js
+35
-1
src/headless/converse-muc.js
src/headless/converse-muc.js
+12
-1
No files found.
CHANGES.md
View file @
dbcf6002
...
@@ -5,15 +5,16 @@
...
@@ -5,15 +5,16 @@
-
Updated translations: af, cz, de, es, eu, ga, he, hi, ja, nb, nl_BE, zh_CN
-
Updated translations: af, cz, de, es, eu, ga, he, hi, ja, nb, nl_BE, zh_CN
-
New language supported: Esperanto
-
New language supported: Esperanto
-
Accessibility: Tag the chat-content as an ARIA live region, for screen readers
-
Accessibility: Tag the chat-content as an ARIA live region, for screen readers
-
Set releases URL to new Github repo
-
#1369 Don't wrongly interpret message with
`subject`
as a topic change.
-
#1369 Don't wrongly interpret message with
`subject`
as a topic change.
-
#1408 new config option
`roomconfig_whitelist`
-
#1408 new config option
`roomconfig_whitelist`
-
#1417 Margin between nickname and badge
-
#1421 fix direct invite for membersonly room
-
#1422 Resurrect the
`muc_show_join_leave`
option
-
#1412 muc moderator commands can be disabled selectively by config
-
#1412 muc moderator commands can be disabled selectively by config
-
#1413 fix moderator commands that change affiliation
-
#1413 fix moderator commands that change affiliation
-
#1414 Prevent duplicate messages on MUC join
-
#1414 Prevent duplicate messages on MUC join
-
Update releases url
-
#1417 Margin between nickname and badge
-
#1421 fix direct invite for membersonly room
-
#1422 Resurrect the
`muc_show_join_leave`
option
-
#1442 MUC read receipts causing empty lines
## 4.1.0 (2019-01-11)
## 4.1.0 (2019-01-11)
...
...
dist/converse.js
View file @
dbcf6002
...
@@ -66987,6 +66987,14 @@ _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins.add('converse-muc
...
@@ -66987,6 +66987,14 @@ _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins.add('converse-muc
}
}
},
},
isReceipt(stanza) {
return sizzle(`[xmlns="${Strophe.NS.RECEIPTS}"]`, stanza).length > 0;
},
isChatMarker(stanza) {
return sizzle(`[xmlns="${Strophe.NS.MARKERS}"]`, stanza).length > 0;
},
async onMessage(stanza) {
async onMessage(stanza) {
/* Handler for all MUC messages sent to this groupchat.
/* Handler for all MUC messages sent to this groupchat.
*
*
...
@@ -67011,7 +67019,7 @@ _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins.add('converse-muc
...
@@ -67011,7 +67019,7 @@ _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins.add('converse-muc
return;
return;
}
}
if (!this.handleMessageCorrection(stanza)) {
if (!this.handleMessageCorrection(stanza)
&& !this.isReceipt(stanza) && !this.isChatMarker(stanza)
) {
if (attrs.subject && !attrs.thread && !attrs.message) {
if (attrs.subject && !attrs.thread && !attrs.message) {
// https://xmpp.org/extensions/xep-0045.html#subject-mod
// https://xmpp.org/extensions/xep-0045.html#subject-mod
// -----------------------------------------------------
// -----------------------------------------------------
spec/messages.js
View file @
dbcf6002
...
@@ -2316,7 +2316,7 @@
...
@@ -2316,7 +2316,7 @@
done
();
done
();
}));
}));
it
(
"
delivery can be acknowledged by a receipt
"
,
it
(
"
will be shown as received upon MUC reflection
"
,
mock
.
initConverse
(
mock
.
initConverse
(
null
,
[
'
rosterGroupsFetched
'
],
{},
null
,
[
'
rosterGroupsFetched
'
],
{},
async
function
(
done
,
_converse
)
{
async
function
(
done
,
_converse
)
{
...
@@ -2347,6 +2347,40 @@
...
@@ -2347,6 +2347,40 @@
done
();
done
();
}));
}));
it
(
"
can cause a delivery receipt
"
,
mock
.
initConverse
(
null
,
[
'
rosterGroupsFetched
'
],
{},
async
function
(
done
,
_converse
)
{
test_utils
.
createContacts
(
_converse
,
'
current
'
);
await
test_utils
.
openAndEnterChatRoom
(
_converse
,
'
lounge
'
,
'
localhost
'
,
'
dummy
'
);
const
view
=
_converse
.
chatboxviews
.
get
(
'
lounge@localhost
'
);
const
textarea
=
view
.
el
.
querySelector
(
'
textarea.chat-textarea
'
);
textarea
.
value
=
'
But soft, what light through yonder airlock breaks?
'
;
view
.
keyPressed
({
target
:
textarea
,
preventDefault
:
_
.
noop
,
keyCode
:
13
// Enter
});
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
expect
(
view
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
1
);
const
msg_obj
=
view
.
model
.
messages
.
at
(
0
);
const
stanza
=
u
.
toStanza
(
`
<message xml:lang="en" to="dummy@localhost/resource"
from="lounge@localhost/some1" type="groupchat" xmlns="jabber:client">
<received xmlns="urn:xmpp:receipts" id="
${
msg_obj
.
get
(
'
msgid
'
)}
"/>
<origin-id xmlns="urn:xmpp:sid:0" id="CE08D448-5ED8-4B6A-BB5B-07ED9DFE4FF0"/>
</message>`
);
spyOn
(
_converse
,
'
emit
'
).
and
.
callThrough
();
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
await
test_utils
.
waitUntil
(()
=>
_converse
.
emit
.
calls
.
count
()
===
1
);
expect
(
view
.
el
.
querySelectorAll
(
'
.chat-msg
'
).
length
).
toBe
(
1
);
expect
(
view
.
el
.
querySelectorAll
(
'
.chat-msg__receipt
'
).
length
).
toBe
(
0
);
expect
(
_converse
.
emit
).
toHaveBeenCalledWith
(
'
message
'
,
jasmine
.
any
(
Object
));
done
();
}));
describe
(
"
when received
"
,
function
()
{
describe
(
"
when received
"
,
function
()
{
it
(
"
highlights all users mentioned via XEP-0372 references
"
,
it
(
"
highlights all users mentioned via XEP-0372 references
"
,
...
...
src/headless/converse-muc.js
View file @
dbcf6002
...
@@ -978,6 +978,14 @@ converse.plugins.add('converse-muc', {
...
@@ -978,6 +978,14 @@ converse.plugins.add('converse-muc', {
}
}
},
},
isReceipt
(
stanza
)
{
return
sizzle
(
`[xmlns="
${
Strophe
.
NS
.
RECEIPTS
}
"]`
,
stanza
).
length
>
0
;
},
isChatMarker
(
stanza
)
{
return
sizzle
(
`[xmlns="
${
Strophe
.
NS
.
MARKERS
}
"]`
,
stanza
).
length
>
0
;
},
async
onMessage
(
stanza
)
{
async
onMessage
(
stanza
)
{
/* Handler for all MUC messages sent to this groupchat.
/* Handler for all MUC messages sent to this groupchat.
*
*
...
@@ -998,7 +1006,10 @@ converse.plugins.add('converse-muc', {
...
@@ -998,7 +1006,10 @@ converse.plugins.add('converse-muc', {
if
(
!
attrs
.
nick
)
{
if
(
!
attrs
.
nick
)
{
return
;
return
;
}
}
if
(
!
this
.
handleMessageCorrection
(
stanza
))
{
if
(
!
this
.
handleMessageCorrection
(
stanza
)
&&
!
this
.
isReceipt
(
stanza
)
&&
!
this
.
isChatMarker
(
stanza
))
{
if
(
attrs
.
subject
&&
!
attrs
.
thread
&&
!
attrs
.
message
)
{
if
(
attrs
.
subject
&&
!
attrs
.
thread
&&
!
attrs
.
message
)
{
// https://xmpp.org/extensions/xep-0045.html#subject-mod
// https://xmpp.org/extensions/xep-0045.html#subject-mod
// -----------------------------------------------------
// -----------------------------------------------------
...
...
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