[ekiga/ds-gtk-application] Made Opal::Bank a better Ekiga::Cluster
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-gtk-application] Made Opal::Bank a better Ekiga::Cluster
- Date: Thu, 25 Dec 2014 11:46:14 +0000 (UTC)
commit 96d93cdf03c528f25c818e716bba4a67037a2175
Author: Julien Puydt <jpuydt free fr>
Date: Sun Feb 16 20:25:31 2014 +0100
Made Opal::Bank a better Ekiga::Cluster
That should make the roster update better when adding and removing accounts
lib/engine/components/opal/opal-bank.cpp | 18 ++++++++++++++++--
lib/engine/components/opal/opal-bank.h | 2 ++
2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-bank.cpp b/lib/engine/components/opal/opal-bank.cpp
index 2ddc7d8..abc7f30 100644
--- a/lib/engine/components/opal/opal-bank.cpp
+++ b/lib/engine/components/opal/opal-bank.cpp
@@ -94,7 +94,6 @@ Opal::Bank::Bank (Ekiga::ServiceCore& core):
boost::bind(&Opal::Bank::existing_groups, this),
child));
- add_account (account);
Ekiga::BankImpl<Account>::add_connection (account, account->presentity_added.connect (boost::bind
(boost::ref(presentity_added), account, _1)));
Ekiga::BankImpl<Account>::add_connection (account, account->presentity_updated.connect (boost::bind
(boost::ref(presentity_updated), account, _1)));
Ekiga::BankImpl<Account>::add_connection (account, account->presentity_removed.connect (boost::bind
(boost::ref(presentity_removed), account, _1)));
@@ -107,6 +106,9 @@ Opal::Bank::Bank (Ekiga::ServiceCore& core):
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)));
+ Ekiga::BankImpl<Account>::add_connection (account, account->removed.connect (boost::bind
(&Opal::Bank::on_account_removed, this, account)));
+ add_account (account);
+ heap_added (account);
}
}
@@ -266,10 +268,15 @@ Opal::Bank::add (Account::Type acc_type,
opal_component,
boost::bind(&Opal::Bank::existing_groups, this),
child));
- add_account (account);
+ Ekiga::BankImpl<Account>::add_connection (account, account->presentity_added.connect (boost::bind
(boost::ref(presentity_added), account, _1)));
+ Ekiga::BankImpl<Account>::add_connection (account, account->presentity_updated.connect (boost::bind
(boost::ref(presentity_updated), account, _1)));
+ Ekiga::BankImpl<Account>::add_connection (account, account->presentity_removed.connect (boost::bind
(boost::ref(presentity_removed), account, _1)));
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)));
+ Ekiga::BankImpl<Account>::add_connection (account, account->removed.connect (boost::bind
(&Opal::Bank::on_account_removed, this, account)));
+ add_account (account);
+ heap_added (account);
if (is_call_manager_ready && enabled)
account->enable ();
@@ -320,6 +327,13 @@ Opal::Bank::save () const
xmlFree (buffer);
}
+void
+Opal::Bank::on_account_removed (boost::shared_ptr<Account> account)
+{
+ heap_removed (account);
+ remove_account (account);
+}
+
void
Opal::Bank::publish (const Ekiga::PersonalDetails& details)
diff --git a/lib/engine/components/opal/opal-bank.h b/lib/engine/components/opal/opal-bank.h
index 520d0ab..0930f80 100644
--- a/lib/engine/components/opal/opal-bank.h
+++ b/lib/engine/components/opal/opal-bank.h
@@ -138,6 +138,8 @@ private:
void save () const;
+ void on_account_removed (boost::shared_ptr<Account> account);
+
void on_registration_event (std::string aor,
Opal::Account::RegistrationState state,
std::string msg);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]