# HG changeset patch # User daurnimator # Date 1396052900 14400 # Node ID f97aa1f4b1f1fcb7df7243dda71e6ead7e2ffb5f # Parent 5956f4e69ab2e6d51764bbeb2df01fc3a2fee45e plugins/muc/muc.lib: Use occupant methods where possible diff -r 5956f4e69ab2 -r f97aa1f4b1f1 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Fri Mar 28 20:25:10 2014 -0400 +++ b/plugins/muc/muc.lib.lua Fri Mar 28 20:28:20 2014 -0400 @@ -641,7 +641,7 @@ local real_jid = stanza.attr.from; room:send_occupant_list(real_jid, function(nick, occupant) -- Don't include self - return occupant.sessions[real_jid] == nil + return occupant:get_presence(real_jid) == nil; end); room:send_history(stanza); room:send_subject(real_jid); @@ -687,7 +687,8 @@ local is_last_orig_session; if orig_occupant ~= nil then -- Is there are least 2 sessions? - is_last_orig_session = next(orig_occupant.sessions, next(orig_occupant.sessions)) == nil; + local iter, ob, last = orig_occupant:each_session(); + is_last_orig_session = iter(ob, iter(ob, last)) == nil; end local event, event_name = {