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
11ac846b
Commit
11ac846b
authored
Oct 27, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1259
parent
f0c5f697
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
3 deletions
+75
-3
CHANGES.md
CHANGES.md
+2
-1
dist/converse.js
dist/converse.js
+4
-0
index.html
index.html
+2
-2
spec/chatroom.js
spec/chatroom.js
+64
-0
src/converse-muc-views.js
src/converse-muc-views.js
+3
-0
No files found.
CHANGES.md
View file @
11ac846b
...
...
@@ -4,9 +4,10 @@
-
Use
[
Lerna
](
https://lernajs.io/
)
to create the @converse/headless package
-
Use ES2015 modules instead of UMD.
-
#1252 Correctly reflect the state in bookmark icon title.
-
#1257 Prefer 'probably' over 'maybe' when evaluating audio play support.
-
#1259 Don't inform of affiliation change after user leaves MUC
-
#1261 File upload not working
-
#1252 Correctly reflect the state in bookmark icon title.
-
#1272 Hiding MUC occupants leaves a blank space
## 4.0.3 (2018-10-22)
...
...
dist/converse.js
View file @
11ac846b
...
...
@@ -63342,6 +63342,10 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins
},
informOfOccupantsRoleChange(occupant, changed) {
if (changed === "none") {
return;
}
const previous_role = occupant._previousAttributes.role;
if (previous_role === 'moderator') {
index.html
View file @
11ac846b
...
...
@@ -290,8 +290,8 @@
</p>
<p>
Currently the
<strong>
conversejs.org
</strong>
XMPP
server does not support HTTP-file upload
, which means
that we don't host any uploaded files of users.
server does not support HTTP-file upload
(although Converse the client does),
which means
that we don't host any uploaded files of users.
</p>
<p>
During normal operations we don't log or process IP
...
...
spec/chatroom.js
View file @
11ac846b
...
...
@@ -930,6 +930,70 @@
}).
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
FATAL
))
}));
it
(
"
role-change messages that follow a MUC leave are left out
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
,
'
chatBoxesFetched
'
],
{},
async
function
(
done
,
_converse
)
{
// See https://github.com/conversejs/converse.js/issues/1259
await
test_utils
.
openAndEnterChatRoom
(
_converse
,
'
conversations
'
,
'
conference.siacs.eu
'
,
'
dummy
'
);
const
presence
=
$pres
({
to
:
'
dummy@localhost/resource
'
,
from
:
'
conversations@conference.siacs.eu/Guus
'
}).
c
(
'
x
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
MUC_USER
}).
c
(
'
item
'
,
{
'
affiliation
'
:
'
none
'
,
'
jid
'
:
'
Guus@localhost/xxx
'
,
'
role
'
:
'
visitor
'
});
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
presence
));
const
view
=
_converse
.
chatboxviews
.
get
(
'
conversations@conference.siacs.eu
'
);
const
msg
=
$msg
({
'
from
'
:
'
conversations@conference.siacs.eu/dummy
'
,
'
id
'
:
(
new
Date
()).
getTime
(),
'
to
'
:
'
dummy@localhost
'
,
'
type
'
:
'
groupchat
'
}).
c
(
'
body
'
).
t
(
'
Some message
'
).
tree
();
view
.
model
.
onMessage
(
msg
);
await
new
Promise
((
resolve
,
reject
)
=>
view
.
once
(
'
messageInserted
'
,
resolve
));
let
stanza
=
Strophe
.
xmlHtmlNode
(
`<presence xmlns="jabber:client" to="dummy@localhost/resource" type="unavailable" from="conversations@conference.siacs.eu/Guus">
<x xmlns="http://jabber.org/protocol/muc#user">
<item affiliation="none" role="none"/>
</x>
</presence>`
).
firstElementChild
;
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
stanza
=
Strophe
.
xmlHtmlNode
(
`<presence xmlns="jabber:client" to="dummy@localhost/resource" from="conversations@conference.siacs.eu/Guus">
<c xmlns="http://jabber.org/protocol/caps" node="http://conversations.im" ver="ISg6+9AoK1/cwhbNEDviSvjdPzI=" hash="sha-1"/>
<x xmlns="vcard-temp:x:update">
<photo>bf987c486c51fbc05a6a4a9f20dd19b5efba3758</photo>
</x>
<x xmlns="http://jabber.org/protocol/muc#user">
<item affiliation="none" role="visitor"/>
</x>
</presence>`
).
firstElementChild
;
_converse
.
connection
.
_dataRecv
(
test_utils
.
createRequest
(
stanza
));
const
chat_content
=
view
.
el
.
querySelector
(
'
.chat-content
'
);
const
messages
=
chat_content
.
querySelectorAll
(
'
div.chat-info
'
);
expect
(
messages
.
length
).
toBe
(
3
);
expect
(
messages
[
0
].
textContent
).
toBe
(
'
dummy has entered the groupchat
'
);
expect
(
messages
[
1
].
textContent
).
toBe
(
'
Guus has entered the groupchat
'
);
expect
(
messages
[
2
].
textContent
).
toBe
(
'
Guus has left and re-entered the groupchat
'
);
done
();
}));
it
(
"
shows a new day indicator if a join/leave message is received on a new day
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
...
...
src/converse-muc-views.js
View file @
11ac846b
...
...
@@ -645,6 +645,9 @@ converse.plugins.add('converse-muc-views', {
},
informOfOccupantsRoleChange
(
occupant
,
changed
)
{
if
(
changed
===
"
none
"
)
{
return
;
}
const
previous_role
=
occupant
.
_previousAttributes
.
role
;
if
(
previous_role
===
'
moderator
'
)
{
this
.
showChatEvent
(
__
(
"
%1$s is no longer a moderator
"
,
occupant
.
get
(
'
nick
'
)))
...
...
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