aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-10-26 16:29:50 +0100
committerKim Alvefur <zash@zash.se>2014-10-26 16:29:50 +0100
commitd0cb0b35d5e1d3d12bf07610330c93e55eae086a (patch)
tree37ff0e479e8d785c042521d7ec75a56db1c7ad99
parenta5013be8b59a24101539f31e841477ae163e8624 (diff)
downloadprosody-d0cb0b35d5e1d3d12bf07610330c93e55eae086a.tar.gz
prosody-d0cb0b35d5e1d3d12bf07610330c93e55eae086a.zip
mod_blocklist: Don't send unavailable presence from unavailable sessions when blocking a contact
-rw-r--r--plugins/mod_blocklist.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua
index 45415790..70bfb5fc 100644
--- a/plugins/mod_blocklist.lua
+++ b/plugins/mod_blocklist.lua
@@ -149,7 +149,9 @@ local function edit_blocklist(event)
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