label = "Allow Occupants to Change Subject?";
value = get_changesubject(event.room);
});
-end);
+end, 100-8);
module:hook("muc-config-submitted/muc#roomconfig_changesubject", function(event)
if set_changesubject(event.room, event.value) then
local stanza = event.stanza;
local subject = stanza:get_child("subject");
if subject then
+ local room = event.room;
local occupant = event.occupant;
-- Role check for subject changes
local role_rank = valid_roles[occupant and occupant.role or "none"];
if role_rank >= valid_roles.moderator or
- ( role_rank >= valid_roles.participant and get_changesubject(event.room) ) then -- and participant
- set_subject(event.room, occupant.nick, subject:get_text());
+ ( role_rank >= valid_roles.participant and get_changesubject(room) ) then -- and participant
+ set_subject(room, occupant.nick, subject:get_text());
+ room:save();
return true;
else
event.origin.send(st.error_reply(stanza, "auth", "forbidden"));