Comparison

plugins/muc/muc.lib.lua @ 3629:856e42b38bb0

MUC: Change room name and description properly
author Kim Alvefur <zash@zash.se>
date Wed, 17 Nov 2010 15:58:32 +0100
parent 3611:d58da6bb8a77
child 3631:138f385e8246
comparison
equal deleted inserted replaced
3628:576103409c7a 3629:856e42b38bb0
611 if fields.FORM_TYPE ~= "http://jabber.org/protocol/muc#roomconfig" then origin.send(st.error_reply(stanza, "cancel", "bad-request", "Form is not of type room configuration")); return; end 611 if fields.FORM_TYPE ~= "http://jabber.org/protocol/muc#roomconfig" then origin.send(st.error_reply(stanza, "cancel", "bad-request", "Form is not of type room configuration")); return; end
612 612
613 local dirty = false 613 local dirty = false
614 614
615 local name = fields['muc#roomconfig_roomname']; 615 local name = fields['muc#roomconfig_roomname'];
616 if name then 616 if name ~= self:get_name() then
617 self:set_name(name); 617 self:set_name(name);
618 end 618 end
619 619
620 local description = fields['muc#roomconfig_roomdesc']; 620 local description = fields['muc#roomconfig_roomdesc'];
621 if description then 621 if description ~= self:get_description() then
622 self:set_description(description); 622 self:set_description(description);
623 end 623 end
624 624
625 local persistent = fields['muc#roomconfig_persistentroom']; 625 local persistent = fields['muc#roomconfig_persistentroom'];
626 dirty = dirty or (self:is_persistent() ~= persistent) 626 dirty = dirty or (self:is_persistent() ~= persistent)