aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-09-25 12:35:09 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-09-25 12:35:09 +0500
commit567fc4966c2c555b1b649ef9c25c2abb14e592b8 (patch)
treeff50b7257ce01ced5cfd61586a1a8658ddec0e7e /plugins/muc/muc.lib.lua
parent23d676ee18f898b0db00358a1679bf8e56ef043b (diff)
downloadprosody-567fc4966c2c555b1b649ef9c25c2abb14e592b8.tar.gz
prosody-567fc4966c2c555b1b649ef9c25c2abb14e592b8.zip
MUC: Refactored to remove some duplicate code.
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua13
1 files changed, 2 insertions, 11 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 6917b21a..260ce422 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -113,17 +113,8 @@ function room_mt:broadcast_presence(stanza, code, nick)
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