# HG changeset patch # User Waqas Hussain # Date 1289352455 -18000 # Node ID 58a4af582eb3da5a691db686b67d0c7e641a84f3 # Parent 3adac5780c5aa2b4820994c56f52e1f0743cb506 MUC: Only send status code 110 (entering non-anonymous room) to the occupant themselves, not to other occupants. diff -r 3adac5780c5a -r 58a4af582eb3 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Wed Nov 10 05:49:04 2010 +0500 +++ b/plugins/muc/muc.lib.lua Wed Nov 10 06:27:35 2010 +0500 @@ -449,14 +449,17 @@ self._jid_nick[from] = to; self:send_occupant_list(from); pr.attr.from = to; + pr:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) + :tag("item", {affiliation=affiliation or "none", role=role or "none"}):up(); if not is_merge then - self:broadcast_presence(pr, from); - else - pr.attr.to = from; - self:_route_stanza(pr:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) - :tag("item", {affiliation=affiliation or "none", role=role or "none"}):up() - :tag("status", {code='110'})); + self:broadcast_except_nick(pr, to); end + pr:tag("status", {code='110'}); + if self._data.whois == 'anyone' then + pr:tag("status", {code='100'}):up(); + end + pr.attr.to = from; + self:_route_stanza(pr); self:send_history(from, stanza); elseif not affiliation then -- registration required for entering members-only room local reply = st.error_reply(stanza, "auth", "registration-required"):up(); @@ -1021,9 +1024,6 @@ end end end - if self._data.whois == 'anyone' then - muc_child:tag('status', { code = '100' }):up(); - end end self:route_stanza(stanza); if muc_child then