Commit 18b4f705 authored by Evangelos Ribeiro Tzaras's avatar Evangelos Ribeiro Tzaras
Browse files

Merge branch 'wip/sadiq/byzantium' into 'pureos/byzantium'

d/patches: Add patch to fix the right chat

See merge request Librem5/debs/pkg-chatty!8
parents 9d2f4650 73d859b7
chatty (0.4.0~beta2-1pureos2) byzantium; urgency=high
* d/patches: Add patch to fix finding the right chat
-- Mohammed Sadiq <sadiq@sadiqpk.org> Tue, 07 Sep 2021 08:28:34 +0530
chatty (0.4.0~beta2-1pureos1) byzantium; urgency=medium
* Upload to byzantium
......
From 11dcec42b1b1552384e8546ee9af3feebad05187 Mon Sep 17 00:00:00 2001
From: Mohammed Sadiq <sadiq@sadiqpk.org>
Date: Mon, 6 Sep 2021 21:26:10 +0530
Subject: [PATCH] mm-account: Fix matching chats without proper number
If the SMS is an IP SMS, it may not contain a valid number,
and when we try to match such a chat it won't be valid either.
In the case, we compare g_strcmp0 with NULL, which is always
true.
So fix it by comparing the right variables
---
src/users/chatty-mm-account.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/users/chatty-mm-account.c b/src/users/chatty-mm-account.c
index de240497..99759942 100644
--- a/src/users/chatty-mm-account.c
+++ b/src/users/chatty-mm-account.c
@@ -956,8 +956,14 @@ chatty_mm_account_find_chat (ChattyMmAccount *self,
number1 = chatty_utils_check_phonenumber (user_id, country_code);
number2 = chatty_utils_check_phonenumber (phone, country_code);
- if (g_strcmp0 (number1, number2) == 0)
- return chat;
+ /* If We don't have number2, number2 could be a non-digit number (like provider SMS) */
+ if (!number2) {
+ if (g_strcmp0 (user_id, phone) == 0)
+ return chat;
+ } else {
+ if (g_strcmp0 (number1, number2) == 0)
+ return chat;
+ }
}
return NULL;
--
2.33.0
0001-mm-account-Fix-matching-chats-without-proper-number.patch
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment