Comparison

mod_measure_message_e2ee/mod_measure_message_e2ee.lua @ 3370:c414a7e884b3

mod_measure_message_e2ee: Count OTR messages too.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 06 Nov 2018 20:05:09 +0100
parent 3137:178ebea5097c
child 3782:70e5bab388d8
comparison
equal deleted inserted replaced
3369:fca95f1b8870 3370:c414a7e884b3
32 if stanza:get_child("x", "jabber:x:encrypted") then 32 if stanza:get_child("x", "jabber:x:encrypted") then
33 count_openpgp(); 33 count_openpgp();
34 return; 34 return;
35 end 35 end
36 36
37 local body = stanza:get_child("body"); 37 local body = stanza:get_child_text("body");
38 if body ~= nil then 38 if body then
39 local otr_index = body:find("?OTR", 1, true); 39 if body:sub(1,4) == "?OTR" then
40 if otr_index == 1 then
41 count_otr(); 40 count_otr();
42 return; 41 return;
43 end 42 end
44 43
45 count_plain(); 44 count_plain();