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
af0093bd
Commit
af0093bd
authored
Feb 18, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix: MUC invite form not shown
parent
5e0c320f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
30 deletions
+39
-30
CHANGES.md
CHANGES.md
+1
-0
dist/converse.js
dist/converse.js
+2
-2
spec/muc.js
spec/muc.js
+34
-26
src/converse-muc-views.js
src/converse-muc-views.js
+2
-2
No files found.
CHANGES.md
View file @
af0093bd
...
...
@@ -9,6 +9,7 @@
-
Rudimentary support for XEP-0333 chat markers
-
Better support for XEP-0359
`stanza-id`
and
`origin-id`
elements.
-
Bugfix: restore textarea size after sending a message
-
Bugfix: MUC invite form not appearing
-
#1369 Don't wrongly interpret message with
`subject`
as a topic change.
-
#1405 Status of contacts list are not displayed properly
-
#1408 New config option
`roomconfig_whitelist`
...
...
dist/converse.js
View file @
af0093bd
...
...
@@ -55146,8 +55146,8 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins
initialize() {
Backbone.OrderedListView.prototype.initialize.apply(this, arguments);
this.chatroomview = this.model.chatroomview;
this.chatroomview.model.on('change:open', this.renderInviteWidget, this);
this.chatroomview.model.on('change:affiliation', this.renderInviteWidget, this);
this.chatroomview.model.features.on('change:open', this.renderInviteWidget, this);
this.chatroomview.model.features.on('change', this.renderRoomFeatures, this);
this.render();
this.model.fetch({
...
...
@@ -55251,7 +55251,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins
},
shouldInviteWidgetBeShown() {
return _converse.allow_muc_invitations && (this.chatroomview.model.get('open') || this.chatroomview.model.get('affiliation') === "owner");
return _converse.allow_muc_invitations && (this.chatroomview.model.
features.
get('open') || this.chatroomview.model.get('affiliation') === "owner");
},
initInviteWidget() {
spec/muc.js
View file @
af0093bd
...
...
@@ -1725,20 +1725,31 @@
// cheat here and emit the event.
_converse
.
emit
(
'
rosterContactsFetched
'
);
await
test_utils
.
openChatRoom
(
_converse
,
'
lounge
'
,
'
localhost
'
,
'
dummy
'
);
spyOn
(
_converse
,
'
emit
'
);
spyOn
(
window
,
'
prompt
'
).
and
.
callFake
(
function
()
{
return
"
Please join!
"
;
});
const
features
=
[
'
http://jabber.org/protocol/muc
'
,
'
jabber:iq:register
'
,
'
muc_passwordprotected
'
,
'
muc_hidden
'
,
'
muc_temporary
'
,
'
muc_membersonly
'
,
'
muc_unmoderated
'
,
'
muc_anonymous
'
]
await
test_utils
.
openAndEnterChatRoom
(
_converse
,
'
lounge
'
,
'
localhost
'
,
'
dummy
'
,
features
);
spyOn
(
_converse
,
'
emit
'
).
and
.
callThrough
();
spyOn
(
window
,
'
prompt
'
).
and
.
callFake
(()
=>
"
Please join!
"
);
const
view
=
_converse
.
chatboxviews
.
get
(
'
lounge@localhost
'
);
const
chat_area
=
view
.
el
.
querySelector
(
'
.chat-area
'
);
// XXX: cheating a lttle bit, normally this'll be set after
// receiving the features for the groupchat.
view
.
model
.
set
(
'
open
'
,
'
true
'
);
expect
(
view
.
model
.
get
(
'
affiliation
'
)).
toBe
(
'
owner
'
);
expect
(
view
.
model
.
features
.
get
(
'
open
'
)).
toBe
(
false
);
expect
(
view
.
el
.
querySelectorAll
(
'
input.invited-contact
'
).
length
).
toBe
(
1
);
view
.
model
.
set
(
'
affiliation
'
,
'
member
'
);
await
test_utils
.
waitUntil
(()
=>
view
.
el
.
querySelectorAll
(
'
input.invited-contact
'
).
length
===
0
);
view
.
model
.
features
.
set
(
'
open
'
,
'
true
'
);
spyOn
(
view
.
model
,
'
directInvite
'
).
and
.
callThrough
();
const
chat_area
=
view
.
el
.
querySelector
(
'
.chat-area
'
);
chat_area
.
parentElement
.
removeChild
(
chat_area
);
await
test_utils
.
waitUntil
(()
=>
view
.
el
.
querySelectorAll
(
'
input.invited-contact
'
).
length
);
const
input
=
view
.
el
.
querySelector
(
'
input.invited-contact
'
);
expect
(
input
.
getAttribute
(
'
placeholder
'
)).
toBe
(
'
Invite
'
);
...
...
@@ -1755,8 +1766,6 @@
expect
(
hint
.
textContent
).
toBe
(
'
Felix Amsel
'
);
expect
(
input
.
nextSibling
.
childNodes
.
length
).
toBe
(
1
);
if
(
typeof
(
Event
)
===
'
function
'
)
{
// Not working on PhantomJS
evt
=
new
Event
(
'
mousedown
'
,
{
'
bubbles
'
:
true
});
evt
.
button
=
0
;
// For some reason awesomplete wants this
hint
.
dispatchEvent
(
evt
);
...
...
@@ -1770,7 +1779,6 @@
`<x jid="lounge@localhost" reason="Please join!" xmlns="jabber:x:conference"/>`
+
`</message>`
);
}
done
();
}));
...
...
src/converse-muc-views.js
View file @
af0093bd
...
...
@@ -1849,8 +1849,8 @@ converse.plugins.add('converse-muc-views', {
Backbone
.
OrderedListView
.
prototype
.
initialize
.
apply
(
this
,
arguments
);
this
.
chatroomview
=
this
.
model
.
chatroomview
;
this
.
chatroomview
.
model
.
on
(
'
change:open
'
,
this
.
renderInviteWidget
,
this
);
this
.
chatroomview
.
model
.
on
(
'
change:affiliation
'
,
this
.
renderInviteWidget
,
this
);
this
.
chatroomview
.
model
.
features
.
on
(
'
change:open
'
,
this
.
renderInviteWidget
,
this
);
this
.
chatroomview
.
model
.
features
.
on
(
'
change
'
,
this
.
renderRoomFeatures
,
this
);
this
.
render
();
...
...
@@ -1955,7 +1955,7 @@ converse.plugins.add('converse-muc-views', {
shouldInviteWidgetBeShown
()
{
return
_converse
.
allow_muc_invitations
&&
(
this
.
chatroomview
.
model
.
get
(
'
open
'
)
||
(
this
.
chatroomview
.
model
.
features
.
get
(
'
open
'
)
||
this
.
chatroomview
.
model
.
get
(
'
affiliation
'
)
===
"
owner
"
);
},
...
...
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