From: Kim Alvefur Date: Wed, 27 Apr 2016 16:55:49 +0000 (+0200) Subject: MUC: Be more careful with deserialization of rooms, fix case where a bare jid has... X-Git-Url: https://git.enpas.org/?p=prosody.git;a=commitdiff_plain;h=59a3750fe36f57478a898d2708cf98fea45e762e MUC: Be more careful with deserialization of rooms, fix case where a bare jid has joined as multiple participants --- 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);