# HG changeset patch # User Emmanuel Gil Peyrot # Date 1541531109 -3600 # Node ID c414a7e884b302a19a4941e85868718c9179e525 # Parent fca95f1b887061d37cd1449980d8ed47ec3cb08a mod_measure_message_e2ee: Count OTR messages too. diff -r fca95f1b8870 -r c414a7e884b3 mod_measure_message_e2ee/mod_measure_message_e2ee.lua --- a/mod_measure_message_e2ee/mod_measure_message_e2ee.lua Tue Nov 06 14:44:11 2018 +0100 +++ b/mod_measure_message_e2ee/mod_measure_message_e2ee.lua Tue Nov 06 20:05:09 2018 +0100 @@ -34,10 +34,9 @@ return; end - local body = stanza:get_child("body"); - if body ~= nil then - local otr_index = body:find("?OTR", 1, true); - if otr_index == 1 then + local body = stanza:get_child_text("body"); + if body then + if body:sub(1,4) == "?OTR" then count_otr(); return; end