aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/rostermanager.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua
index 0163e343..c3fd3b68 100644
--- a/core/rostermanager.lua
+++ b/core/rostermanager.lua
@@ -102,9 +102,16 @@ function load_roster(username, host)
return roster;
end
-function save_roster(username, host)
+function save_roster(username, host, roster)
log("debug", "save_roster: saving roster for "..username.."@"..host);
- if hosts[host] and hosts[host].sessions[username] and hosts[host].sessions[username].roster then
+ if not roster then
+ roster = hosts[host] and hosts[host].sessions[username] and hosts[host].sessions[username].roster;
+ --if not roster then
+ -- --roster = load_roster(username, host);
+ -- return true; -- roster unchanged, no reason to save
+ --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);