MUC: Update all config form handlers to take advantage of the new per-option events
[prosody.git] / plugins / muc / moderated.lib.lua
index c375b7ada816bc14a8fe8106ceb57a9eb80ccf69..26dcb05823acdf66f0bfba1b4d9c7185b2b04ab3 100644 (file)
@@ -32,9 +32,8 @@ module:hook("muc-config-form", function(event)
        });
 end);
 
-module:hook("muc-config-submitted", function(event)
-       local new = event.fields["muc#roomconfig_moderatedroom"];
-       if new ~= nil and set_moderated(event.room, new) then
+module:hook("muc-config-submitted/muc#roomconfig_moderatedroom", function(event)
+       if set_moderated(event.room, event.value) then
                event.status_codes["104"] = true;
        end
 end);