diff options
author | Kim Alvefur <zash@zash.se> | 2014-10-26 20:58:02 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-10-26 20:58:02 +0100 |
commit | cebfb0bf3e29df5aac96cb0d41adb8e356921dc8 (patch) | |
tree | 014c49281af8df716e5b9e9de87e1c6472f91dcc /plugins/mod_blocklist.lua | |
parent | f08fe049ef978fdaa00132f238d6f038605ed3a1 (diff) | |
parent | 8f2d2b9bea483c6a4cf1324af6306d60ae8d91b9 (diff) | |
download | prosody-cebfb0bf3e29df5aac96cb0d41adb8e356921dc8.tar.gz prosody-cebfb0bf3e29df5aac96cb0d41adb8e356921dc8.zip |
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_blocklist.lua')
-rw-r--r-- | plugins/mod_blocklist.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua index 1f09ca13..70bfb5fc 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]; @@ -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 |