aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-04-19 18:46:07 +0200
committerKim Alvefur <zash@zash.se>2016-04-19 18:46:07 +0200
commite81b3519746ee2933e643a235c18a2246b56dbf2 (patch)
treee7da5b08cf4c8a9ffe2244d8e6aeafc6fa339b1e /plugins/muc
parentffae2c113a67317bd85fb34aea8a828394d8c295 (diff)
downloadprosody-e81b3519746ee2933e643a235c18a2246b56dbf2.tar.gz
prosody-e81b3519746ee2933e643a235c18a2246b56dbf2.zip
MUC: Fix logic for when to broadcast unavailable presence (actual fix for 14170d161b39)
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/muc.lib.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 18f40758..e98e99b8 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -196,7 +196,7 @@ function room_mt:publicise_occupant_status(occupant, base_x, nick, actor, reason
local base_presence do
-- Try to use main jid's presence
local pr = occupant:get_presence();
- if pr and (pr.attr.type ~= "unavailable" or occupant.role == nil) then
+ if pr and (pr.attr.type ~= "unavailable" and occupant.role ~= nil) then
base_presence = st.clone(pr);
else -- user is leaving but didn't send a leave presence. make one for them
base_presence = st.presence {from = occupant.nick; type = "unavailable";};
@@ -737,7 +737,6 @@ function room_mt:clear(x)
occupants_updated[occupant] = true;
end
for occupant in pairs(occupants_updated) do
- occupant:set_session(occupant.jid, st.presence({type="unavailable"}), true);
self:publicise_occupant_status(occupant, x);
module:fire_event("muc-occupant-left", { room = self; nick = occupant.nick; occupant = occupant;});
end