diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-03-22 14:28:25 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-03-22 14:28:25 +0000 |
commit | ddc6e94e639d6beec50a76dbd7f9fd8419ab9272 (patch) | |
tree | 0b87657e27eb62db0b0f4157d0e4b5edebbc1a54 /core/rostermanager.lua | |
parent | edc283b4555a5024d7a9e44ab7d2669a23c1e8e4 (diff) | |
download | prosody-ddc6e94e639d6beec50a76dbd7f9fd8419ab9272.tar.gz prosody-ddc6e94e639d6beec50a76dbd7f9fd8419ab9272.zip |
rostermanager: Don't bump the roster version if it is == true (ie. we are not versioning the roster)
Diffstat (limited to 'core/rostermanager.lua')
-rw-r--r-- | core/rostermanager.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/rostermanager.lua b/core/rostermanager.lua index 516983a9..b95647bd 100644 --- a/core/rostermanager.lua +++ b/core/rostermanager.lua @@ -114,8 +114,14 @@ function save_roster(username, host, roster) --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"); |