aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-03-22 14:28:25 +0000
committerMatthew Wild <mwild1@gmail.com>2010-03-22 14:28:25 +0000
commitddc6e94e639d6beec50a76dbd7f9fd8419ab9272 (patch)
tree0b87657e27eb62db0b0f4157d0e4b5edebbc1a54 /core
parentedc283b4555a5024d7a9e44ab7d2669a23c1e8e4 (diff)
downloadprosody-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')
-rw-r--r--core/rostermanager.lua10
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");