Merge 0.10->trunk
[prosody.git] / plugins / muc / whois.lib.lua
index f89e60876fadd4e6bf09986a5cadeb8a8a23ec2a..2f492c450dcbc5eb968d11c3730f761800fa1ff2 100644 (file)
@@ -41,10 +41,9 @@ 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
-               local code = (new == 'moderators') and "173" or "172";
+module:hook("muc-config-submitted/muc#roomconfig_whois", function(event)
+       if set_whois(event.room, event.value) then
+               local code = (event.value == 'moderators') and "173" or "172";
                event.status_codes[code] = true;
        end
 end);