aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
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
commit8c54955afd5aafa610cc702b5622705b3b5d5e57 (patch)
treea1ca1b7e3ec804cdb4db4649c8e09aae49831b01 /plugins/muc
parenta86fdfdc5674ef5a653dbea6b4a1828a9e879dec (diff)
downloadprosody-8c54955afd5aafa610cc702b5622705b3b5d5e57.tar.gz
prosody-8c54955afd5aafa610cc702b5622705b3b5d5e57.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?
Diffstat (limited to 'plugins/muc')
-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});