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