Mercurial > prosody-hg
comparison plugins/muc/moderated.lib.lua @ 9034:1c709e3d2e5e
MUC: Improve labels of all config form items
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Fri, 13 Jul 2018 13:22:40 +0100 |
| parents | 2a8bbfcb6868 |
| children | 173c0e16e704 |
comparison
equal
deleted
inserted
replaced
| 9033:f1b6efd5b379 | 9034:1c709e3d2e5e |
|---|---|
| 24 | 24 |
| 25 module:hook("muc-config-form", function(event) | 25 module:hook("muc-config-form", function(event) |
| 26 table.insert(event.form, { | 26 table.insert(event.form, { |
| 27 name = "muc#roomconfig_moderatedroom"; | 27 name = "muc#roomconfig_moderatedroom"; |
| 28 type = "boolean"; | 28 type = "boolean"; |
| 29 label = "Make Room Moderated?"; | 29 label = "Moderated (require permission to speak)"; |
| 30 desc = "In moderated rooms occupants must be given permission to speak by a room moderator"; | |
| 30 value = get_moderated(event.room); | 31 value = get_moderated(event.room); |
| 31 }); | 32 }); |
| 32 end, 100-4); | 33 end, 100-4); |
| 33 | 34 |
| 34 module:hook("muc-config-submitted/muc#roomconfig_moderatedroom", function(event) | 35 module:hook("muc-config-submitted/muc#roomconfig_moderatedroom", function(event) |
| 38 end); | 39 end); |
| 39 | 40 |
| 40 module:hook("muc-get-default-role", function(event) | 41 module:hook("muc-get-default-role", function(event) |
| 41 if event.affiliation == nil then | 42 if event.affiliation == nil then |
| 42 if get_moderated(event.room) then | 43 if get_moderated(event.room) then |
| 44 -- XEP-0045: | |
| 45 -- An implementation MAY grant voice by default to visitors in unmoderated rooms. | |
| 43 return "visitor" | 46 return "visitor" |
| 44 end | 47 end |
| 45 end | 48 end |
| 46 end, 1); | 49 end, 1); |
| 47 | 50 |
