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
{ value = 'anyone', label = 'Anyone', default = whois == 'anyone' }
}
});
-end);
+end, 100-9);
-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);