rostermanager: Don't bump the roster version if it is == true (ie. we are not versioning the roster)
authorMatthew Wild <mwild1@gmail.com>
Mon, 22 Mar 2010 14:28:25 +0000
changeset 2909 bcfd76cc9b7d
parent 2908 4d9a73abb237
child 2910 6706a02df271
rostermanager: Don't bump the roster version if it is == true (ie. we are not versioning the roster)
core/rostermanager.lua
--- 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");