]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/gossip-contact-list-view.c
sv.po: Updated Swedish translation
[empathy.git] / libempathy-gtk / gossip-contact-list-view.c
index 74b1d187f814713a2ab9bb0a309ab43f4a855693..5c3fd274d9703a71c68c1d800e12c2ba9afd8434 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <libempathy/empathy-contact-manager.h>
 #include <libempathy/empathy-contact-list.h>
+#include <libempathy/empathy-log-manager.h>
 #include <libempathy/gossip-debug.h>
 #include <libempathy/gossip-utils.h>
 #include <libempathy/empathy-marshal.h>
@@ -50,7 +51,7 @@
 #include "empathy-contact-dialogs.h"
 //#include "gossip-chat-invite.h"
 //#include "gossip-ft-window.h"
-//#include "gossip-log-window.h"
+#include "gossip-log-window.h"
 
 #define DEBUG_DOMAIN "ContactListView"
 
@@ -526,14 +527,20 @@ GtkWidget *
 gossip_contact_list_view_get_contact_menu (GossipContactListView *view,
                                           GossipContact         *contact)
 {
-       gboolean can_show_log;
-       gboolean can_send_file;
+       EmpathyLogManager *log_manager;
+       gboolean           can_show_log;
+       gboolean           can_send_file;
 
        g_return_val_if_fail (GOSSIP_IS_CONTACT_LIST_VIEW (view), NULL);
        g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), NULL);
 
-       can_show_log = FALSE; /* FIXME: gossip_log_exists_for_contact (contact); */
+       log_manager = empathy_log_manager_new ();
+       can_show_log = empathy_log_manager_exists (log_manager,
+                                                  gossip_contact_get_account (contact),
+                                                  gossip_contact_get_id (contact),
+                                                  FALSE);
        can_send_file = FALSE;
+       g_object_unref (log_manager);
 
        return contact_list_view_get_contact_menu (view,
                                                   can_send_file,
@@ -1380,14 +1387,15 @@ contact_list_view_filter_show_group (GossipContactListView *view,
        contacts = empathy_contact_list_get_members (list);
        for (l = contacts; l && !show_group; l = l->next) {
                if (!gossip_contact_is_in_group (l->data, group)) {
+                       g_object_unref (l->data);
                        continue;
                }
 
                if (contact_list_view_filter_show_contact (l->data, filter)) {
                        show_group = TRUE;
                }
+               g_object_unref (l->data);
        }
-       g_list_foreach (contacts, (GFunc) g_object_unref, NULL);
        g_list_free (contacts);
        g_free (str);
 
@@ -1484,6 +1492,10 @@ contact_list_view_action_cb (GtkAction             *action,
        else if (contact && strcmp (name, "SendFile") == 0) {
        }
        else if (contact && strcmp (name, "Log") == 0) {
+               gossip_log_window_show (gossip_contact_get_account (contact),
+                                       gossip_contact_get_id (contact),
+                                       FALSE,
+                                       parent);
        }
        else if (group && strcmp (name, "Rename") == 0) {
        }