Changeset

2909:bcfd76cc9b7d

rostermanager: Don't bump the roster version if it is == true (ie. we are not versioning the roster)
author Matthew Wild <mwild1@gmail.com>
date Mon, 22 Mar 2010 14:28:25 +0000
parents 2908:4d9a73abb237
children 2910:6706a02df271
files core/rostermanager.lua
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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");