# HG changeset patch # User Matthew Wild # Date 1531493228 -3600 # Node ID 173c0e16e7048ce856ae64fa23a68fda20e77a3e # Parent 1c709e3d2e5e0bd1bee24c32209425a0d2e09594 MUC: Add sections in room config form diff -r 1c709e3d2e5e -r 173c0e16e704 plugins/muc/hidden.lib.lua --- a/plugins/muc/hidden.lib.lua Fri Jul 13 13:22:40 2018 +0100 +++ b/plugins/muc/hidden.lib.lua Fri Jul 13 15:47:08 2018 +0100 @@ -22,11 +22,11 @@ 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 -r 1c709e3d2e5e -r 173c0e16e704 plugins/muc/history.lib.lua --- a/plugins/muc/history.lib.lua Fri Jul 13 13:22:40 2018 +0100 +++ b/plugins/muc/history.lib.lua Fri Jul 13 15:47:08 2018 +0100 @@ -59,7 +59,7 @@ 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 -r 1c709e3d2e5e -r 173c0e16e704 plugins/muc/language.lib.lua --- a/plugins/muc/language.lib.lua Fri Jul 13 13:22:40 2018 +0100 +++ b/plugins/muc/language.lib.lua Fri Jul 13 15:47:08 2018 +0100 @@ -37,7 +37,7 @@ 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 -r 1c709e3d2e5e -r 173c0e16e704 plugins/muc/members_only.lib.lua --- a/plugins/muc/members_only.lib.lua Fri Jul 13 13:22:40 2018 +0100 +++ b/plugins/muc/members_only.lib.lua Fri Jul 13 15:47:08 2018 +0100 @@ -85,7 +85,7 @@ 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 -r 1c709e3d2e5e -r 173c0e16e704 plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Fri Jul 13 13:22:40 2018 +0100 +++ b/plugins/muc/mod_muc.lua Fri Jul 13 15:47:08 2018 +0100 @@ -85,6 +85,8 @@ 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 -r 1c709e3d2e5e -r 173c0e16e704 plugins/muc/moderated.lib.lua --- a/plugins/muc/moderated.lib.lua Fri Jul 13 13:22:40 2018 +0100 +++ b/plugins/muc/moderated.lib.lua Fri Jul 13 15:47:08 2018 +0100 @@ -30,7 +30,7 @@ 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 -r 1c709e3d2e5e -r 173c0e16e704 plugins/muc/password.lib.lua --- a/plugins/muc/password.lib.lua Fri Jul 13 13:22:40 2018 +0100 +++ b/plugins/muc/password.lib.lua Fri Jul 13 15:47:08 2018 +0100 @@ -31,7 +31,7 @@ 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 -r 1c709e3d2e5e -r 173c0e16e704 plugins/muc/persistent.lib.lua --- a/plugins/muc/persistent.lib.lua Fri Jul 13 13:22:40 2018 +0100 +++ b/plugins/muc/persistent.lib.lua Fri Jul 13 15:47:08 2018 +0100 @@ -26,7 +26,7 @@ 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 -r 1c709e3d2e5e -r 173c0e16e704 plugins/muc/subject.lib.lua --- a/plugins/muc/subject.lib.lua Fri Jul 13 13:22:40 2018 +0100 +++ b/plugins/muc/subject.lib.lua Fri Jul 13 15:47:08 2018 +0100 @@ -45,7 +45,7 @@ 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 -r 1c709e3d2e5e -r 173c0e16e704 plugins/muc/whois.lib.lua --- a/plugins/muc/whois.lib.lua Fri Jul 13 13:22:40 2018 +0100 +++ b/plugins/muc/whois.lib.lua Fri Jul 13 15:47:08 2018 +0100 @@ -38,7 +38,7 @@ { 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