# HG changeset patch # User Kim Alvefur # Date 1567954133 -7200 # Node ID 7e5d2a6c9390df6fc111b01f02f7c9f78719143b # Parent 48f7cda4174d363f507d4f15709771e6617061e8 mod_offline: Add some debug logging to reduce confusion Where did these messages come from??? diff -r 48f7cda4174d -r 7e5d2a6c9390 plugins/mod_offline.lua --- a/plugins/mod_offline.lua Mon Jul 22 01:58:57 2019 +0200 +++ b/plugins/mod_offline.lua Sun Sep 08 16:48:53 2019 +0200 @@ -29,6 +29,7 @@ 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 @@ 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);