aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-07-12 01:50:06 +0200
committerKim Alvefur <zash@zash.se>2018-07-12 01:50:06 +0200
commitd1bc4d7cb3c4a7671a54cca3d8099738f07bc1d9 (patch)
treea1ca1b7e3ec804cdb4db4649c8e09aae49831b01
parentfafbcb7f137e6cc83c6cc658c115456feb89c442 (diff)
downloadprosody-d1bc4d7cb3c4a7671a54cca3d8099738f07bc1d9.tar.gz
prosody-d1bc4d7cb3c4a7671a54cca3d8099738f07bc1d9.zip
MUC: Fix to send status code 100 *only* to the joining (fixes #680)
What does `if can_see_real_jids(whois, occupant) then` do?
-rw-r--r--plugins/muc/muc.lib.lua15
1 files changed, 6 insertions, 9 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 9e51a068..22e3ff93 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -269,9 +269,7 @@ function room_mt:publicise_occupant_status(occupant, x, nick, actor, reason)
end
local self_p, self_x;
- if can_see_real_jids(whois, occupant) then
- self_p, self_x = get_full_p();
- else
+ do
-- Can always see your own full jids
-- But not allowed to see actor's
self_x = st.clone(x.self or base_x);
@@ -603,10 +601,6 @@ function room_mt:handle_normal_presence(origin, stanza)
if dest_occupant ~= nil then
dest_occupant:set_session(real_jid, stanza);
- local dest_x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user";});
- if orig_occupant == nil and self:get_whois() == "anyone" then
- dest_x:tag("status", {code = "100"}):up();
- end
self:save_occupant(dest_occupant);
if orig_occupant == nil or muc_x then
@@ -616,9 +610,12 @@ function room_mt:handle_normal_presence(origin, stanza)
return occupant:get_presence(real_jid) == nil;
end)
end
- local self_x;
+ local dest_x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user";});
+ local self_x = st.clone(dest_x);
+ if orig_occupant == nil and self:get_whois() == "anyone" then
+ self_x:tag("status", {code = "100"}):up();
+ end
if nick_changed then
- self_x = st.clone(dest_x);
self_x:tag("status", {code="210"}):up();
end
self:publicise_occupant_status(dest_occupant, {base=dest_x,self=self_x});