[calls] ringer: Check if incoming call is silenced



commit 410cf8945a8a4f4696634be90f459ffcfed1f5a2
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Tue Oct 19 01:52:18 2021 +0200

    ringer: Check if incoming call is silenced
    
    Avoid ringing in this case.

 src/calls-ringer.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/calls-ringer.c b/src/calls-ringer.c
index 85aaae57..2a538653 100644
--- a/src/calls-ringer.c
+++ b/src/calls-ringer.c
@@ -255,7 +255,8 @@ has_incoming_call (CallsRinger *self)
   for (GList *node = self->calls; node != NULL; node = node->next) {
     CallsCall *call = node->data;
 
-    if (is_ring_state (calls_call_get_state (call)))
+    if (is_ring_state (calls_call_get_state (call)) &&
+        !calls_call_get_silenced (call))
       return TRUE;
   }
   return FALSE;
@@ -292,6 +293,10 @@ call_added_cb (CallsRinger *self,
                             "state-changed",
                             G_CALLBACK (update_ring),
                             self);
+  g_signal_connect_swapped (call,
+                            "notify::silenced",
+                            G_CALLBACK (update_ring),
+                            self);
   update_ring (self);
 }
 


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