mod_ignore_host_chatstates: Discard chat state messages sent to a bare host
Prevents annoying error replies to be sent in reply to such empty chat
state messages. Useful in combination with modules that handle messages
to a host.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mod_ignore_host_chatstates/mod_ignore_host_chatstates.lua Fri Dec 28 04:23:30 2018 +0100
@@ -0,0 +1,6 @@
+module:hook("message/host", function (event)
+ local stanza = event.stanza;
+ if #stanza.tags == 1 and stanza.tags[1].attr.xmlns == "http://jabber.org/protocol/chatstates" then
+ return true;
+ end
+end, -10);