Software /
code /
prosody
Comparison
plugins/mod_mam/mod_mam.lua @ 9802:d725c2ab0c7d
mod_mam: Fix operator precedence (thanks mimi89999)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 20 Jan 2019 20:24:17 +0100 |
parent | 9758:d4a534e6bd7c |
child | 9882:18f025b3987d |
comparison
equal
deleted
inserted
replaced
9801:b87cd83a2685 | 9802:d725c2ab0c7d |
---|---|
376 local sum, num_users = 0, 0; | 376 local sum, num_users = 0, 0; |
377 for user in pairs(users) do | 377 for user in pairs(users) do |
378 local ok, err = archive:delete(user, { ["end"] = os.time() - cleanup_after; }) | 378 local ok, err = archive:delete(user, { ["end"] = os.time() - cleanup_after; }) |
379 if ok then | 379 if ok then |
380 num_users = num_users + 1; | 380 num_users = num_users + 1; |
381 sum = sum + tonumber(ok) or 0; | 381 sum = sum + (tonumber(ok) or 0); |
382 end | 382 end |
383 end | 383 end |
384 module:log("info", "Deleted %d expired messages for %d users", sum, num_users); | 384 module:log("info", "Deleted %d expired messages for %d users", sum, num_users); |
385 cleanup_done(); | 385 cleanup_done(); |
386 end); | 386 end); |