aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-11-22 18:19:55 +0100
committerKim Alvefur <zash@zash.se>2016-11-22 18:19:55 +0100
commit3e669af789f29807304f4494ea3090f3165647c4 (patch)
treeea03cdc69bfcae52aa0da06047ca5369d289a8bc /plugins
parent6de5f5881dc2f35fbc0704f4260f271e6eb61848 (diff)
downloadprosody-3e669af789f29807304f4494ea3090f3165647c4.tar.gz
prosody-3e669af789f29807304f4494ea3090f3165647c4.zip
mod_mam: If archive:delete() gives a number, this should be the number of deleted items
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_mam/mod_mam.lua7
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