478 function room_mt:handle_normal_presence(origin, stanza) |
478 function room_mt:handle_normal_presence(origin, stanza) |
479 local type = stanza.attr.type; |
479 local type = stanza.attr.type; |
480 local real_jid = stanza.attr.from; |
480 local real_jid = stanza.attr.from; |
481 local bare_jid = jid_bare(real_jid); |
481 local bare_jid = jid_bare(real_jid); |
482 local orig_occupant = self:get_occupant_by_real_jid(real_jid); |
482 local orig_occupant = self:get_occupant_by_real_jid(real_jid); |
483 if type == "unavailable" and orig_occupant == nil then return true; end -- Unavailable from someone not in the room |
|
484 local is_first_dest_session; |
483 local is_first_dest_session; |
485 local dest_occupant; |
484 local dest_occupant; |
486 if type == "unavailable" then -- luacheck: ignore 542 |
485 if type == "unavailable" then |
487 -- FIXME Why the empty if branch? |
486 if orig_occupant == nil then return true; end -- Unavailable from someone not in the room |
488 -- dest_occupant = nil |
487 -- dest_occupant = nil |
489 elseif orig_occupant and orig_occupant.nick == stanza.attr.to then -- Just a presence update |
488 elseif orig_occupant and orig_occupant.nick == stanza.attr.to then -- Just a presence update |
490 log("debug", "presence update for %s from session %s", orig_occupant.nick, real_jid); |
489 log("debug", "presence update for %s from session %s", orig_occupant.nick, real_jid); |
491 dest_occupant = orig_occupant; |
490 dest_occupant = orig_occupant; |
492 else |
491 else |