Comparison

plugins/muc/muc.lib.lua @ 7414:1b62c89014c4

MUC: Separate force-save parameter from save-entire-state flag
author Kim Alvefur <zash@zash.se>
date Fri, 29 Apr 2016 16:54:45 +0200
parent 7413:228396da1e27
child 7415:cbb05b454c13
comparison
equal deleted inserted replaced
7413:228396da1e27 7414:1b62c89014c4
767 event.field, event.value = submitted_field, fields[submitted_field]; 767 event.field, event.value = submitted_field, fields[submitted_field];
768 module:fire_event("muc-config-submitted/"..submitted_field, event); 768 module:fire_event("muc-config-submitted/"..submitted_field, event);
769 end 769 end
770 event.field, event.value = nil, nil; 770 event.field, event.value = nil, nil;
771 771
772 self:save(); 772 self:save(true);
773 origin.send(st.reply(stanza)); 773 origin.send(st.reply(stanza));
774 774
775 if next(event.status_codes) then 775 if next(event.status_codes) then
776 local msg = st.message({type='groupchat', from=self.jid}) 776 local msg = st.message({type='groupchat', from=self.jid})
777 :tag('x', {xmlns='http://jabber.org/protocol/muc#user'}) 777 :tag('x', {xmlns='http://jabber.org/protocol/muc#user'})
850 elseif item.attr.role and item.attr.nick and not item.attr.affiliation then 850 elseif item.attr.role and item.attr.nick and not item.attr.affiliation then
851 success, errtype, err = self:set_role(actor, self.jid.."/"..item.attr.nick, item.attr.role, reason); 851 success, errtype, err = self:set_role(actor, self.jid.."/"..item.attr.nick, item.attr.role, reason);
852 else 852 else
853 success, errtype, err = nil, "cancel", "bad-request"; 853 success, errtype, err = nil, "cancel", "bad-request";
854 end 854 end
855 self:save(); 855 self:save(true);
856 if not success then 856 if not success then
857 origin.send(st.error_reply(stanza, errtype, err)); 857 origin.send(st.error_reply(stanza, errtype, err));
858 else 858 else
859 origin.send(st.reply(stanza)); 859 origin.send(st.reply(stanza));
860 end 860 end
1217 end); 1217 end);
1218 end 1218 end
1219 end 1219 end
1220 end 1220 end
1221 1221
1222 self:save(); 1222 self:save(true);
1223 1223
1224 module:fire_event("muc-set-affiliation", { 1224 module:fire_event("muc-set-affiliation", {
1225 room = self; 1225 room = self;
1226 actor = actor; 1226 actor = actor;
1227 jid = jid; 1227 jid = jid;