ekiga r6625 - trunk/src/endpoints



Author: jpuydt
Date: Sun Aug 17 15:30:19 2008
New Revision: 6625
URL: http://svn.gnome.org/viewvc/ekiga?rev=6625&view=rev

Log:
Actually make use of the presence asked to the presence core, fixing bug #547716.

Modified:
   trunk/src/endpoints/sip-presentity.cpp
   trunk/src/endpoints/sip-presentity.h

Modified: trunk/src/endpoints/sip-presentity.cpp
==============================================================================
--- trunk/src/endpoints/sip-presentity.cpp	(original)
+++ trunk/src/endpoints/sip-presentity.cpp	Sun Aug 17 15:30:19 2008
@@ -41,7 +41,8 @@
   : core(_core), name(name_), uri(uri_), presence("presence-unknown")
 {
   presence_core = dynamic_cast<Ekiga::PresenceCore*>(core.get ("presence-core"));
-
+  presence_core->presence_received.connect (sigc::mem_fun (this, &SIP::Presentity::on_presence_received));
+  presence_core->status_received.connect (sigc::mem_fun (this, &SIP::Presentity::on_status_received));
   presence_core->fetch_presence (uri);
 }
 
@@ -105,3 +106,25 @@
 {
   return presence_core->populate_presentity_menu (*this, uri, builder);
 }
+
+void
+SIP::Presentity::on_presence_received (std::string uri_,
+				       std::string presence_)
+{
+  if (uri == uri_) {
+
+    presence = presence_;
+    updated.emit ();
+  }
+}
+
+void
+SIP::Presentity::on_status_received (std::string uri_,
+				     std::string status_)
+{
+  if (uri == uri_) {
+
+    status = status_;
+    updated.emit ();
+  }
+}

Modified: trunk/src/endpoints/sip-presentity.h
==============================================================================
--- trunk/src/endpoints/sip-presentity.h	(original)
+++ trunk/src/endpoints/sip-presentity.h	Sun Aug 17 15:30:19 2008
@@ -54,7 +54,9 @@
   /**
    * This class implements an Ekiga::Presentity.
    */
-  class Presentity: public Ekiga::Presentity
+  class Presentity:
+    public Ekiga::Presentity,
+    public sigc::trackable
   {
   public:
 
@@ -108,6 +110,12 @@
     std::string status;
     std::string avatar;
 
+    void on_presence_received (std::string uri_,
+			       std::string presence_);
+
+    void on_status_received (std::string uri_,
+			     std::string status_);
+
     std::set<std::string> groups;
   };
 



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