Commit 6336978e authored by Mohammed Sadiq's avatar Mohammed Sadiq Committed by Guido Gunther
Browse files

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

So fix it by comparing the right variables
parent d5184410
Pipeline #70913 failed with stages
in 4 minutes and 53 seconds
......@@ -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;
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