From f0c7dd0682fec8d72c644d8e54896de7bdc40ddb Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 20 Dec 2021 00:15:05 +0100 Subject: UI + libdino: Improve MUJI calls from MUC - Move calls from ICE-thead onto main thread - Identify Call.ourpart as MUC nick if in MUC - Keep track of the initiator of a call --- libdino/src/entity/call.vala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'libdino/src/entity/call.vala') diff --git a/libdino/src/entity/call.vala b/libdino/src/entity/call.vala index 3b48f664..8e5bc246 100644 --- a/libdino/src/entity/call.vala +++ b/libdino/src/entity/call.vala @@ -20,9 +20,12 @@ namespace Dino.Entities { public int id { get; set; default=-1; } public Account account { get; set; } - public Jid counterpart { get; set; } // For backwards compatibility with db version 21. Not to be used anymore. + public Jid counterpart { get; set; } public Gee.List counterparts = new Gee.ArrayList(Jid.equals_bare_func); public Jid ourpart { get; set; } + public Jid proposer { + get { return direction == DIRECTION_OUTGOING ? ourpart : counterpart; } + } public bool direction { get; set; } public DateTime time { get; set; } public DateTime local_time { get; set; } @@ -58,7 +61,6 @@ namespace Dino.Entities { if (!counterparts.contains(peer)) { // Legacy: The first peer is also in the `call` table. Don't add twice. counterparts.add(peer); } - if (counterpart == null) counterpart = peer; } counterpart = db.get_jid_by_id(row[db.call.counterpart_id]); @@ -66,7 +68,6 @@ namespace Dino.Entities { if (counterpart_resource != null) counterpart = counterpart.with_resource(counterpart_resource); if (counterparts.is_empty) { counterparts.add(counterpart); - counterpart = counterpart; } notify.connect(on_update); @@ -107,8 +108,6 @@ namespace Dino.Entities { } public void add_peer(Jid peer) { - if (counterpart == null) counterpart = peer; - if (counterparts.contains(peer)) return; counterparts.add(peer); -- cgit v1.2.3-54-g00ecf