Comparison

plugins/muc/muc.lib.lua @ 6108:aae7bc9d6e93

plugins/muc/muc: Add 'muc-occupant-left' event
author daurnimator <quae@daurnimator.com>
date Tue, 18 Mar 2014 18:52:28 -0400
parent 6107:5491be05b84c
child 6111:f8b94903be52
comparison
equal deleted inserted replaced
6107:5491be05b84c 6108:aae7bc9d6e93
414 end 414 end
415 else 415 else
416 occupant.role = 'none'; 416 occupant.role = 'none';
417 self:broadcast_presence(pr, from); 417 self:broadcast_presence(pr, from);
418 self._occupants[current_nick] = nil; 418 self._occupants[current_nick] = nil;
419 module:fire_event("muc-occupant-left", { room = self; nick = current_nick; });
419 end 420 end
420 return true; 421 return true;
421 end 422 end
422 423
423 function room_mt:handle_occupant_presence(origin, stanza) 424 function room_mt:handle_occupant_presence(origin, stanza)
821 pr.attr.to = jid; 822 pr.attr.to = jid;
822 self:_route_stanza(pr); 823 self:_route_stanza(pr);
823 self._jid_nick[jid] = nil; 824 self._jid_nick[jid] = nil;
824 end 825 end
825 self._occupants[nick] = nil; 826 self._occupants[nick] = nil;
827 module:fire_event("muc-occupant-left", { room = self; nick = nick; });
826 end 828 end
827 self:set_persistent(false); 829 self:set_persistent(false);
828 module:fire_event("muc-room-destroyed", { room = self }); 830 module:fire_event("muc-room-destroyed", { room = self });
829 end 831 end
830 832