From 943e6be943dae4b05ac76d34176b5e6efd66115c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 6 Jul 2017 10:40:00 +0200 Subject: MUC: Add some comments attempting to explain what presence and tag goes where --- plugins/muc/muc.lib.lua | 2 ++ 1 file changed, 2 insertions(+) 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 variant local bp = st.clone(p); bp:add_child(x); modified_nicks[nick] = bp; -- cgit v1.2.3