[empathy] chat-window: update the contact menu when folks is loaded



commit 22eab320c9669b7c6307bf202ca661e12ff8de57
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Sep 27 12:39:44 2012 +0200

    chat-window: update the contact menu when folks is loaded

 src/empathy-chat-window.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 9dfe225..296fc67 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -1914,6 +1914,13 @@ chat_window_focus_in_event_cb (GtkWidget *widget,
   return FALSE;
 }
 
+static void
+contacts_loaded_cb (EmpathyIndividualManager *mgr,
+    EmpathyChatWindow *self)
+{
+  chat_window_contact_menu_update (self);
+}
+
 static gboolean
 chat_window_focus_out_event_cb (GtkWidget *widget,
     GdkEvent *event,
@@ -1939,6 +1946,15 @@ chat_window_focus_out_event_cb (GtkWidget *widget,
    */
   self->priv->individual_mgr = empathy_individual_manager_dup_singleton ();
 
+  if (!empathy_individual_manager_get_contacts_loaded (
+      self->priv->individual_mgr))
+    {
+      /* We want to update the contact menu when Folks is loaded so we can
+       * list all the personas of the contact. */
+      tp_g_signal_connect_object (self->priv->individual_mgr, "contacts-loaded",
+          G_CALLBACK (contacts_loaded_cb), self, 0);
+    }
+
   return FALSE;
 }
 



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