aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/application.vala
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/application.vala')
-rw-r--r--main/src/ui/application.vala18
1 files changed, 14 insertions, 4 deletions
diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala
index 9f48caec..ecbea85e 100644
--- a/main/src/ui/application.vala
+++ b/main/src/ui/application.vala
@@ -206,9 +206,14 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
});
add_action(open_shortcuts_action);
- SimpleAction accept_call_action = new SimpleAction("accept-call", VariantType.INT32);
+ SimpleAction accept_call_action = new SimpleAction("accept-call", new VariantType.tuple(new VariantType[]{VariantType.INT32, VariantType.INT32}));
accept_call_action.activate.connect((variant) => {
- Call? call = stream_interactor.get_module(CallStore.IDENTITY).get_call_by_id(variant.get_int32());
+ int conversation_id = variant.get_child_value(0).get_int32();
+ Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation_by_id(conversation_id);
+ if (conversation == null) return;
+
+ int call_id = variant.get_child_value(1).get_int32();
+ Call? call = stream_interactor.get_module(CallStore.IDENTITY).get_call_by_id(call_id, conversation);
CallState? call_state = stream_interactor.get_module(Calls.IDENTITY).call_states[call];
if (call_state == null) return;
@@ -220,9 +225,14 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
});
add_action(accept_call_action);
- SimpleAction deny_call_action = new SimpleAction("reject-call", VariantType.INT32);
+ SimpleAction deny_call_action = new SimpleAction("reject-call", new VariantType.tuple(new VariantType[]{VariantType.INT32, VariantType.INT32}));
deny_call_action.activate.connect((variant) => {
- Call? call = stream_interactor.get_module(CallStore.IDENTITY).get_call_by_id(variant.get_int32());
+ int conversation_id = variant.get_child_value(0).get_int32();
+ Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation_by_id(conversation_id);
+ if (conversation == null) return;
+
+ int call_id = variant.get_child_value(1).get_int32();
+ Call? call = stream_interactor.get_module(CallStore.IDENTITY).get_call_by_id(call_id, conversation);
CallState? call_state = stream_interactor.get_module(Calls.IDENTITY).call_states[call];
if (call_state == null) return;