Move locked_muc_domain and muc_domain to model

This commit is contained in:
JC Brand 2019-05-21 13:05:55 +02:00
parent 9cb9151265
commit 53520317fc
2 changed files with 15 additions and 15 deletions

View File

@ -113,10 +113,8 @@ converse.plugins.add('converse-muc-views', {
_converse.api.settings.update({
'auto_list_rooms': false,
'cache_muc_messages': true,
'locked_muc_domain': false,
'locked_muc_nickname': false,
'muc_disable_slash_commands': false,
'muc_domain': undefined,
'muc_show_join_leave': true,
'muc_show_join_leave_status': true,
'roomconfig_whitelist': [],
@ -125,11 +123,6 @@ converse.plugins.add('converse-muc-views', {
}
});
if (_converse.locked_muc_domain && !_.isString(_converse.muc_domain)) {
throw new Error("Config Error: it makes no sense to set locked_muc_domain "+
"to true when muc_domain is not set");
}
function ___ (str) {
/* This is part of a hack to get gettext to scan strings to be
* translated. Strings we cannot send to the function above because

View File

@ -112,17 +112,24 @@ converse.plugins.add('converse-muc', {
// Refer to docs/source/configuration.rst for explanations of these
// configuration settings.
_converse.api.settings.update({
allow_muc: true,
allow_muc_invitations: true,
auto_join_on_invite: false,
auto_join_rooms: [],
auto_register_muc_nickname: false,
muc_history_max_stanzas: undefined,
muc_instant_rooms: true,
muc_nickname_from_jid: false
'allow_muc': true,
'allow_muc_invitations': true,
'auto_join_on_invite': false,
'auto_join_rooms': [],
'auto_register_muc_nickname': false,
'locked_muc_domain': false,
'muc_domain': undefined,
'muc_history_max_stanzas': undefined,
'muc_instant_rooms': true,
'muc_nickname_from_jid': false
});
_converse.api.promises.add(['roomsAutoJoined']);
if (_converse.locked_muc_domain && !_.isString(_converse.muc_domain)) {
throw new Error("Config Error: it makes no sense to set locked_muc_domain "+
"to true when muc_domain is not set");
}
async function openRoom (jid) {
if (!u.isValidMUCJID(jid)) {