Software / code / prosody
Comparison
plugins/muc/muc.lib.lua @ 7405:5a65750d959a
MUC: Be more careful with deserialization of rooms, fix case where a bare jid has joined as multiple participants
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 27 Apr 2016 18:55:49 +0200 |
| parent | 7402:ef7ea3bad7a1 |
| child | 7406:92755ca737c3 |
comparison
equal
deleted
inserted
replaced
| 7404:57ca4dcd91a7 | 7405:5a65750d959a |
|---|---|
| 1281 local occupant_sessions = {}; | 1281 local occupant_sessions = {}; |
| 1282 local room_name, room_host = jid_split(room_jid); | 1282 local room_name, room_host = jid_split(room_jid); |
| 1283 for jid, data in pairs(frozen) do | 1283 for jid, data in pairs(frozen) do |
| 1284 local node, host, resource = jid_split(jid); | 1284 local node, host, resource = jid_split(jid); |
| 1285 if node or host:sub(1,1) ~= "_" then | 1285 if node or host:sub(1,1) ~= "_" then |
| 1286 if not resource then | 1286 if not resource and type(data) == "string" then |
| 1287 -- bare jid: affiliation | 1287 -- bare jid: affiliation |
| 1288 room._affiliations[jid] = data; | 1288 room._affiliations[jid] = data; |
| 1289 elseif host == room_host and node == room_name then | 1289 elseif host == room_host and node == room_name and resource then |
| 1290 -- full room jid: bare real jid and role | 1290 -- full room jid: bare real jid and role |
| 1291 local bare_jid = data.bare_jid; | 1291 local bare_jid = data.bare_jid; |
| 1292 local occupant = occupant_lib.new(bare_jid, jid); | 1292 local occupant = occupant_lib.new(bare_jid, jid); |
| 1293 occupant.jid = data.jid; | 1293 occupant.jid = data.jid; |
| 1294 occupant.role = data.role; | 1294 occupant.role = data.role; |