diff options
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r-- | plugins/muc/muc.lib.lua | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index b7b23311..a1774117 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -449,14 +449,17 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc self._jid_nick[from] = to; self:send_occupant_list(from); pr.attr.from = to; + pr:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) + :tag("item", {affiliation=affiliation or "none", role=role or "none"}):up(); if not is_merge then - self:broadcast_presence(pr, from); - else - pr.attr.to = from; - self:_route_stanza(pr:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) - :tag("item", {affiliation=affiliation or "none", role=role or "none"}):up() - :tag("status", {code='110'})); + self:broadcast_except_nick(pr, to); + end + pr:tag("status", {code='110'}); + if self._data.whois == 'anyone' then + pr:tag("status", {code='100'}):up(); end + pr.attr.to = from; + self:_route_stanza(pr); self:send_history(from, stanza); elseif not affiliation then -- registration required for entering members-only room local reply = st.error_reply(stanza, "auth", "registration-required"):up(); @@ -1021,9 +1024,6 @@ function room_mt:_route_stanza(stanza) end end end - if self._data.whois == 'anyone' then - muc_child:tag('status', { code = '100' }):up(); - end end self:route_stanza(stanza); if muc_child then |