654 |
654 |
655 if self.save then self:save(true); end |
655 if self.save then self:save(true); end |
656 origin.send(st.reply(stanza)); |
656 origin.send(st.reply(stanza)); |
657 |
657 |
658 if dirty or whois_changed then |
658 if dirty or whois_changed then |
659 local msg = st.message({type='groupchat', from=self.jid}) |
659 local msg = st.message({type='groupchat', from=self.jid}) |
660 :tag('x', {xmlns='http://jabber.org/protocol/muc#user'}):up() |
660 :tag('x', {xmlns='http://jabber.org/protocol/muc#user'}):up() |
661 |
661 |
662 if dirty then |
662 if dirty then |
663 msg.tags[1]:tag('status', {code = '104'}) |
663 msg.tags[1]:tag('status', {code = '104'}):up(); |
664 end |
664 end |
665 if whois_changed then |
665 if whois_changed then |
666 local code = (whois == 'moderators') and 173 or 172 |
666 local code = (whois == 'moderators') and "173" or "172"; |
667 msg.tags[1]:tag('status', {code = code}) |
667 msg.tags[1]:tag('status', {code = code}):up(); |
668 end |
668 end |
669 |
669 |
670 self:broadcast_message(msg, false) |
670 self:broadcast_message(msg, false) |
671 end |
671 end |
672 end |
672 end |
673 |
673 |
674 function room_mt:destroy(newjid, reason, password) |
674 function room_mt:destroy(newjid, reason, password) |
675 local pr = st.presence({type = "unavailable"}) |
675 local pr = st.presence({type = "unavailable"}) |
1020 item.attr.jid = from_occupant.jid; |
1020 item.attr.jid = from_occupant.jid; |
1021 end |
1021 end |
1022 end |
1022 end |
1023 end |
1023 end |
1024 if self._data.whois == 'anyone' then |
1024 if self._data.whois == 'anyone' then |
1025 muc_child:tag('status', { code = '100' }); |
1025 muc_child:tag('status', { code = '100' }):up(); |
1026 end |
1026 end |
1027 end |
1027 end |
1028 self:route_stanza(stanza); |
1028 self:route_stanza(stanza); |
1029 if muc_child then |
1029 if muc_child then |
1030 for _, item in pairs(muc_child.tags) do |
1030 for _, item in pairs(muc_child.tags) do |