aboutsummaryrefslogtreecommitdiffstats
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
commitcb9b053d061266a0fbf2111ed631574845cb27e4 (patch)
tree17ffee577aef48d038c24d623a7f596b33c76e30
parent8a606428256ba0bbedf06e7b1798fafecc75c052 (diff)
downloadprosody-cb9b053d061266a0fbf2111ed631574845cb27e4.tar.gz
prosody-cb9b053d061266a0fbf2111ed631574845cb27e4.zip
MUC: Include status code 110 on affiliation changes (see #765)
-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