aboutsummaryrefslogtreecommitdiffstats
path: root/core/rostermanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-03-22 14:38:01 +0000
committerMatthew Wild <mwild1@gmail.com>2010-03-22 14:38:01 +0000
commit02971394f90dde48ed352ebc1936258647f7ab3c (patch)
tree8ebf152610862d71bb1f2d3bbb77ea96f7258c56 /core/rostermanager.lua
parent172d9baed4f493e04e93659d485f1a75624b84c1 (diff)
parentc3a993d0ada1de7131b880aba84ea60a03b50873 (diff)
downloadprosody-02971394f90dde48ed352ebc1936258647f7ab3c.tar.gz
prosody-02971394f90dde48ed352ebc1936258647f7ab3c.zip
Merge 0.7->trunk
Diffstat (limited to 'core/rostermanager.lua')
-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");