[ekiga] Fixed bug where disabling an account removed it.



commit 5bb448480ebbf3941390425146282da905c5045e
Author: Damien Sandras <dsandras beip be>
Date:   Wed Sep 19 18:39:52 2012 +0200

    Fixed bug where disabling an account removed it.

 lib/engine/components/opal/opal-account.cpp |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index c69fc9d..7259da4 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -69,6 +69,7 @@ Opal::Account::Account (Ekiga::ServiceCore & _core,
   status = _("Unregistered");
   message_waiting_number = 0;
   failed_registration_already_notified = false;
+  dead = false;
 
   int i = 0;
   char *pch = strtok ((char *) account.c_str (), "|");
@@ -174,6 +175,7 @@ Opal::Account::Account (Ekiga::ServiceCore & _core,
   timeout = _timeout;
   type = t;
   failed_registration_already_notified = false;
+  dead = false;
 
   setup_presentity ();
 
@@ -186,6 +188,9 @@ const std::string Opal::Account::as_string () const
 {
   std::stringstream str;
 
+  if (dead)
+    return "";
+
   str << enabled << "|1|"
       << aid << "|"
       << name << "|"
@@ -352,12 +357,14 @@ SIPRegister::CompatibilityModes Opal::Account::get_compat_mode () const
 
 void Opal::Account::remove ()
 {
-  enabled = false;
+  dead = true;
 
   endpoint->unsubscribe (*this, presentity);
 
+  if (!enabled)
+    removed ();
   trigger_saving ();
-  removed ();
+  enabled = false;
 }
 
 
@@ -609,7 +616,8 @@ Opal::Account::handle_registration_event (RegistrationState state_,
     updated ();
     /* delay destruction of this account until the
        unsubscriber thread has called back */
-    removed ();
+    if (dead)
+      removed ();
     break;
 
   case UnregistrationFailed:



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