aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-11-10 06:27:35 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-11-10 06:27:35 +0500
commita9eb525db3ff365bf20242fe2eddc96680ad17f4 (patch)
treeeafa693cd50e4d04a713028a6020b229d420f6e2 /plugins/muc
parentf95ecafd2da089b5c2ac79f866efb3c3e25abf38 (diff)
downloadprosody-a9eb525db3ff365bf20242fe2eddc96680ad17f4.tar.gz
prosody-a9eb525db3ff365bf20242fe2eddc96680ad17f4.zip
MUC: Only send status code 110 (entering non-anonymous room) to the occupant themselves, not to other occupants.
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/muc.lib.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index b7b23311..a1774117 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -449,14 +449,17 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
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 @@ function room_mt:_route_stanza(stanza)
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