aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-10-25 21:07:32 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-10-25 21:07:32 +0500
commit1580c8c12baa2d40e5e51c5d4139d6be3cba4138 (patch)
treeec2ac24e01259da83a4ac95e340481ff3f3ee248 /plugins/muc/muc.lib.lua
parent8f2c13031523bd23ce4418a72273ca355a52182a (diff)
downloadprosody-1580c8c12baa2d40e5e51c5d4139d6be3cba4138.tar.gz
prosody-1580c8c12baa2d40e5e51c5d4139d6be3cba4138.zip
MUC: Fixed: affiliation='none' was omitted from some presence broadcasts.
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 251d6d1f..312dcc37 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -115,7 +115,7 @@ function room_mt:broadcast_presence(stanza, sid, code, nick)
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 @@ function room_mt:send_occupant_list(to)
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 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
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 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
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);