[ekiga] Made a new enabled account actually register



commit 2d95caae36797afd529c54ff4eb108ae8174b888
Author: Julien Puydt <jpuydt free fr>
Date:   Fri Jan 10 21:21:32 2014 +0100

    Made a new enabled account actually register

 lib/engine/components/opal/opal-bank.cpp |    6 +++++-
 lib/engine/components/opal/opal-bank.h   |    2 ++
 2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-bank.cpp b/lib/engine/components/opal/opal-bank.cpp
index bf2e193..905b2cc 100644
--- a/lib/engine/components/opal/opal-bank.cpp
+++ b/lib/engine/components/opal/opal-bank.cpp
@@ -50,6 +50,7 @@
 
 
 Opal::Bank::Bank (Ekiga::ServiceCore& core):
+  is_call_manager_ready(false),
   sip_endpoint(core.get<Opal::Sip::EndPoint> ("opal-sip-endpoint")),
   presence_core(core.get<Ekiga::PresenceCore> ("presence-core")),
   notification_core(core.get<Ekiga::NotificationCore> ("notification-core")),
@@ -280,7 +281,6 @@ Opal::Bank::on_new_account_form_submitted (bool submitted,
 
     add (acc_type, new_name, new_host, new_user, new_authentication_user,
         new_password, new_enabled, new_timeout);
-    save ();
   }
 }
 
@@ -314,12 +314,16 @@ Opal::Bank::add (Account::Type acc_type,
   Ekiga::BankImpl<Account>::add_connection (account, account->trigger_saving.connect (boost::bind 
(&Opal::Bank::save, this)));
   Ekiga::BankImpl<Account>::add_connection (account, account->presence_received.connect (boost::ref 
(presence_received)));
   Ekiga::BankImpl<Account>::add_connection (account, account->status_received.connect (boost::ref 
(status_received)));
+
+  if (is_call_manager_ready && enabled)
+    account->enable ();
 }
 
 
 void
 Opal::Bank::call_manager_ready ()
 {
+  is_call_manager_ready = true;
   for (iterator iter = begin ();
        iter != end ();
        ++iter) {
diff --git a/lib/engine/components/opal/opal-bank.h b/lib/engine/components/opal/opal-bank.h
index ce30015..bee474c 100644
--- a/lib/engine/components/opal/opal-bank.h
+++ b/lib/engine/components/opal/opal-bank.h
@@ -120,6 +120,8 @@ public:
     const std::set<std::string> existing_groups () const;
 
 private:
+    bool is_call_manager_ready;
+
     boost::shared_ptr<Opal::Sip::EndPoint> sip_endpoint;
     boost::weak_ptr<Ekiga::PresenceCore> presence_core;
     boost::shared_ptr<Ekiga::NotificationCore> notification_core;


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