Changeset

8175:b187da5b7e8f

MUC: Include status code 110 on affiliation changes (see #765)
author Kim Alvefur <zash@zash.se>
date Thu, 06 Jul 2017 10:36:22 +0200
parents 8174:260886554512
children 8176:f07cfc9b9b36
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Thu Jul 06 10:33:16 2017 +0200
+++ b/plugins/muc/muc.lib.lua	Thu Jul 06 10:36:22 2017 +0200
@@ -1009,6 +1009,8 @@
 			x:tag("status", {code="321"}):up(); -- affiliation change
 		end
 	end
+	local self_x = st.clone(x);
+	self_x:tag("status", {code="110"});
 	local modified_nicks = {};
 	for nick, occupant in pairs(self._occupants) do
 		if jid_bare(occupant.jid) == jid then
@@ -1023,11 +1025,13 @@
 				p.attr.from = nick;
 				p.attr.type = presence_type;
 				p.attr.to = jid;
-				p:add_child(x);
+				if occupant.jid == jid then
+					local bp = st.clone(p);
+					bp:add_child(x);
+					modified_nicks[nick] = bp;
+				end
+				p:add_child(self_x);
 				self:_route_stanza(p);
-				if occupant.jid == jid then
-					modified_nicks[nick] = p;
-				end
 			end
 		end
 	end