diff options
author | Kim Alvefur <zash@zash.se> | 2019-09-08 16:48:53 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-09-08 16:48:53 +0200 |
commit | 246c0d1c6e67ed432ddd62e15c1420d73b879ca4 (patch) | |
tree | 01541f49a79efe963c83e6268610cd33efe44cf7 | |
parent | aedca363c093007542941749578caf1badf1674e (diff) | |
download | prosody-246c0d1c6e67ed432ddd62e15c1420d73b879ca4.tar.gz prosody-246c0d1c6e67ed432ddd62e15c1420d73b879ca4.zip |
mod_offline: Add some debug logging to reduce confusion
Where did these messages come from???
-rw-r--r-- | plugins/mod_offline.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_offline.lua b/plugins/mod_offline.lua index 487098d1..04c679cf 100644 --- a/plugins/mod_offline.lua +++ b/plugins/mod_offline.lua @@ -29,6 +29,7 @@ end, -1); module:hook("message/offline/broadcast", function(event) local origin = event.origin; + origin.log("debug", "Broadcasting offline messages"); local node, host = origin.username, origin.host; @@ -38,6 +39,9 @@ module:hook("message/offline/broadcast", function(event) stanza:tag("delay", {xmlns = "urn:xmpp:delay", from = host, stamp = datetime.datetime(when)}):up(); -- XEP-0203 origin.send(stanza); end - offline_messages:delete(node); + local ok = offline_messages:delete(node); + if type(ok) == "number" and ok > 0 then + origin.log("debug", "%d offline messages consumed"); + end return true; end, -1); |