Software /
code /
prosody
Comparison
plugins/muc/moderated.lib.lua @ 6991:84e01dbb739e
MUC: Update all config form handlers to take advantage of the new per-option events
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 11 Dec 2015 15:33:58 +0000 |
parent | 6226:7582deb85812 |
child | 7352:50b24b3476e6 |
comparison
equal
deleted
inserted
replaced
6990:f476e2497568 | 6991:84e01dbb739e |
---|---|
30 label = "Make Room Moderated?"; | 30 label = "Make Room Moderated?"; |
31 value = get_moderated(event.room); | 31 value = get_moderated(event.room); |
32 }); | 32 }); |
33 end); | 33 end); |
34 | 34 |
35 module:hook("muc-config-submitted", function(event) | 35 module:hook("muc-config-submitted/muc#roomconfig_moderatedroom", function(event) |
36 local new = event.fields["muc#roomconfig_moderatedroom"]; | 36 if set_moderated(event.room, event.value) then |
37 if new ~= nil and set_moderated(event.room, new) then | |
38 event.status_codes["104"] = true; | 37 event.status_codes["104"] = true; |
39 end | 38 end |
40 end); | 39 end); |
41 | 40 |
42 module:hook("muc-get-default-role", function(event) | 41 module:hook("muc-get-default-role", function(event) |