Software /
code /
prosody
Diff
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 |
line wrap: on
line diff
--- a/plugins/mod_blocklist.lua Sat Oct 25 14:45:11 2014 +0200 +++ b/plugins/mod_blocklist.lua Sun Oct 26 16:29:50 2014 +0100 @@ -149,7 +149,9 @@ for jid, in_roster in pairs(new) do if not blocklist[jid] and in_roster and sessions[username] then for _, session in pairs(sessions[username].sessions) do - module:send(st.presence({ type = "unavailable", to = jid, from = session.full_jid })); + if session.presence then + module:send(st.presence({ type = "unavailable", to = jid, from = session.full_jid })); + end end end end