aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-04-27 18:55:49 +0200
committerKim Alvefur <zash@zash.se>2016-04-27 18:55:49 +0200
commitf1fe6fddaca0638d9227e4a3c7a944070b0d77b5 (patch)
tree8d523a5c614c952d52eba04f649736ea771882d6 /plugins/muc/muc.lib.lua
parent7295e6809e94ff399dc1920d7e40894709183ea0 (diff)
downloadprosody-f1fe6fddaca0638d9227e4a3c7a944070b0d77b5.tar.gz
prosody-f1fe6fddaca0638d9227e4a3c7a944070b0d77b5.zip
MUC: Be more careful with deserialization of rooms, fix case where a bare jid has joined as multiple participants
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 14aad42c..ce6c5784 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -1283,10 +1283,10 @@ function _M.restore_room(frozen)
for jid, data in pairs(frozen) do
local node, host, resource = jid_split(jid);
if node or host:sub(1,1) ~= "_" then
- if not resource then
+ if not resource and type(data) == "string" then
-- bare jid: affiliation
room._affiliations[jid] = data;
- elseif host == room_host and node == room_name then
+ elseif host == room_host and node == room_name and resource then
-- full room jid: bare real jid and role
local bare_jid = data.bare_jid;
local occupant = occupant_lib.new(bare_jid, jid);