Comparison

plugins/mod_blocklist.lua @ 6495:44df423f8290

mod_blocklist: Don't send unavailable presence from unavailable sessions when blocking a contact
author Kim Alvefur <zash@zash.se>
date Sun, 26 Oct 2014 16:29:50 +0100
parent 6494:5979eaed12c0
child 6531:18f4973849b1
comparison
equal deleted inserted replaced
6494:5979eaed12c0 6495:44df423f8290
147 147
148 if mode then 148 if mode then
149 for jid, in_roster in pairs(new) do 149 for jid, in_roster in pairs(new) do
150 if not blocklist[jid] and in_roster and sessions[username] then 150 if not blocklist[jid] and in_roster and sessions[username] then
151 for _, session in pairs(sessions[username].sessions) do 151 for _, session in pairs(sessions[username].sessions) do
152 module:send(st.presence({ type = "unavailable", to = jid, from = session.full_jid })); 152 if session.presence then
153 module:send(st.presence({ type = "unavailable", to = jid, from = session.full_jid }));
154 end
153 end 155 end
154 end 156 end
155 end 157 end
156 end 158 end
157 if sessions[username] then 159 if sessions[username] then