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