Software /
code /
prosody
Diff
core/rostermanager.lua @ 2909:bcfd76cc9b7d
rostermanager: Don't bump the roster version if it is == true (ie. we are not versioning the roster)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 22 Mar 2010 14:28:25 +0000 |
parent | 2050:adc1b92b8c6b |
child | 2925:692b3c6c5bd2 |
line wrap: on
line diff
--- a/core/rostermanager.lua Mon Mar 22 01:54:22 2010 +0000 +++ b/core/rostermanager.lua Mon Mar 22 14:28:25 2010 +0000 @@ -114,8 +114,14 @@ --end end if roster then - if not roster[false] then roster[false] = {}; end - roster[false].version = (roster[false].version or 0) + 1; + local metadata = roster[false]; + if not metadata then + metadata = {}; + roster[false] = metadata; + end + if metadata.version ~= true then + metadata.version = (metadata.version or 0) + 1; + end return datamanager.store(username, host, "roster", roster); end log("warn", "save_roster: user had no roster to save");