--- a/mod_filter_chatstates/mod_filter_chatstates.lua Mon Sep 21 20:03:08 2015 +0200
+++ b/mod_filter_chatstates/mod_filter_chatstates.lua Mon Sep 21 23:44:55 2015 +0200
@@ -3,14 +3,16 @@
module:depends("csi");
+local function chatstate_tag_filter(tag)
+ if tag.attr.xmlns ~= "http://jabber.org/protocol/chatstates" then
+ return tag;
+ end
+end
+
local function filter_chatstates(stanza)
if stanza.name == "message" then
stanza = st.clone(stanza);
- stanza:maptags(function (tag)
- if tag.attr.xmlns ~= "http://jabber.org/protocol/chatstates" then
- return tag
- end
- end);
+ stanza:maptags(chatstate_tag_filter);
if #stanza.tags == 0 then
return "";
end