# HG changeset patch # User Waqas Hussain # Date 1254673559 -18000 # Node ID 6d81e74310a796b0470d51999d728aa4707cc15b # Parent cc7f212b2c48c7837d17ca808cf9b4bde42cba22 rostermanager: Added support for saving rosters of offline users to the save_roster function. diff -r cc7f212b2c48 -r 6d81e74310a7 core/rostermanager.lua --- a/core/rostermanager.lua Fri Oct 02 22:37:03 2009 +0100 +++ b/core/rostermanager.lua Sun Oct 04 21:25:59 2009 +0500 @@ -102,9 +102,16 @@ 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);