From 9c15f1ec5f33f1e7974820e381c4bd7736d21e0c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 25 Oct 2014 14:45:11 +0200 Subject: mod_blocklist: Only log message about migrating from mod_privacy when there is data to migrate --- plugins/mod_blocklist.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_blocklist.lua') diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua index 1f09ca13..45415790 100644 --- a/plugins/mod_blocklist.lua +++ b/plugins/mod_blocklist.lua @@ -43,7 +43,6 @@ end -- Migrates from the old mod_privacy storage local function migrate_privacy_list(username) local migrated_data = { [false] = "not empty" }; - module:log("info", "Migrating blocklist from mod_privacy storage for user '%s'", username); local legacy_data = module:open_store("privacy"):get(username); if legacy_data and legacy_data.lists and legacy_data.default then legacy_data = legacy_data.lists[legacy_data.default]; @@ -52,6 +51,7 @@ local function migrate_privacy_list(username) return migrated_data; end if legacy_data then + module:log("info", "Migrating blocklist from mod_privacy storage for user '%s'", username); local item, jid; for i = 1, #legacy_data do item = legacy_data[i]; -- cgit v1.2.3 From 58138b1fd556ab505da50b7d33632cccfc9d5606 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 26 Oct 2014 16:29:50 +0100 Subject: mod_blocklist: Don't send unavailable presence from unavailable sessions when blocking a contact --- plugins/mod_blocklist.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/mod_blocklist.lua') 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 -- cgit v1.2.3