aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-04-03 14:23:06 -0400
committerdaurnimator <quae@daurnimator.com>2014-04-03 14:23:06 -0400
commitb1cf3db9a1227bd6a2d21d27b81a65d597e5b7f8 (patch)
tree29ad5c3002194caa5af95f60063bcb9b2f4b8c60 /plugins/muc/muc.lib.lua
parent25e6558aafd036d7fddbf9ad95c39e2cda5b49b9 (diff)
downloadprosody-b1cf3db9a1227bd6a2d21d27b81a65d597e5b7f8.tar.gz
prosody-b1cf3db9a1227bd6a2d21d27b81a65d597e5b7f8.zip
plugins/muc/muc.lib: Remember to coerce nil role to "none"
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 353a7920..20cbe04d 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -163,10 +163,11 @@ local function add_item(x, affiliation, role, jid, nick, actor, reason)
x:up();
return x
end
+
-- actor is (real) jid
function room_mt:build_item_list(occupant, x, is_anonymous, nick, actor, reason)
- local affiliation = self:get_affiliation(occupant.bare_jid);
- local role = occupant.role;
+ local affiliation = self:get_affiliation(occupant.bare_jid) or "none";
+ local role = occupant.role or "none";
local actor_attr;
if actor then
actor_attr = {nick = select(3,jid_split(self:get_occupant_jid(actor)))};