[ekiga] Better fix for presence updating



commit c90e63beddb986198ae09c7868adb57ff442549f
Author: Eugen Dedu <eugen dedu univ-fcomte fr>
Date:   Wed Dec 2 15:26:22 2015 +0100

    Better fix for presence updating

 lib/engine/components/opal/opal-account.cpp    |    1 -
 lib/engine/components/opal/opal-presentity.cpp |    9 +++++----
 lib/engine/components/opal/opal-presentity.h   |    6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index ce3ca60..bf0f1c7 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -973,7 +973,6 @@ Opal::Account::load_presentity (boost::weak_ptr<Ekiga::PresenceCore> _presence_c
   // Bank can save everything.
   presentities.add_connection (pres, pres->trigger_saving.connect (boost::ref (trigger_saving)));
   presentities.add_connection (pres, pres->removed.connect (boost::bind (&Opal::Account::unfetch, this, 
pres->get_uri ()), boost::signals2::at_front));  // slot from DynamicObjectStore must be the last called
-  presentities.add_connection (pres, pres->updated.connect (boost::bind (&Opal::Account::fetch, this, 
pres->get_uri ())));
   add_presentity (pres);
 
   return pres;
diff --git a/lib/engine/components/opal/opal-presentity.cpp b/lib/engine/components/opal/opal-presentity.cpp
index 977a1e4..4700c36 100644
--- a/lib/engine/components/opal/opal-presentity.cpp
+++ b/lib/engine/components/opal/opal-presentity.cpp
@@ -97,7 +97,7 @@ Opal::Presentity::build_node (const std::string name,
 
 
 boost::shared_ptr<Opal::Presentity>
-Opal::Presentity::create (const Account & _account,
+Opal::Presentity::create (Account & _account,
                           boost::weak_ptr<Ekiga::PresenceCore> _presence_core,
                           boost::function0<std::list<std::string> > _existing_groups,
                           xmlNodePtr _node)
@@ -113,7 +113,7 @@ Opal::Presentity::create (const Account & _account,
 }
 
 
-Opal::Presentity::Presentity (const Opal::Account & account_,
+Opal::Presentity::Presentity (Opal::Account & account_,
                               boost::weak_ptr<Ekiga::PresenceCore> presence_core_,
                               boost::function0<std::list<std::string> > existing_groups_,
                               xmlNodePtr node_):
@@ -333,8 +333,8 @@ Opal::Presentity::edit_presentity_form_submitted (bool submitted,
 
   if (uri != new_uri) {
     xmlSetProp (node, (const xmlChar*)"uri", (const xmlChar*)new_uri.c_str ());
-    ((Account&)account).unfetch (uri);
-    ((Account&)account).fetch (new_uri);
+    account.unfetch (uri);
+    account.fetch (new_uri);
     Ekiga::Runtime::run_in_main (boost::bind (&Opal::Account::presence_status_in_main, &account, new_uri, 
"unknown", ""));
   }
 
@@ -379,6 +379,7 @@ Opal::Presentity::edit_presentity_form_submitted (bool submitted,
                    BAD_CAST robust_xmlEscape (node->doc, *iter).c_str ());
   }
 
+  updated (this->shared_from_this ());
   trigger_saving ();
 
   return true;
diff --git a/lib/engine/components/opal/opal-presentity.h b/lib/engine/components/opal/opal-presentity.h
index d29498e..78515c2 100644
--- a/lib/engine/components/opal/opal-presentity.h
+++ b/lib/engine/components/opal/opal-presentity.h
@@ -70,7 +70,7 @@ namespace Opal
                                  const std::string uri_,
                                  const std::list<std::string> groups_);
 
-    static boost::shared_ptr<Presentity> create (const Account & _account,
+    static boost::shared_ptr<Presentity> create (Account & _account,
                                                  boost::weak_ptr<Ekiga::PresenceCore> _presence_core,
                                                  boost::function0<std::list<std::string> > _existing_groups,
                                                  xmlNodePtr _node);
@@ -120,7 +120,7 @@ namespace Opal
     void remove ();
 
   private:
-    Presentity (const Account & account,
+    Presentity (Account & account,
                 boost::weak_ptr<Ekiga::PresenceCore> presence_core_,
                 boost::function0<std::list<std::string> > existing_groups_,
                 xmlNodePtr node_);
@@ -135,7 +135,7 @@ namespace Opal
                                         Ekiga::Form& result,
                                          std::string& error);
 
-    const Account & account;
+    Account & account;
     boost::weak_ptr<Ekiga::PresenceCore> presence_core;
     boost::function0<std::list<std::string> > existing_groups;
     xmlNodePtr node;


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