[calls] notifier: Fix expression testing if there is a contact



commit d3677ad5d10236731e61999cb6083f7911b30708
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Thu Feb 17 17:04:38 2022 +0100

    notifier: Fix expression testing if there is a contact
    
    Previously cui_call_get_display_name() would return the ID of the caller if no
    contact was found. As this has changed recently the test for got_contact broke.

 src/calls-notifier.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/calls-notifier.c b/src/calls-notifier.c
index 99235ac5..67510bac 100644
--- a/src/calls-notifier.c
+++ b/src/calls-notifier.c
@@ -68,8 +68,8 @@ notify (CallsNotifier *self, CuiCall *call)
   name = cui_call_get_display_name (call);
   id = cui_call_get_id (call);
 
-  got_id = !!id && (g_strcmp0 (id, "") != 0);
-  got_contact = got_id && (g_strcmp0 (id, name) != 0);
+  got_id = STR_IS_NULL_OR_EMPTY (id);
+  got_contact = STR_IS_NULL_OR_EMPTY (name);
 
   if (got_contact)
     /* %s is a name here */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]