# HG changeset patch # User Kim Alvefur # Date 1499330182 -7200 # Node ID b187da5b7e8f89ce01ad5cf75d41ab3ee9df0d50 # Parent 2608865545129dfcc4462eb785d760acf2eb6581 MUC: Include status code 110 on affiliation changes (see #765) diff -r 260886554512 -r b187da5b7e8f plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Thu Jul 06 10:33:16 2017 +0200 +++ b/plugins/muc/muc.lib.lua Thu Jul 06 10:36:22 2017 +0200 @@ -1009,6 +1009,8 @@ 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 @@ p.attr.from = nick; p.attr.type = presence_type; p.attr.to = jid; - p:add_child(x); + if occupant.jid == jid then + local bp = st.clone(p); + bp:add_child(x); + modified_nicks[nick] = bp; + end + p:add_child(self_x); self:_route_stanza(p); - if occupant.jid == jid then - modified_nicks[nick] = p; - end end end end