Software /
code /
prosody
Changeset
9035:173c0e16e704
MUC: Add sections in room config form
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 13 Jul 2018 15:47:08 +0100 |
parents | 9034:1c709e3d2e5e |
children | 9036:bb4dcc555091 |
files | plugins/muc/hidden.lib.lua plugins/muc/history.lib.lua plugins/muc/language.lib.lua plugins/muc/members_only.lib.lua plugins/muc/mod_muc.lua plugins/muc/moderated.lib.lua plugins/muc/password.lib.lua plugins/muc/persistent.lib.lua plugins/muc/subject.lib.lua plugins/muc/whois.lib.lua |
diffstat | 10 files changed, 12 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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
--- 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
--- 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
--- 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");
--- 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
--- 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
--- 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
--- 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
--- 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