Mercurial > prosody-modules
comparison mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua @ 4329:2a5164162708
mod_cloud_notify_encrypted: Fix the location of the <encrypt> element in push registrations
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 13 Jan 2021 14:15:38 +0000 |
parents | beb3342f1137 |
children | e655581173be |
comparison
equal
deleted
inserted
replaced
4328:5a30daf2ac02 | 4329:2a5164162708 |
---|---|
16 event.reply:tag("feature", {var=xmlns_push_encrypt_aes_128_gcm}):up(); | 16 event.reply:tag("feature", {var=xmlns_push_encrypt_aes_128_gcm}):up(); |
17 end | 17 end |
18 module:hook("account-disco-info", account_disco_info); | 18 module:hook("account-disco-info", account_disco_info); |
19 | 19 |
20 function handle_register(event) | 20 function handle_register(event) |
21 local encrypt = event.stanza:get_child("encrypt", xmlns_push_encrypt); | 21 local encrypt = event.stanza:get_child("enable", xmlns_push):get_child("encrypt", xmlns_push_encrypt); |
22 if not encrypt then return; end | 22 if not encrypt then return; end |
23 | 23 |
24 local algorithm = encrypt.attr.alg; | 24 local algorithm = encrypt.attr.alg; |
25 if algorithm ~= "aes-128-gcm" then | 25 if algorithm ~= "aes-128-gcm" then |
26 event.origin.send(st.error_reply( | 26 event.origin.send(st.error_reply( |