aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0166_jingle
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2021-12-23 00:44:51 +0100
committerfiaxh <git@lightrise.org>2021-12-23 00:46:58 +0100
commitd02c5bc55d4325de308a592e8980139aa0634215 (patch)
tree9cb91f86056dd29f863bd8e54580cccc625af60e /xmpp-vala/src/module/xep/0166_jingle
parent1378224444b1862ac95783ac2bae7d25a0a8862d (diff)
parentf0c7dd0682fec8d72c644d8e54896de7bdc40ddb (diff)
downloaddino-d02c5bc55d4325de308a592e8980139aa0634215.tar.gz
dino-d02c5bc55d4325de308a592e8980139aa0634215.zip
Merge branch groupcalls
Diffstat (limited to 'xmpp-vala/src/module/xep/0166_jingle')
-rw-r--r--xmpp-vala/src/module/xep/0166_jingle/component.vala2
-rw-r--r--xmpp-vala/src/module/xep/0166_jingle/content.vala15
-rw-r--r--xmpp-vala/src/module/xep/0166_jingle/session.vala5
3 files changed, 16 insertions, 6 deletions
diff --git a/xmpp-vala/src/module/xep/0166_jingle/component.vala b/xmpp-vala/src/module/xep/0166_jingle/component.vala
index 5d573522..e30175d5 100644
--- a/xmpp-vala/src/module/xep/0166_jingle/component.vala
+++ b/xmpp-vala/src/module/xep/0166_jingle/component.vala
@@ -2,6 +2,8 @@ namespace Xmpp.Xep.Jingle {
public abstract class ComponentConnection : Object {
public uint8 component_id { get; set; default = 0; }
+ public ulong bytes_sent { get; protected set; default=0; }
+ public ulong bytes_received { get; protected set; default=0; }
public abstract async void terminate(bool we_terminated, string? reason_name = null, string? reason_text = null);
public signal void connection_closed();
public signal void connection_error(IOError e);
diff --git a/xmpp-vala/src/module/xep/0166_jingle/content.vala b/xmpp-vala/src/module/xep/0166_jingle/content.vala
index b51bb26d..31d8f9fc 100644
--- a/xmpp-vala/src/module/xep/0166_jingle/content.vala
+++ b/xmpp-vala/src/module/xep/0166_jingle/content.vala
@@ -95,16 +95,27 @@ public class Xmpp.Xep.Jingle.Content : Object {
}
public void accept() {
+ if (state != State.PENDING) {
+ warning("accepting a non-pending content");
+ return;
+ }
state = State.WANTS_TO_BE_ACCEPTED;
-
session.accept_content(this);
}
public void reject() {
+ if (state != State.PENDING) {
+ warning("rejecting a non-pending content");
+ return;
+ }
session.reject_content(this);
}
public void terminate(bool we_terminated, string? reason_name, string? reason_text) {
+ if (state == State.PENDING) {
+ warning("terminating a pending call");
+ return;
+ }
content_params.terminate(we_terminated, reason_name, reason_text);
transport_params.dispose();
@@ -137,7 +148,7 @@ public class Xmpp.Xep.Jingle.Content : Object {
this.content_params.handle_accept(stream, this.session, this, content_node.description);
}
- private async void select_new_transport() {
+ public async void select_new_transport() {
XmppStream stream = session.stream;
Transport? new_transport = yield stream.get_module(Module.IDENTITY).select_transport(stream, transport.type_, transport_params.components, peer_full_jid, tried_transport_methods);
if (new_transport == null) {
diff --git a/xmpp-vala/src/module/xep/0166_jingle/session.vala b/xmpp-vala/src/module/xep/0166_jingle/session.vala
index a45fc6db..af913aab 100644
--- a/xmpp-vala/src/module/xep/0166_jingle/session.vala
+++ b/xmpp-vala/src/module/xep/0166_jingle/session.vala
@@ -264,10 +264,7 @@ public class Xmpp.Xep.Jingle.Session : Object {
warning("Received invalid session accept: %s", e.message);
}
}
- // TODO(hrxi): more sanity checking, perhaps replace who we're talking to
- if (!responder.is_full()) {
- throw new IqError.BAD_REQUEST("invalid responder JID");
- }
+
foreach (ContentNode content_node in content_nodes) {
handle_content_accept(content_node);
}