core/rostermanager.lua

changeset 2909
bcfd76cc9b7d
parent 2050
adc1b92b8c6b
child 2925
692b3c6c5bd2
--- a/core/rostermanager.lua	Mon Mar 22 01:54:22 2010 +0000
+++ b/core/rostermanager.lua	Mon Mar 22 14:28:25 2010 +0000
@@ -114,8 +114,14 @@
 		--end
 	end
 	if roster then
-		if not roster[false] then roster[false] = {}; end
-		roster[false].version = (roster[false].version or 0) + 1;
+		local metadata = roster[false];
+		if not metadata then
+			metadata = {};
+			roster[false] = metadata;
+		end
+		if metadata.version ~= true then
+			metadata.version = (metadata.version or 0) + 1;
+		end
 		return datamanager.store(username, host, "roster", roster);
 	end
 	log("warn", "save_roster: user had no roster to save");

mercurial