aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0166_jingle
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2021-04-25 19:49:10 +0200
committerfiaxh <git@lightrise.org>2021-04-29 16:13:25 +0200
commit421f43dd8bd993eb88581e1b5011cc061ceb4fc8 (patch)
tree6495066b5e608188d8837dbcc133c5adc8e57c45 /xmpp-vala/src/module/xep/0166_jingle
parent5d85b6cdb0165d863aadd25d9a73707b8f5cc83e (diff)
downloaddino-421f43dd8bd993eb88581e1b5011cc061ceb4fc8.tar.gz
dino-421f43dd8bd993eb88581e1b5011cc061ceb4fc8.zip
Add support for OMEMO call encryption
Diffstat (limited to 'xmpp-vala/src/module/xep/0166_jingle')
-rw-r--r--xmpp-vala/src/module/xep/0166_jingle/content.vala3
-rw-r--r--xmpp-vala/src/module/xep/0166_jingle/content_transport.vala2
-rw-r--r--xmpp-vala/src/module/xep/0166_jingle/jingle_module.vala4
-rw-r--r--xmpp-vala/src/module/xep/0166_jingle/session.vala10
4 files changed, 9 insertions, 10 deletions
diff --git a/xmpp-vala/src/module/xep/0166_jingle/content.vala b/xmpp-vala/src/module/xep/0166_jingle/content.vala
index beb12183..befe02f4 100644
--- a/xmpp-vala/src/module/xep/0166_jingle/content.vala
+++ b/xmpp-vala/src/module/xep/0166_jingle/content.vala
@@ -34,9 +34,8 @@ public class Xmpp.Xep.Jingle.Content : Object {
public weak Session session;
public Map<uint8, ComponentConnection> component_connections = new HashMap<uint8, ComponentConnection>(); // TODO private
- public ContentEncryption? encryption { get; set; }
+ public HashMap<string, ContentEncryption> encryptions = new HashMap<string, ContentEncryption>();
- // INITIATE_SENT | INITIATE_RECEIVED | CONNECTING
public Set<string> tried_transport_methods = new HashSet<string>();
diff --git a/xmpp-vala/src/module/xep/0166_jingle/content_transport.vala b/xmpp-vala/src/module/xep/0166_jingle/content_transport.vala
index cd74c836..2697a01c 100644
--- a/xmpp-vala/src/module/xep/0166_jingle/content_transport.vala
+++ b/xmpp-vala/src/module/xep/0166_jingle/content_transport.vala
@@ -21,7 +21,7 @@ namespace Xmpp.Xep.Jingle {
public abstract uint8 components { get; }
public abstract void set_content(Content content);
- public abstract StanzaNode to_transport_stanza_node();
+ public abstract StanzaNode to_transport_stanza_node(string action_type);
public abstract void handle_transport_accept(StanzaNode transport) throws IqError;
public abstract void handle_transport_info(StanzaNode transport) throws IqError;
public abstract void create_transport_connection(XmppStream stream, Content content);
diff --git a/xmpp-vala/src/module/xep/0166_jingle/jingle_module.vala b/xmpp-vala/src/module/xep/0166_jingle/jingle_module.vala
index 7314ca6c..186848f6 100644
--- a/xmpp-vala/src/module/xep/0166_jingle/jingle_module.vala
+++ b/xmpp-vala/src/module/xep/0166_jingle/jingle_module.vala
@@ -3,7 +3,7 @@ using Xmpp;
namespace Xmpp.Xep.Jingle {
- internal const string NS_URI = "urn:xmpp:jingle:1";
+ public const string NS_URI = "urn:xmpp:jingle:1";
private const string ERROR_NS_URI = "urn:xmpp:jingle:errors:1";
// This module can only be attached to one stream at a time.
@@ -131,7 +131,7 @@ namespace Xmpp.Xep.Jingle {
.put_attribute("name", content.content_name)
.put_attribute("senders", content.senders.to_string())
.put_node(content.content_params.get_description_node())
- .put_node(content.transport_params.to_transport_stanza_node());
+ .put_node(content.transport_params.to_transport_stanza_node("session-initiate"));
if (content.security_params != null) {
content_node.put_node(content.security_params.to_security_stanza_node(stream, my_jid, receiver_full_jid));
}
diff --git a/xmpp-vala/src/module/xep/0166_jingle/session.vala b/xmpp-vala/src/module/xep/0166_jingle/session.vala
index 5fe89415..4d04c8d5 100644
--- a/xmpp-vala/src/module/xep/0166_jingle/session.vala
+++ b/xmpp-vala/src/module/xep/0166_jingle/session.vala
@@ -221,7 +221,7 @@ public class Xmpp.Xep.Jingle.Session : Object {
.put_attribute("name", content.content_name)
.put_attribute("senders", content.senders.to_string())
.put_node(content.content_params.get_description_node())
- .put_node(content.transport_params.to_transport_stanza_node()));
+ .put_node(content.transport_params.to_transport_stanza_node("content-add")));
Iq.Stanza iq = new Iq.Stanza.set(content_add_node) { to=peer_full_jid };
yield stream.get_module(Iq.Module.IDENTITY).send_iq_async(stream, iq);
@@ -343,7 +343,7 @@ public class Xmpp.Xep.Jingle.Session : Object {
.put_attribute("name", content.content_name)
.put_attribute("senders", content.senders.to_string())
.put_node(content.content_params.get_description_node())
- .put_node(content.transport_params.to_transport_stanza_node());
+ .put_node(content.transport_params.to_transport_stanza_node("session-accept"));
jingle.put_node(content_node);
}
@@ -379,7 +379,7 @@ public class Xmpp.Xep.Jingle.Session : Object {
.put_attribute("name", content.content_name)
.put_attribute("senders", content.senders.to_string())
.put_node(content.content_params.get_description_node())
- .put_node(content.transport_params.to_transport_stanza_node()));
+ .put_node(content.transport_params.to_transport_stanza_node("content-accept")));
Iq.Stanza iq = new Iq.Stanza.set(content_accept_node) { to=peer_full_jid };
stream.get_module(Iq.Module.IDENTITY).send_iq(stream, iq);
@@ -477,7 +477,7 @@ public class Xmpp.Xep.Jingle.Session : Object {
.put_node(new StanzaNode.build("content", NS_URI)
.put_attribute("creator", "initiator")
.put_attribute("name", content.content_name)
- .put_node(transport_params.to_transport_stanza_node())
+ .put_node(transport_params.to_transport_stanza_node("transport-accept"))
);
Iq.Stanza iq_response = new Iq.Stanza.set(jingle_response) { to=peer_full_jid };
stream.get_module(Iq.Module.IDENTITY).send_iq(stream, iq_response);
@@ -493,7 +493,7 @@ public class Xmpp.Xep.Jingle.Session : Object {
.put_node(new StanzaNode.build("content", NS_URI)
.put_attribute("creator", "initiator")
.put_attribute("name", content.content_name)
- .put_node(transport_params.to_transport_stanza_node())
+ .put_node(transport_params.to_transport_stanza_node("transport-replace"))
);
Iq.Stanza iq = new Iq.Stanza.set(jingle) { to=peer_full_jid };
stream.get_module(Iq.Module.IDENTITY).send_iq(stream, iq);