Comparison

mod_cloud_notify_encrypted/mod_cloud_notify_encrypted.lua @ 4465:2a7a76712e71

mod_cloud_notify_encrypted: Fix expected namespace of JMI description element
author Matthew Wild <mwild1@gmail.com>
date Tue, 23 Feb 2021 16:10:13 +0000
parent 4457:091d06c7d724
child 4466:38bd4d557413
comparison
equal deleted inserted replaced
4464:ea820de69265 4465:2a7a76712e71
6 local random = require "util.random"; 6 local random = require "util.random";
7 local set = require "util.set"; 7 local set = require "util.set";
8 local st = require "util.stanza"; 8 local st = require "util.stanza";
9 9
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_push = "urn:xmpp:push:0"; 12 local xmlns_push = "urn:xmpp:push:0";
12 local xmlns_push_encrypt = "tigase:push:encrypt:0"; 13 local xmlns_push_encrypt = "tigase:push:encrypt:0";
13 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";
14 15
15 -- https://xeps.tigase.net//docs/push-notifications/encrypt/#41-discovering-support 16 -- https://xeps.tigase.net//docs/push-notifications/encrypt/#41-discovering-support
77 local jmi_propose = original_stanza:get_child("propose", xmlns_jmi); 78 local jmi_propose = original_stanza:get_child("propose", xmlns_jmi);
78 if jmi_propose then 79 if jmi_propose then
79 push_payload.type = "call"; 80 push_payload.type = "call";
80 push_payload.sid = jmi_propose.attr.id; 81 push_payload.sid = jmi_propose.attr.id;
81 local media_types = set.new(); 82 local media_types = set.new();
82 for description in jmi_propose:childtags("description") do 83 for description in jmi_propose:childtags("description", xmlns_jingle_apps_rtp) do
83 local media_type = description.attr.media; 84 local media_type = description.attr.media;
84 if media_type then 85 if media_type then
85 media_types:add(media_type); 86 media_types:add(media_type);
86 end 87 end
87 end 88 end