aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-03-28 20:28:20 -0400
committerdaurnimator <quae@daurnimator.com>2014-03-28 20:28:20 -0400
commitd0e5de9af2239bd57d91a7c30e0a4d335b668a7b (patch)
treeed9db2c23448958a6c0e10b72c77a0381a715e6e
parent672d0fae0b9b785bc2a1def3143b4978fd379201 (diff)
downloadprosody-d0e5de9af2239bd57d91a7c30e0a4d335b668a7b.tar.gz
prosody-d0e5de9af2239bd57d91a7c30e0a4d335b668a7b.zip
plugins/muc/muc.lib: Use occupant methods where possible
-rw-r--r--plugins/muc/muc.lib.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 7704a099..684539bd 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -641,7 +641,7 @@ module:hook("muc-occupant-joined", function(event)
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 @@ function room_mt:handle_presence_to_occupant(origin, stanza)
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 = {