[calls] sip: origin: Make go_online() a no-op in the direct connection case



commit d5fd09847971c2ae60df26ff41484957215d2985
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Mon Jan 10 16:32:45 2022 +0100

    sip: origin: Make go_online() a no-op in the direct connection case
    
    This avoids some special casing in init_sip_account()

 plugins/sip/calls-sip-origin.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/plugins/sip/calls-sip-origin.c b/plugins/sip/calls-sip-origin.c
index f38090ec..963773db 100644
--- a/plugins/sip/calls-sip-origin.c
+++ b/plugins/sip/calls-sip-origin.c
@@ -913,6 +913,9 @@ go_online (CallsAccount *account,
 
   self = CALLS_SIP_ORIGIN (account);
 
+  if (self->use_direct_connection)
+    return;
+
   if (!self->nua) {
     g_warning ("Cannot go online: nua handle not initialized");
     g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ACC_STATE]);
@@ -1038,11 +1041,11 @@ init_sip_account (CallsSipOrigin *self,
     self->state = CALLS_ACCOUNT_ONLINE;
   else {
     self->state = CALLS_ACCOUNT_OFFLINE;
-
-    if (self->auto_connect)
-      go_online (CALLS_ACCOUNT (self), TRUE);
   }
 
+  if (self->auto_connect)
+    go_online (CALLS_ACCOUNT (self), TRUE);
+
   g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ACC_STATE]);
   return TRUE;
 


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