if password == "" then password = nil; end
if room._data.password == password then return false; end
room._data.password = password;
- if room.save then room:save(true); end
return true;
end
label = "Password";
value = get_password(event.room) or "";
});
-end);
+end, 100-7);
-module:hook("muc-config-submitted", function(event)
- local new = event.fields["muc#roomconfig_roomsecret"];
- if new ~= nil and set_password(event.room, new) then
+module:hook("muc-config-submitted/muc#roomconfig_roomsecret", function(event)
+ if set_password(event.room, event.value) then
event.status_codes["104"] = true;
end
end);