core/rostermanager.lua

changeset 1947
ff2b86076e9c
parent 1898
1ce02e2f5a3f
child 2046
3992541f8a48
--- a/core/rostermanager.lua	Mon Oct 05 18:39:28 2009 +0100
+++ b/core/rostermanager.lua	Tue Oct 13 14:54:07 2009 +0500
@@ -112,9 +112,9 @@
 		--end
 	end
 	if roster then
-		local roster = hosts[host].sessions[username].roster;
-		roster[false].version = (roster[false].version or 1) + 1;
-		return datamanager.store(username, host, "roster", hosts[host].sessions[username].roster);
+		if not roster[false] then roster[false] = {}; end
+		roster[false].version = (roster[false].version or 0) + 1;
+		return datamanager.store(username, host, "roster", roster);
 	end
 	log("warn", "save_roster: user had no roster to save");
 	return nil;

mercurial