# HG changeset patch # User Waqas Hussain # Date 1253864109 -18000 # Node ID 8e66c9d09f8109b806338c1f4582f38608fbbd99 # Parent 7c3ec7ac6316b782a4c19ae38f3bb4b95f971e8a MUC: Refactored to remove some duplicate code. diff -r 7c3ec7ac6316 -r 8e66c9d09f81 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Thu Sep 24 23:47:16 2009 +0100 +++ b/plugins/muc/muc.lib.lua Fri Sep 25 12:35:09 2009 +0500 @@ -113,17 +113,8 @@ if code then stanza:tag("status", {code=code}):up(); end - local me; - for occupant, o_data in pairs(self._occupants) do - if occupant ~= stanza.attr.from then - for jid in pairs(o_data.sessions) do - stanza.attr.to = jid; - self:route_stanza(stanza); - end - else - me = o_data; - end - end + self:broadcast_except_nick(stanza, stanza.attr.from); + local me = self._occupants[stanza.attr.from]; if me then stanza:tag("status", {code='110'}); for jid in pairs(me.sessions) do