aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2018-07-13 15:47:08 +0100
committerMatthew Wild <mwild1@gmail.com>2018-07-13 15:47:08 +0100
commit1f50e15c8e2a4d530df6318db7b1959e831230d6 (patch)
treea5cc2940ac88d722a500026be4508b7f427146ce
parent1a0e7d5a10f2140d05dd54531c4ba1f35768ab93 (diff)
downloadprosody-1f50e15c8e2a4d530df6318db7b1959e831230d6.tar.gz
prosody-1f50e15c8e2a4d530df6318db7b1959e831230d6.zip
MUC: Add sections in room config form
-rw-r--r--plugins/muc/hidden.lib.lua4
-rw-r--r--plugins/muc/history.lib.lua2
-rw-r--r--plugins/muc/language.lib.lua2
-rw-r--r--plugins/muc/members_only.lib.lua2
-rw-r--r--plugins/muc/mod_muc.lua2
-rw-r--r--plugins/muc/moderated.lib.lua2
-rw-r--r--plugins/muc/password.lib.lua2
-rw-r--r--plugins/muc/persistent.lib.lua2
-rw-r--r--plugins/muc/subject.lib.lua2
-rw-r--r--plugins/muc/whois.lib.lua2
10 files changed, 12 insertions, 10 deletions
diff --git a/plugins/muc/hidden.lib.lua b/plugins/muc/hidden.lib.lua
index 943b0b96..acb8c0fc 100644
--- a/plugins/muc/hidden.lib.lua
+++ b/plugins/muc/hidden.lib.lua
@@ -22,11 +22,11 @@ module:hook("muc-config-form", function(event)
table.insert(event.form, {
name = "muc#roomconfig_publicroom";
type = "boolean";
- label = "Include room in public lists";
+ label = "Include room information in public lists";
desc = "Enable this to allow people to find the room";
value = not get_hidden(event.room);
});
-end, 100-5);
+end, 100-9);
module:hook("muc-config-submitted/muc#roomconfig_publicroom", function(event)
if set_hidden(event.room, not event.value) then
diff --git a/plugins/muc/history.lib.lua b/plugins/muc/history.lib.lua
index 36b1b260..8a1163cf 100644
--- a/plugins/muc/history.lib.lua
+++ b/plugins/muc/history.lib.lua
@@ -59,7 +59,7 @@ module:hook("muc-config-form", function(event)
desc = "Specify the number of previous messages sent to new users when they join the room";
value = tostring(get_defaulthistorymessages(event.room))
});
-end, 100-10);
+end, 70-5);
module:hook("muc-config-submitted/muc#roomconfig_historylength", function(event)
if set_historylength(event.room, event.value) then
diff --git a/plugins/muc/language.lib.lua b/plugins/muc/language.lib.lua
index 1c4731d7..ee80806b 100644
--- a/plugins/muc/language.lib.lua
+++ b/plugins/muc/language.lib.lua
@@ -37,7 +37,7 @@ local function add_form_option(event)
end
module:hook("muc-disco#info", add_disco_form);
-module:hook("muc-config-form", add_form_option, 100-9.5);
+module:hook("muc-config-form", add_form_option, 100-3);
module:hook("muc-config-submitted/muc#roomconfig_lang", function(event)
if set_language(event.room, event.value) then
diff --git a/plugins/muc/members_only.lib.lua b/plugins/muc/members_only.lib.lua
index b3bcdd8b..cd9f777e 100644
--- a/plugins/muc/members_only.lib.lua
+++ b/plugins/muc/members_only.lib.lua
@@ -85,7 +85,7 @@ module:hook("muc-config-form", function(event)
label = "Allow members to invite new members";
value = get_allow_member_invites(event.room);
});
-end, 100-6);
+end, 90-3);
module:hook("muc-config-submitted/muc#roomconfig_membersonly", function(event)
if set_members_only(event.room, event.value) then
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 5d9842bc..49bb12d1 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -85,6 +85,8 @@ local st = require "util.stanza";
local cache = require "util.cache";
local um_is_admin = require "core.usermanager".is_admin;
+module:require "muc/config_form_sections";
+
module:depends("disco");
module:add_identity("conference", "text", module:get_option_string("name", "Prosody Chatrooms"));
module:add_feature("http://jabber.org/protocol/muc");
diff --git a/plugins/muc/moderated.lib.lua b/plugins/muc/moderated.lib.lua
index 1087e2c4..64ddb542 100644
--- a/plugins/muc/moderated.lib.lua
+++ b/plugins/muc/moderated.lib.lua
@@ -30,7 +30,7 @@ module:hook("muc-config-form", function(event)
desc = "In moderated rooms occupants must be given permission to speak by a room moderator";
value = get_moderated(event.room);
});
-end, 100-4);
+end, 80-3);
module:hook("muc-config-submitted/muc#roomconfig_moderatedroom", function(event)
if set_moderated(event.room, event.value) then
diff --git a/plugins/muc/password.lib.lua b/plugins/muc/password.lib.lua
index fb603d88..36a2ec6f 100644
--- a/plugins/muc/password.lib.lua
+++ b/plugins/muc/password.lib.lua
@@ -31,7 +31,7 @@ module:hook("muc-config-form", function(event)
label = "Password";
value = get_password(event.room) or "";
});
-end, 100-7);
+end, 90-2);
module:hook("muc-config-submitted/muc#roomconfig_roomsecret", function(event)
if set_password(event.room, event.value) then
diff --git a/plugins/muc/persistent.lib.lua b/plugins/muc/persistent.lib.lua
index 0f787759..aa2cdf26 100644
--- a/plugins/muc/persistent.lib.lua
+++ b/plugins/muc/persistent.lib.lua
@@ -26,7 +26,7 @@ module:hook("muc-config-form", function(event)
desc = "Rooms are automatically deleted when they are empty, unless this option is enabled";
value = get_persistent(event.room);
});
-end, 100-3);
+end, 100-5);
module:hook("muc-config-submitted/muc#roomconfig_persistentroom", function(event)
if set_persistent(event.room, event.value) then
diff --git a/plugins/muc/subject.lib.lua b/plugins/muc/subject.lib.lua
index 3b4efaf7..938abf61 100644
--- a/plugins/muc/subject.lib.lua
+++ b/plugins/muc/subject.lib.lua
@@ -45,7 +45,7 @@ module:hook("muc-config-form", function(event)
desc = "Choose whether anyone, or only moderators, may set the room's subject";
value = get_changesubject(event.room);
});
-end, 100-8);
+end, 80-1);
module:hook("muc-config-submitted/muc#roomconfig_changesubject", function(event)
if set_changesubject(event.room, event.value) then
diff --git a/plugins/muc/whois.lib.lua b/plugins/muc/whois.lib.lua
index ec3114eb..c81ff042 100644
--- a/plugins/muc/whois.lib.lua
+++ b/plugins/muc/whois.lib.lua
@@ -38,7 +38,7 @@ module:hook("muc-config-form", function(event)
{ value = 'anyone', label = 'Anyone', default = whois == 'anyone' }
}
});
-end, 100-9);
+end, 80-4);
module:hook("muc-config-submitted/muc#roomconfig_whois", function(event)
if set_whois(event.room, event.value) then