Software /
code /
prosody
Diff
core/rostermanager.lua @ 1947:ff2b86076e9c
rostermanager: Fixed a traceback on roster save.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 13 Oct 2009 14:54:07 +0500 |
parent | 1898:1ce02e2f5a3f |
child | 2046:3992541f8a48 |
line wrap: on
line diff
--- 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;