diff options
author | Kim Alvefur <zash@zash.se> | 2016-11-22 18:19:55 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-11-22 18:19:55 +0100 |
commit | f2b74c28b0e0a6399c0487d93a39e42c849f17fa (patch) | |
tree | ea03cdc69bfcae52aa0da06047ca5369d289a8bc /plugins/mod_mam/mod_mam.lua | |
parent | ad82f3f080f18af21be4bb5b30ac0101688d9886 (diff) | |
download | prosody-f2b74c28b0e0a6399c0487d93a39e42c849f17fa.tar.gz prosody-f2b74c28b0e0a6399c0487d93a39e42c849f17fa.zip |
mod_mam: If archive:delete() gives a number, this should be the number of deleted items
Diffstat (limited to 'plugins/mod_mam/mod_mam.lua')
-rw-r--r-- | plugins/mod_mam/mod_mam.lua | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua index 2bdf85dc..9d7aabde 100644 --- a/plugins/mod_mam/mod_mam.lua +++ b/plugins/mod_mam/mod_mam.lua @@ -326,11 +326,8 @@ if cleanup_after ~= "never" then local ok, err = archive:delete(user, { ["end"] = os.time() - cleanup_after; }) if not ok then module:log("warn", "Could not expire archives for user %s: %s", user, err); - else - -- :affected() is a recent addition for eg SQLite3 in LuaDBI - pcall(function(stmt) - module:log("debug", "Removed %d messages", stmt:affected()); - end, err); + elseif type(ok) == "number" then + module:log("debug", "Removed %d messages", ok); end cleanup[user] = nil; end |