From bea85c8ab5f74d96f37c1b3a6ea1e83edd0de500 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 12 Oct 2021 16:23:25 +0200 Subject: Fix compiler warnings ('cast between incompatible function types') by not connecting closures --- libdino/src/service/notification_events.vala | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'libdino') diff --git a/libdino/src/service/notification_events.vala b/libdino/src/service/notification_events.vala index 7039d1cf..f87ebe0d 100644 --- a/libdino/src/service/notification_events.vala +++ b/libdino/src/service/notification_events.vala @@ -26,18 +26,11 @@ public class NotificationEvents : StreamInteractionModule, Object { stream_interactor.get_module(PresenceManager.IDENTITY).received_subscription_request.connect(on_received_subscription_request); stream_interactor.get_module(MucManager.IDENTITY).invite_received.connect(on_invite_received); - stream_interactor.get_module(MucManager.IDENTITY).voice_request_received.connect((account, room_jid, from_jid, nick) => { - Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(room_jid, account, Conversation.Type.GROUPCHAT); - if (conversation == null) return; - notifier.notify_voice_request.begin(conversation, from_jid); - }); + stream_interactor.get_module(MucManager.IDENTITY).voice_request_received.connect(on_voice_request_received); stream_interactor.get_module(Calls.IDENTITY).call_incoming.connect(on_call_incoming); stream_interactor.connection_manager.connection_error.connect((account, error) => notifier.notify_connection_error.begin(account, error)); - stream_interactor.get_module(ChatInteraction.IDENTITY).focused_in.connect((conversation) => { - notifier.retract_content_item_notifications.begin(); - notifier.retract_conversation_notifications.begin(conversation); - }); + stream_interactor.get_module(ChatInteraction.IDENTITY).focused_in.connect(on_focused_in); } public void register_notification_provider(NotificationProvider notification_provider) { @@ -100,6 +93,12 @@ public class NotificationEvents : StreamInteractionModule, Object { } } + private void on_voice_request_received(Account account, Jid room_jid, Jid from_jid, string nick) { + Conversation? conversation = stream_interactor.get_module(ConversationManager.IDENTITY).get_conversation(room_jid, account, Conversation.Type.GROUPCHAT); + if (conversation == null) return; + notifier.notify_voice_request.begin(conversation, from_jid); + } + private void on_received_subscription_request(Jid jid, Account account) { Conversation conversation = stream_interactor.get_module(ConversationManager.IDENTITY).create_conversation(jid, account, Conversation.Type.CHAT); if (stream_interactor.get_module(ChatInteraction.IDENTITY).is_active_focus(conversation)) return; @@ -129,6 +128,11 @@ public class NotificationEvents : StreamInteractionModule, Object { } notifier.notify_muc_invite.begin(account, room_jid, from_jid, inviter_display_name); } + + private void on_focused_in(Conversation conversation) { + notifier.retract_content_item_notifications.begin(); + notifier.retract_conversation_notifications.begin(conversation); + } } public interface NotificationProvider : Object { -- cgit v1.2.3-54-g00ecf