diff options
author | fiaxh <git@lightrise.org> | 2021-12-20 00:15:05 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2021-12-23 00:19:26 +0100 |
commit | f0c7dd0682fec8d72c644d8e54896de7bdc40ddb (patch) | |
tree | 0e275aa1fab7004cef7c92e16721d493b18bf8b6 /libdino/src/entity/call.vala | |
parent | ff4e2540ae3bfab6873beb7e03ef5c6a5b9da1da (diff) | |
download | dino-f0c7dd0682fec8d72c644d8e54896de7bdc40ddb.tar.gz dino-f0c7dd0682fec8d72c644d8e54896de7bdc40ddb.zip |
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
Diffstat (limited to 'libdino/src/entity/call.vala')
-rw-r--r-- | libdino/src/entity/call.vala | 9 |
1 files changed, 4 insertions, 5 deletions
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<Jid> counterparts = new Gee.ArrayList<Jid>(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); |