[ekiga] Made ekiga's opal code automatically remember which uris are watched for presence



commit 5892070e3bcecf7fe88d58f071a6cb2087f670ee
Author: Snark <jpuydt gnome org>
Date:   Thu Mar 31 15:40:26 2011 +0200

    Made ekiga's opal code automatically remember which uris are watched for presence
    
    That doesn't look very good, but it seems it makes things better.

 lib/engine/components/opal/opal-account.cpp |    7 +++++--
 lib/engine/components/opal/opal-account.h   |    1 +
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index 453bf30..846fc66 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -298,8 +298,9 @@ void Opal::Account::enable ()
 
     std::cout << "opening presentity for " << get_aor () << std::endl;
     presentity->Open ();
-    //presentity->SubscribeToPresence ("sip:julien puydt ekiga net");
-    //presentity->SubscribeToPresence ("sip:eugen dedu ekiga net");
+    for (std::set<std::string>::iterator iter = watched_uris.begin ();
+	 iter != watched_uris.end (); ++iter)
+      presentity->SubscribeToPresence (PString (*iter));
   }
 
   updated ();
@@ -518,6 +519,7 @@ Opal::Account::publish (const Ekiga::PersonalDetails& details)
 void
 Opal::Account::fetch (const std::string uri)
 {
+  watched_uris.insert (uri);
   if (presentity) {
 
     std::cout << "subscribing to presence of " <<  uri << " for " << get_aor () << std::endl;
@@ -528,6 +530,7 @@ Opal::Account::fetch (const std::string uri)
 void
 Opal::Account::unfetch (const std::string uri)
 {
+  watched_uris.erase (uri);
   if (presentity) {
 
 
diff --git a/lib/engine/components/opal/opal-account.h b/lib/engine/components/opal/opal-account.h
index 2cf215f..7afb2bc 100644
--- a/lib/engine/components/opal/opal-account.h
+++ b/lib/engine/components/opal/opal-account.h
@@ -206,6 +206,7 @@ private:
 
     PDECLARE_PresenceChangeNotifier (Account, OnPresenceChange);
 
+    std::set<std::string> watched_uris; // FIXME: that is wrong... the opal code should do that!
     void presence_status_in_main (std::string uri,
 				  std::string presence,
 				  std::string status);



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