rostermanager: Fixed a traceback on roster save.

Tue, 13 Oct 2009 14:54:07 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Tue, 13 Oct 2009 14:54:07 +0500
changeset 1947
ff2b86076e9c
parent 1922
d5fe0f9b377a
child 1948
50128afa7858
child 1949
e3d777d76b1a

rostermanager: Fixed a traceback on roster save.

core/rostermanager.lua file | annotate | diff | comparison | revisions
--- 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