MUC: Assign priorities to config form hooks so they have a consistent order on each...
[prosody.git] / plugins / muc / whois.lib.lua
index a8e1f8d419bd0c89591e0b11dfa72633bc690692..4acf288c3ca27fbdd179495b3de68458c7eb1dcc 100644 (file)
@@ -20,7 +20,6 @@ local function set_whois(room, whois)
        assert(valid_whois[whois], "Invalid whois value")
        if get_whois(room) == whois then return false; end
        room._data.whois = whois;
-       if room.save then room:save(true); end
        return true;
 end
 
@@ -39,11 +38,11 @@ module:hook("muc-config-form", function(event)
                        { value = 'anyone',     label = 'Anyone',          default = whois == 'anyone' }
                }
        });
-end);
+end, 100-9);
 
 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";
+               local code = (event.value == 'moderators') and "173" or "172";
                event.status_codes[code] = true;
        end
 end);