aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-05-21 13:11:00 -0400
committerdaurnimator <quae@daurnimator.com>2014-05-21 13:11:00 -0400
commit347202819d3fd42945160856f0c409a245b4d1f1 (patch)
treeb549533805416662c86889ef914adf3983ad530a /plugins/muc
parentd6b18f4e20e7ac945426acf5d869b446c61d57e0 (diff)
downloadprosody-347202819d3fd42945160856f0c409a245b4d1f1.tar.gz
prosody-347202819d3fd42945160856f0c409a245b4d1f1.zip
plugins/muc/muc: Only set role to nil if it's the last session to leave
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/muc.lib.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 5838cbe9..34934213 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -410,7 +410,9 @@ function room_mt:handle_presence_to_occupant(origin, stanza)
local dest_nick;
if dest_occupant == nil then -- Session is leaving
log("debug", "session %s is leaving occupant %s", real_jid, orig_occupant.nick);
- orig_occupant.role = nil;
+ if is_last_orig_session then
+ orig_occupant.role = nil;
+ end
orig_occupant:set_session(real_jid, stanza);
else
log("debug", "session %s is changing from occupant %s to %s", real_jid, orig_occupant.nick, dest_occupant.nick);