Comparison

plugins/muc/subject.lib.lua @ 7357:d69521003e91

MUC: Save room after subject is changed
author Kim Alvefur <zash@zash.se>
date Fri, 15 Apr 2016 18:03:55 +0200
parent 7353:ca31d3271cf8
child 7365:2d502878b784
comparison
equal deleted inserted replaced
7356:f4d51870d212 7357:d69521003e91
80 -- Role check for subject changes 80 -- Role check for subject changes
81 local role_rank = valid_roles[occupant and occupant.role or "none"]; 81 local role_rank = valid_roles[occupant and occupant.role or "none"];
82 if role_rank >= valid_roles.moderator or 82 if role_rank >= valid_roles.moderator or
83 ( role_rank >= valid_roles.participant and get_changesubject(event.room) ) then -- and participant 83 ( role_rank >= valid_roles.participant and get_changesubject(event.room) ) then -- and participant
84 set_subject(event.room, occupant.nick, subject:get_text()); 84 set_subject(event.room, occupant.nick, subject:get_text());
85 room:save();
85 return true; 86 return true;
86 else 87 else
87 event.origin.send(st.error_reply(stanza, "auth", "forbidden")); 88 event.origin.send(st.error_reply(stanza, "auth", "forbidden"));
88 return true; 89 return true;
89 end 90 end