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
dd082107
Commit
dd082107
authored
May 04, 2019
by
supun19
Committed by
JC Brand
May 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Groupchat auto-configuration now supports list-multi fields
parent
1d9e1a62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
CHANGES.md
CHANGES.md
+1
-1
spec/muc.js
spec/muc.js
+9
-0
src/headless/converse-muc.js
src/headless/converse-muc.js
+5
-6
No files found.
CHANGES.md
View file @
dd082107
# Changelog
## 5.0.0 (Unreleased)
-
Groupchat default configuration now supports
`list-multi`
fields
-
Bugfix: Don't set
`muc_domain`
for roomspanel if
`locked_muc_domain`
is
`true`
.
-
Bugfix: Modal auto-closes when you open it for a second time.
-
Take roster nickname into consideration when rendering messages and chat headings.
...
...
spec/muc.js
View file @
dd082107
...
...
@@ -156,6 +156,7 @@
'
nick
'
:
'
some1
'
,
'
auto_configure
'
:
true
,
'
roomconfig
'
:
{
'
getmemberlist
'
:
[
'
moderator
'
,
'
participant
'
],
'
changesubject
'
:
false
,
'
membersonly
'
:
true
,
'
persistentroom
'
:
true
,
...
...
@@ -224,6 +225,13 @@
<field type="list-single" var="muc#roomconfig_whois" label="Who May Discover Real JIDs?"><option label="Moderators Only">
<value>moderators</value></option><option label="Anyone"><value>anyone</value></option>
</field>
<field label="Roles and Affiliations that May Retrieve Member List"
type="list-multi"
var="muc#roomconfig_getmemberlist">
<value>moderator</value>
<value>participant</value>
<value>visitor</value>
</field>
<field type="text-private" var="muc#roomconfig_roomsecret" label="Password"><value/></field>
<field type="boolean" var="muc#roomconfig_moderatedroom" label="Make Room Moderated?"/>
<field type="boolean" var="muc#roomconfig_membersonly" label="Make Room Members-Only?"/>
...
...
@@ -243,6 +251,7 @@
expect
(
sizzle
(
'
field[var="muc#roomconfig_roomname"] value
'
,
sent_stanza
).
pop
().
textContent
).
toBe
(
'
Room
'
);
expect
(
sizzle
(
'
field[var="muc#roomconfig_roomdesc"] value
'
,
sent_stanza
).
pop
().
textContent
).
toBe
(
'
Welcome to this groupchat
'
);
expect
(
sizzle
(
'
field[var="muc#roomconfig_persistentroom"] value
'
,
sent_stanza
).
pop
().
textContent
).
toBe
(
'
1
'
);
expect
(
sizzle
(
'
field[var="muc#roomconfig_getmemberlist"] value
'
,
sent_stanza
).
map
(
e
=>
e
.
textContent
).
join
(
'
'
)).
toBe
(
'
moderator participant
'
);
expect
(
sizzle
(
'
field[var="muc#roomconfig_publicroom"] value
'
,
sent_stanza
).
pop
().
textContent
).
toBe
(
'
1
'
);
expect
(
sizzle
(
'
field[var="muc#roomconfig_changesubject"] value
'
,
sent_stanza
).
pop
().
textContent
).
toBe
(
'
0
'
);
expect
(
sizzle
(
'
field[var="muc#roomconfig_whois"] value
'
,
sent_stanza
).
pop
().
textContent
).
toBe
(
'
anyone
'
);
...
...
src/headless/converse-muc.js
View file @
dd082107
...
...
@@ -658,19 +658,18 @@ converse.plugins.add('converse-muc', {
const
fieldname
=
field
.
getAttribute
(
'
var
'
).
replace
(
'
muc#roomconfig_
'
,
''
);
const
config
=
this
.
get
(
'
roomconfig
'
);
if
(
fieldname
in
config
)
{
let
value
;
let
value
s
;
switch
(
type
)
{
case
'
boolean
'
:
value
=
config
[
fieldname
]
?
1
:
0
;
value
s
=
[
config
[
fieldname
]
?
1
:
0
]
;
break
;
case
'
list-multi
'
:
// TODO: we don't yet handle "list-multi" types
value
=
field
.
innerHTML
;
values
=
config
[
fieldname
];
break
;
default
:
value
=
config
[
fieldname
];
value
s
=
[
config
[
fieldname
]
];
}
field
.
innerHTML
=
$build
(
'
value
'
).
t
(
value
);
field
.
innerHTML
=
values
.
map
(
v
=>
$build
(
'
value
'
).
t
(
v
)).
join
(
''
);
}
return
field
;
},
...
...
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