mod_blocklist: Only log message about migrating from mod_privacy when there is data to migrate
authorKim Alvefur <zash@zash.se>
Sat, 25 Oct 2014 14:45:11 +0200
changeset 6497 5979eaed12c0
parent 6496 4e51b5e81bdd
child 6498 44df423f8290
mod_blocklist: Only log message about migrating from mod_privacy when there is data to migrate
plugins/mod_blocklist.lua
--- a/plugins/mod_blocklist.lua	Tue Oct 21 16:41:28 2014 +0200
+++ b/plugins/mod_blocklist.lua	Sat Oct 25 14:45:11 2014 +0200
@@ -43,7 +43,6 @@
 -- 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 @@
 		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];