aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-07-06 10:36:22 +0200
committerKim Alvefur <zash@zash.se>2017-07-06 10:36:22 +0200
commitc0ac4526f686ce1faf21891a6d1bcb242aba0b90 (patch)
tree17ffee577aef48d038c24d623a7f596b33c76e30 /plugins/muc
parent19f9d45e8ca19778137a0a571ed127cdd26c1fac (diff)
downloadprosody-c0ac4526f686ce1faf21891a6d1bcb242aba0b90.tar.gz
prosody-c0ac4526f686ce1faf21891a6d1bcb242aba0b90.zip
MUC: Include status code 110 on affiliation changes (see #765)
Diffstat (limited to 'plugins/muc')
-rw-r--r--plugins/muc/muc.lib.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 79daad92..24582eae 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -1009,6 +1009,8 @@ function room_mt:set_affiliation(actor, jid, affiliation, callback, reason)
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 @@ function room_mt:set_affiliation(actor, jid, affiliation, callback, reason)
p.attr.from = nick;
p.attr.type = presence_type;
p.attr.to = jid;
- p:add_child(x);
- self:_route_stanza(p);
if occupant.jid == jid then
- modified_nicks[nick] = p;
+ local bp = st.clone(p);
+ bp:add_child(x);
+ modified_nicks[nick] = bp;
end
+ p:add_child(self_x);
+ self:_route_stanza(p);
end
end
end