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