# HG changeset patch # User Waqas Hussain # Date 1256486852 -18000 # Node ID f5a198127dd381e328b452c2e413b0c32f8928a3 # Parent 161db352822c2e477a50be722bf0105b9913d68a MUC: Fixed: affiliation='none' was omitted from some presence broadcasts. diff -r 161db352822c -r f5a198127dd3 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Sun Oct 25 21:06:35 2009 +0500 +++ b/plugins/muc/muc.lib.lua Sun Oct 25 21:07:32 2009 +0500 @@ -115,7 +115,7 @@ stanza = get_filtered_presence(stanza); local occupant = self._occupants[stanza.attr.from]; stanza:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) - :tag("item", {affiliation=occupant.affiliation, role=occupant.role, nick=nick}):up(); + :tag("item", {affiliation=occupant.affiliation or "none", role=occupant.role or "none", nick=nick}):up(); if code then stanza:tag("status", {code=code}):up(); end @@ -162,7 +162,7 @@ local pres = get_filtered_presence(o_data.sessions[o_data.jid]); pres.attr.to, pres.attr.from = to, occupant; pres:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) - :tag("item", {affiliation=o_data.affiliation, role=o_data.role}):up(); + :tag("item", {affiliation=o_data.affiliation or "none", role=o_data.role or "none"}):up(); self:route_stanza(pres); end end @@ -232,13 +232,13 @@ occupant.sessions[from] = nil; pr.attr.to = from; pr:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) - :tag("item", {affiliation=occupant.affiliation, role='none'}):up() + :tag("item", {affiliation=occupant.affiliation or "none", role='none'}):up() :tag("status", {code='110'}); self:route_stanza(pr); if jid ~= new_jid then pr = st.clone(occupant.sessions[new_jid]) :tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) - :tag("item", {affiliation=occupant.affiliation, role=occupant.role}); + :tag("item", {affiliation=occupant.affiliation or "none", role=occupant.role or "none"}); pr.attr.from = current_nick; self:broadcast_except_nick(pr, current_nick); end @@ -323,7 +323,7 @@ else pr.attr.to = from; self:route_stanza(pr:tag("x", {xmlns='http://jabber.org/protocol/muc#user'}) - :tag("item", {affiliation=affiliation, role=role}):up() + :tag("item", {affiliation=affiliation or "none", role=role or "none"}):up() :tag("status", {code='110'})); end self:send_history(from);