diff options
author | Kim Alvefur <zash@zash.se> | 2017-07-06 10:36:22 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-07-06 10:36:22 +0200 |
commit | cb9b053d061266a0fbf2111ed631574845cb27e4 (patch) | |
tree | 17ffee577aef48d038c24d623a7f596b33c76e30 /plugins/muc/muc.lib.lua | |
parent | 8a606428256ba0bbedf06e7b1798fafecc75c052 (diff) | |
download | prosody-cb9b053d061266a0fbf2111ed631574845cb27e4.tar.gz prosody-cb9b053d061266a0fbf2111ed631574845cb27e4.zip |
MUC: Include status code 110 on affiliation changes (see #765)
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r-- | plugins/muc/muc.lib.lua | 10 |
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 |