Mercurial > prosody-hg
comparison 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 |
| parents | 1ce02e2f5a3f |
| children | 3992541f8a48 |
comparison
equal
deleted
inserted
replaced
| 1922:d5fe0f9b377a | 1947:ff2b86076e9c |
|---|---|
| 110 -- --roster = load_roster(username, host); | 110 -- --roster = load_roster(username, host); |
| 111 -- return true; -- roster unchanged, no reason to save | 111 -- return true; -- roster unchanged, no reason to save |
| 112 --end | 112 --end |
| 113 end | 113 end |
| 114 if roster then | 114 if roster then |
| 115 local roster = hosts[host].sessions[username].roster; | 115 if not roster[false] then roster[false] = {}; end |
| 116 roster[false].version = (roster[false].version or 1) + 1; | 116 roster[false].version = (roster[false].version or 0) + 1; |
| 117 return datamanager.store(username, host, "roster", hosts[host].sessions[username].roster); | 117 return datamanager.store(username, host, "roster", roster); |
| 118 end | 118 end |
| 119 log("warn", "save_roster: user had no roster to save"); | 119 log("warn", "save_roster: user had no roster to save"); |
| 120 return nil; | 120 return nil; |
| 121 end | 121 end |
| 122 | 122 |
