diff options
author | Kim Alvefur <zash@zash.se> | 2019-06-20 21:40:27 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-06-20 21:40:27 +0200 |
commit | c0a8fc323c9b4ef6dc160106ae19f421ec0c7e32 (patch) | |
tree | 1ca52ee78afe1531d0ad329fc72482dae21451ca /plugins/mod_blocklist.lua | |
parent | 4e7d17bfff9ff33d5c0b58cae1941aac45090b70 (diff) | |
parent | c6ad506b85a5740f55c9b12896f92ee15e74abce (diff) | |
download | prosody-c0a8fc323c9b4ef6dc160106ae19f421ec0c7e32.tar.gz prosody-c0a8fc323c9b4ef6dc160106ae19f421ec0c7e32.zip |
Merge 0.11->trunk
Diffstat (limited to 'plugins/mod_blocklist.lua')
-rw-r--r-- | plugins/mod_blocklist.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua index 2193a093..18d28be2 100644 --- a/plugins/mod_blocklist.lua +++ b/plugins/mod_blocklist.lua @@ -128,6 +128,7 @@ local function edit_blocklist(event) -- > only if the contact is allowed to receive presence notifications [...] -- So contacts we need to do that for are added to the set below. local send_unavailable = is_blocking and {}; + local send_available = not is_blocking and {}; -- Because blocking someone currently also blocks the ability to reject -- subscription requests, we'll preemptively reject such @@ -147,6 +148,8 @@ local function edit_blocklist(event) elseif is_contact_pending_in(username, module.host, jid) then remove_pending[jid] = true; end + elseif is_contact_subscribed(username, module.host, jid) then + send_available[jid] = true; end end @@ -203,6 +206,11 @@ local function edit_blocklist(event) save_roster(username, module.host, roster); -- Not much we can do about save failing here end + else + local user_bare = username .. "@" .. module.host; + for jid in pairs(send_available) do + module:send(st.presence({ type = "probe", to = user_bare, from = jid })); + end end local blocklist_push = st.iq({ type = "set", id = "blocklist-push" }) |