Mercurial > prosody-modules
comparison mod_measure_message_e2ee/mod_measure_message_e2ee.lua @ 6161:72b7e0ca71ab
mod_measure_message_e2ee: Add support for OMEMO:2
| author | Link Mauve <linkmauve@linkmauve.fr> |
|---|---|
| date | Tue, 04 Feb 2025 23:40:33 +0100 |
| parents | 70e5bab388d8 |
| children |
comparison
equal
deleted
inserted
replaced
| 6160:3e0bce07f66c | 6161:72b7e0ca71ab |
|---|---|
| 1 local count_message = module:measure("message", "rate"); | 1 local count_message = module:measure("message", "rate"); |
| 2 local count_plain = module:measure("plain", "rate"); | 2 local count_plain = module:measure("plain", "rate"); |
| 3 local count_openpgp = module:measure("openpgp", "rate"); | 3 local count_openpgp = module:measure("openpgp", "rate"); |
| 4 local count_otr = module:measure("otr", "rate"); | 4 local count_otr = module:measure("otr", "rate"); |
| 5 local count_ox = module:measure("ox", "rate"); | 5 local count_ox = module:measure("ox", "rate"); |
| 6 local count_omemo2 = module:measure("omemo2", "rate"); | |
| 6 local count_omemo = module:measure("omemo", "rate"); | 7 local count_omemo = module:measure("omemo", "rate"); |
| 7 local count_encrypted = module:measure("encrypted", "rate"); | 8 local count_encrypted = module:measure("encrypted", "rate"); |
| 8 | 9 |
| 9 local function message_handler(event) | 10 local function message_handler(event) |
| 10 local origin, stanza = event.origin, event.stanza; | 11 local origin, stanza = event.origin, event.stanza; |
| 17 count_encrypted(); | 18 count_encrypted(); |
| 18 end | 19 end |
| 19 | 20 |
| 20 if stanza:get_child("openpgp", "urn:xmpp:openpgp:0") then | 21 if stanza:get_child("openpgp", "urn:xmpp:openpgp:0") then |
| 21 count_ox(); | 22 count_ox(); |
| 23 return; | |
| 24 end | |
| 25 | |
| 26 if stanza:get_child("encrypted", "urn:xmpp:omemo:2") then | |
| 27 count_omemo2(); | |
| 22 return; | 28 return; |
| 23 end | 29 end |
| 24 | 30 |
| 25 if stanza:get_child("encrypted", "eu.siacs.conversations.axolotl") then | 31 if stanza:get_child("encrypted", "eu.siacs.conversations.axolotl") then |
| 26 count_omemo(); | 32 count_omemo(); |
