[ekiga] Try not to flood the user with "registered" messages



commit 37acbb69ca816724eec4091fd52d367b13619046
Author: Julien Puydt <jpuydt gnome org>
Date:   Fri Jun 5 21:49:55 2009 +0200

    Try not to flood the user with "registered" messages
---
 lib/engine/components/opal/opal-account.cpp |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index 346da99..a15198b 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -449,43 +449,49 @@ void
 Opal::Account::handle_registration_event (RegistrationState state,
 					  std::string info)
 {
+  bool old_active = active;
+
   active = false;
 
   switch (state) {
   case Registered:
-    status = _("Registered");
-    active = true;
-    {
+    if (!old_active) {
+
+      status = _("Registered");
+      active = true;
       gmref_ptr<Ekiga::PresenceCore> presence_core = core.get ("presence-core");
       gmref_ptr<Ekiga::PersonalDetails> personal_details = core.get ("personal-details");
       if (presence_core && personal_details) {
 
 	presence_core->publish (personal_details);
       }
+      updated.emit ();
     } 
     break;
 
   case Unregistered:
     status = _("Unregistered");
+    updated.emit ();
     break;
 
   case UnregistrationFailed:
     status = _("Could not unregister");
     if (!info.empty ())
       status = status + " (" + info + ")";
+    updated.emit ();
     break;
 
   case RegistrationFailed:
     status = _("Could not register");
     if (!info.empty ())
       status = status + " (" + info + ")";
+    updated.emit ();
     break;
 
   case Processing:
     status = _("Processing...");
+    updated.emit ();
   default:
     break;
   }
-
-  updated.emit ();
 }



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