Mercurial > prosody-modules
comparison mod_nooffline_noerror/mod_nooffline_noerror.lua @ 3970:e0f3e29ab18a
mod_nooffline_noerror: Fix for missing log
author | tmolitor <thilo@eightysoft.de> |
---|---|
date | Tue, 07 Apr 2020 22:11:52 +0200 |
parents | a411a8e028ed |
children |
comparison
equal
deleted
inserted
replaced
3969:39931d727c22 | 3970:e0f3e29ab18a |
---|---|
10 module:depends "mam"; | 10 module:depends "mam"; |
11 | 11 |
12 -- ignore offline messages and don't return any error (the message will be already in MAM at this point) | 12 -- ignore offline messages and don't return any error (the message will be already in MAM at this point) |
13 -- this is *only* triggered if mod_offline is *not* loaded and completely ignored otherwise | 13 -- this is *only* triggered if mod_offline is *not* loaded and completely ignored otherwise |
14 module:hook("message/offline/handle", function(event) | 14 module:hook("message/offline/handle", function(event) |
15 local log = event.origin and event.origin.log or module._log | 15 local log = event.origin and event.origin.log or module._log; |
16 log("info", "Ignoring offline message (mod_offline seems to be *not* loaded)..."); | 16 if log then |
17 log("info", "Ignoring offline message (mod_offline seems *not* to be loaded)..."); | |
18 end | |
17 return true; | 19 return true; |
18 end, -100); | 20 end, -100); |