From 383bcfd4270fcce0203d69b5ad22c3290646407c Mon Sep 17 00:00:00 2001
From: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
Date: Fri, 4 Jan 2019 16:59:38 -0500
Subject: [PATCH] fix: notifications

do not show notifications for outgoing calls

Change-Id: Id166d93785456da3884c3d55a4b15a1dc1be707b
---
 src/AppDelegate.mm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/AppDelegate.mm b/src/AppDelegate.mm
index 134a457c..7bda6841 100644
--- a/src/AppDelegate.mm
+++ b/src/AppDelegate.mm
@@ -186,6 +186,15 @@ static void ReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNet
                          if(!shouldNotify) {
                              return;
                          }
+                         bool isIncoming = false;
+                         auto callModel = lrc->getAccountModel()
+                         .getAccountInfo(accountId).callModel.get();
+                         if(callModel->hasCall(conversationInfo.callId)) {
+                             isIncoming = !callModel->getCall(conversationInfo.callId).isOutgoing;
+                         }
+                         if(!isIncoming) {
+                             return;
+                         }
                          NSString* name = bestIDForConversation(conversationInfo, *lrc->getAccountModel().getAccountInfo(accountId).conversationModel.get());
                          NSUserNotification* notification = [[NSUserNotification alloc] init];
 
-- 
GitLab