From ae4828d86147bfe18e0e70416ac6c5c0130e5285 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Thu, 6 Jul 2017 10:40:00 +0200
Subject: MUC: Add some comments attempting to explain what presence and <x>
 tag goes where

---
 plugins/muc/muc.lib.lua | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'plugins/muc')

diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 24582eae..8c486b87 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -1009,6 +1009,7 @@ function room_mt:set_affiliation(actor, jid, affiliation, callback, reason)
 			x:tag("status", {code="321"}):up(); -- affiliation change
 		end
 	end
+	-- Your own presence should have status 110
 	local self_x = st.clone(x);
 	self_x:tag("status", {code="110"});
 	local modified_nicks = {};
@@ -1026,6 +1027,7 @@ function room_mt:set_affiliation(actor, jid, affiliation, callback, reason)
 				p.attr.type = presence_type;
 				p.attr.to = jid;
 				if occupant.jid == jid then
+					-- Broadcast this presence to everyone else later, with the public <x> variant
 					local bp = st.clone(p);
 					bp:add_child(x);
 					modified_nicks[nick] = bp;
-- 
cgit v1.2.3