Changeset

8169:a6574fdf8734

MUC: Only send status code 307 to the user being kicked, not everyone (fixes #939)
author Kim Alvefur <zash@zash.se>
date Mon, 26 Jun 2017 01:03:51 +0200
parents 8168:45be94611593
children 8170:627689c058aa
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Tue Jun 13 20:14:06 2017 +0200
+++ b/plugins/muc/muc.lib.lua	Mon Jun 26 01:03:51 2017 +0200
@@ -349,8 +349,11 @@
 	occupant:set_session(real_jid, st.presence({type="unavailable"})
 		:tag('status'):text(error_message));
 	self:save_occupant(occupant);
-	local x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user";})
-		:tag("status", {code = "307"})
+	local x = {
+		base = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user";});
+		self = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user";})
+			:tag("status", {code = "307"});
+	};
 	self:publicise_occupant_status(occupant, x);
 	if occupant.jid == real_jid then -- Was last session
 		module:fire_event("muc-occupant-left", {room = self; nick = occupant.nick; occupant = occupant;});
@@ -1298,7 +1301,11 @@
 
 	local x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"});
 	if not role then
-		x:tag("status", {code = "307"}):up();
+		x = {
+			base = x;
+			self = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"})
+				:tag("status", {code = "307"}):up();
+		};
 	end
 	occupant.role = role;
 	self:save_occupant(occupant);