Diff

plugins/muc/muc.lib.lua @ 8176:f07cfc9b9b36

MUC: Add some comments attempting to explain what presence and <x> tag goes where
author Kim Alvefur <zash@zash.se>
date Thu, 06 Jul 2017 10:40:00 +0200
parent 8175:b187da5b7e8f
child 8181:79f73af4c410
child 8187:4d83876aac3e
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Thu Jul 06 10:36:22 2017 +0200
+++ b/plugins/muc/muc.lib.lua	Thu Jul 06 10:40:00 2017 +0200
@@ -1009,6 +1009,7 @@
 			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 @@
 				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;