aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-12-06 02:19:04 +0100
committerKim Alvefur <zash@zash.se>2015-12-06 02:19:04 +0100
commit82f7ca9dbbc4e93b782cdf34c6927250f285c756 (patch)
tree6c976f1dfe22924ab760c2e51d7ab1bc1b39c6c7 /plugins
parent7b4dd5567550ad86da1713e122aba7f3733dbb99 (diff)
downloadprosody-82f7ca9dbbc4e93b782cdf34c6927250f285c756.tar.gz
prosody-82f7ca9dbbc4e93b782cdf34c6927250f285c756.zip
mod_blocklist: session[username] can't possibly be unset if that user is sending queries
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_blocklist.lua19
1 files changed, 9 insertions, 10 deletions
diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua
index a870d278..d5e263b1 100644
--- a/plugins/mod_blocklist.lua
+++ b/plugins/mod_blocklist.lua
@@ -162,7 +162,7 @@ local function edit_blocklist(event)
if is_blocking then
for jid, in_roster in pairs(new) do
- if not blocklist[jid] and in_roster and sessions[username] then
+ if not blocklist[jid] and in_roster then
for _, session in pairs(sessions[username].sessions) do
if session.presence then
module:send(st.presence({ type = "unavailable", to = jid, from = session.full_jid }));
@@ -171,15 +171,14 @@ local function edit_blocklist(event)
end
end
end
- if sessions[username] then
- local blocklist_push = st.iq({ type = "set", id = "blocklist-push" })
- :add_child(action); -- I am lazy
-
- for _, session in pairs(sessions[username].sessions) do
- if session.interested_blocklist then
- blocklist_push.attr.to = session.full_jid;
- session.send(blocklist_push);
- end
+
+ local blocklist_push = st.iq({ type = "set", id = "blocklist-push" })
+ :add_child(action); -- I am lazy
+
+ for _, session in pairs(sessions[username].sessions) do
+ if session.interested_blocklist then
+ blocklist_push.attr.to = session.full_jid;
+ session.send(blocklist_push);
end
end