Changeset

6252:10b27981ea3f

plugins/muc/muc: Only set role to nil if it's the last session to leave
author daurnimator <quae@daurnimator.com>
date Wed, 21 May 2014 13:11:00 -0400
parents 6251:41a5e5205fd9
children 6253:2df9e7a67e56
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Mon May 19 13:47:28 2014 -0400
+++ b/plugins/muc/muc.lib.lua	Wed May 21 13:11:00 2014 -0400
@@ -410,7 +410,9 @@
 			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);