[empathy] connect to val-changed signal in contact manager



commit 7a8efe86d8f47d911b15a9ad3f56c52ba66de41f
Author: Felix Kaser <f kaser gmx net>
Date:   Mon Dec 28 14:39:57 2009 +0100

    connect to val-changed signal in contact manager
    
    new accounts have to be registered for status-changed signals, that can only be done if the account-validity-changed signal is handled.
    fixes bug #604628

 libempathy/empathy-contact-manager.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/empathy-contact-manager.c b/libempathy/empathy-contact-manager.c
index ce77d27..ee3b705 100644
--- a/libempathy/empathy-contact-manager.c
+++ b/libempathy/empathy-contact-manager.c
@@ -176,6 +176,19 @@ contact_manager_status_changed_cb (TpAccount *account,
 }
 
 static void
+contact_manager_validity_changed_cb (TpAccountManager *account_manager,
+				     TpAccount *account,
+				     gboolean valid,
+				     EmpathyContactManager *manager)
+{
+	if (valid) {
+		empathy_signal_connect_weak (account, "status-changed",
+			    G_CALLBACK (contact_manager_status_changed_cb),
+			    G_OBJECT (manager));
+	}
+}
+
+static void
 contact_manager_finalize (GObject *object)
 {
 	EmpathyContactManagerPriv *priv = GET_PRIV (object);
@@ -272,6 +285,10 @@ account_manager_prepared_cb (GObject *source_object,
 		    G_OBJECT (manager));
 	}
 	g_list_free (accounts);
+
+	empathy_signal_connect_weak (account_manager, "account-validity-changed",
+			     G_CALLBACK (contact_manager_validity_changed_cb),
+			     G_OBJECT (manager));
 }
 
 static void



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