]> git.0d.be Git - empathy.git/commitdiff
Activate the event when clicking on the contact list.
authorXavier Claessens <xclaesse@src.gnome.org>
Tue, 15 Jul 2008 14:00:43 +0000 (14:00 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Tue, 15 Jul 2008 14:00:43 +0000 (14:00 +0000)
svn path=/trunk/; revision=1248

libempathy-gtk/empathy-contact-list-view.c

index f8942cbb3dc080d9f50ca460fc112f5c655b74df..4760b425360c228833f06c7037ca93626ffea105 100644 (file)
@@ -671,21 +671,36 @@ contact_list_view_row_activated_cb (EmpathyContactListView *view,
        GtkTreeModel               *model;
        GtkTreeIter                 iter;
 
        GtkTreeModel               *model;
        GtkTreeIter                 iter;
 
-       if (!(priv->contact_features & EMPATHY_CONTACT_FEATURE_CHAT)) {
-               return;
-       }
-
-       model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
-
+       model = GTK_TREE_MODEL (priv->store);
        gtk_tree_model_get_iter (model, &iter, path);
        gtk_tree_model_get (model, &iter,
                            EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact,
                            -1);
 
        gtk_tree_model_get_iter (model, &iter, path);
        gtk_tree_model_get (model, &iter,
                            EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact,
                            -1);
 
-       if (contact) {
+       if (!contact) {
+               return;
+       }
+
+       if (priv->event_manager) {
+               GSList *events, *l;
+
+               events = empathy_event_manager_get_events (priv->event_manager);
+               for (l = events; l; l = l->next) {
+                       EmpathyEvent *event = l->data;
+
+                       if (event->contact == contact) {
+                               empathy_event_activate (event);
+                               goto OUT;
+                       }
+               }
+       }
+
+       if (priv->contact_features & EMPATHY_CONTACT_FEATURE_CHAT) {
                empathy_dispatcher_chat_with_contact (contact);
                empathy_dispatcher_chat_with_contact (contact);
-               g_object_unref (contact);
        }
        }
+
+OUT:
+       g_object_unref (contact);
 }
 
 static void
 }
 
 static void