[ekiga] Simplified the code of the OnPresenceChange opal presence callback even further



commit a46af41c0c2c3f7b066ea5dc7277c93024133081
Author: Snark <jpuydt gnome org>
Date:   Thu Mar 31 17:25:25 2011 +0200

    Simplified the code of the OnPresenceChange opal presence callback even further
    
    That variable was unnecessary now that the code is simpler.

 lib/engine/components/opal/opal-account.cpp |   11 +----------
 lib/engine/components/opal/opal-account.h   |    9 ---------
 2 files changed, 1 insertions(+), 19 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index 15d0ba5..ab1d4cc 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -662,9 +662,6 @@ Opal::Account::OnPresenceChange (OpalPresentity& /*presentity*/,
   sip_uri.Sanitise (SIPURL::ExternalURI);
   std::string uri = sip_uri.AsString ();
 
-  std::string old_presence = presence_infos[uri].presence;
-  std::string old_status = presence_infos[uri].status;
-
   /* we could do something precise */
   switch (info.m_state) {
 
@@ -764,13 +761,7 @@ Opal::Account::OnPresenceChange (OpalPresentity& /*presentity*/,
   if (!info.m_note.IsEmpty ())
     new_status = (const char*) info.m_note; // casting a PString to a std::string isn't straightforward
 
-  // If presence change, then signal it to the various components
-  // If presence is unknown (notification with empty body), and it is not the
-  // first notification, and we can conclude it is a ping back from the server
-  // to indicate the presence status did not change, hence we do nothing.
-  presence_infos[uri].presence = new_presence;
-  presence_infos[uri].status = new_status;
-  Ekiga::Runtime::run_in_main (boost::bind (&Opal::Account::presence_status_in_main, this, uri, presence_infos[uri].presence, presence_infos[uri].status));
+  Ekiga::Runtime::run_in_main (boost::bind (&Opal::Account::presence_status_in_main, this, uri, new_presence, new_status));
 }
 
 
diff --git a/lib/engine/components/opal/opal-account.h b/lib/engine/components/opal/opal-account.h
index 7afb2bc..ac08827 100644
--- a/lib/engine/components/opal/opal-account.h
+++ b/lib/engine/components/opal/opal-account.h
@@ -195,15 +195,6 @@ private:
     PSafePtr<OpalPresentity> presentity;
     void setup_presentity ();
 
-    typedef struct {
-
-      std::string presence;
-      std::string status;
-      bool requested;
-    } uri_info;
-    
-    std::map<std::string, uri_info> presence_infos;
-
     PDECLARE_PresenceChangeNotifier (Account, OnPresenceChange);
 
     std::set<std::string> watched_uris; // FIXME: that is wrong... the opal code should do that!



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