Comparison

mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua @ 4467:6d595857164a

mod_cloud_notify_encrypted: Advertise support for JMI push notifications
author Matthew Wild <mwild1@gmail.com>
date Tue, 23 Feb 2021 20:59:14 +0000
parent 4466:38bd4d557413
child 4650:44af84178cea
comparison
equal deleted inserted replaced
4466:38bd4d557413 4467:6d595857164a
10 local xmlns_jmi = "urn:xmpp:jingle-message:0"; 10 local xmlns_jmi = "urn:xmpp:jingle-message:0";
11 local xmlns_jingle_apps_rtp = "urn:xmpp:jingle:apps:rtp:1"; 11 local xmlns_jingle_apps_rtp = "urn:xmpp:jingle:apps:rtp:1";
12 local xmlns_push = "urn:xmpp:push:0"; 12 local xmlns_push = "urn:xmpp:push:0";
13 local xmlns_push_encrypt = "tigase:push:encrypt:0"; 13 local xmlns_push_encrypt = "tigase:push:encrypt:0";
14 local xmlns_push_encrypt_aes_128_gcm = "tigase:push:encrypt:aes-128-gcm"; 14 local xmlns_push_encrypt_aes_128_gcm = "tigase:push:encrypt:aes-128-gcm";
15 local xmlns_push_jingle = "tigase:push:jingle:0";
15 16
16 -- https://xeps.tigase.net//docs/push-notifications/encrypt/#41-discovering-support 17 -- https://xeps.tigase.net//docs/push-notifications/encrypt/#41-discovering-support
17 local function account_disco_info(event) 18 local function account_disco_info(event)
18 event.reply:tag("feature", {var=xmlns_push_encrypt}):up(); 19 event.reply:tag("feature", {var=xmlns_push_encrypt}):up();
19 event.reply:tag("feature", {var=xmlns_push_encrypt_aes_128_gcm}):up(); 20 event.reply:tag("feature", {var=xmlns_push_encrypt_aes_128_gcm}):up();
21 event.reply:tag("feature", {var=xmlns_push_jingle}):up();
20 end 22 end
21 module:hook("account-disco-info", account_disco_info); 23 module:hook("account-disco-info", account_disco_info);
22 24
23 function handle_register(event) 25 function handle_register(event)
24 local encrypt = event.stanza:get_child("enable", xmlns_push):get_child("encrypt", xmlns_push_encrypt); 26 local encrypt = event.stanza:get_child("enable", xmlns_push):get_child("encrypt", xmlns_push_encrypt);