summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/jami-sip-contacts.patch
blob: dce8f6b98d99bc605228d60f89ff69fe72e35275 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From 3ba007d02bc19e499c8f3c2345302453028831a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Blin?=
 <sebastien.blin@savoirfairelinux.com>
Date: Tue, 29 Nov 2022 09:26:20 -0500
Subject: [PATCH] misc: fix incoming message sip

We do not need to check contacts for SIP as it will be considered
automatically as a contact

Change-Id: If78113e9d79dcd695c39c2d12c0441e2cb282737
---
 src/libclient/conversationmodel.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/client-qt/src/libclient/conversationmodel.cpp b/client-qt/src/libclient/conversationmodel.cpp
index dba206bd..5604a17c 100644
--- a/client-qt/src/libclient/conversationmodel.cpp
+++ b/client-qt/src/libclient/conversationmodel.cpp
@@ -3611,8 +3611,12 @@ ConversationModelPimpl::addIncomingMessage(const QString& peerId,
         try {
             auto contact = linked.owner.contactModel->getContact(peerId);
             isRequest = contact.profileInfo.type == profile::Type::PENDING;
-            if (isRequest && !contact.isBanned && peerId != linked.owner.profileInfo.uri) {
-                addContactRequest(peerId);
+            // if isSip, it will be a contact!
+            auto isSip = linked.owner.profileInfo.type == profile::Type::SIP;
+            if (isSip
+                || (isRequest && !contact.isBanned && peerId != linked.owner.profileInfo.uri)) {
+                if (!isSip)
+                    addContactRequest(peerId);
                 convIds.push_back(storage::beginConversationWithPeer(db, contact.profileInfo.uri));
                 auto& conv = getConversationForPeerUri(contact.profileInfo.uri).get();
                 conv.uid = convIds[0];

base-commit: 6f30acf0043d07dcbe63ee8636509885a9b6fd76
--
2.38.1