MUC: Update all config form handlers to take advantage of the new per-option events
[prosody.git] / plugins / muc / whois.lib.lua
index f89e60876fadd4e6bf09986a5cadeb8a8a23ec2a..a8e1f8d419bd0c89591e0b11dfa72633bc690692 100644 (file)
@@ -41,9 +41,8 @@ module:hook("muc-config-form", function(event)
        });
 end);
 
-module:hook("muc-config-submitted", function(event)
-       local new = event.fields["muc#roomconfig_whois"];
-       if new ~= nil and set_whois(event.room, new) then
+module:hook("muc-config-submitted/muc#roomconfig_whois", function(event)
+       if set_whois(event.room, event.value) then
                local code = (new == 'moderators') and "173" or "172";
                event.status_codes[code] = true;
        end