diff options
author | daurnimator <quae@daurnimator.com> | 2014-05-21 13:11:00 -0400 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2014-05-21 13:11:00 -0400 |
commit | 975283ba9cb3fe63488a31e30a23f4d65bc0910b (patch) | |
tree | b549533805416662c86889ef914adf3983ad530a /plugins/muc/muc.lib.lua | |
parent | ae461b42728b11d7e241ca26c6cded24b6bb0d6f (diff) | |
download | prosody-975283ba9cb3fe63488a31e30a23f4d65bc0910b.tar.gz prosody-975283ba9cb3fe63488a31e30a23f4d65bc0910b.zip |
plugins/muc/muc: Only set role to nil if it's the last session to leave
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r-- | plugins/muc/muc.lib.lua | 4 |
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); |