]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-contact-menu.c
Merge branch 'sasl'
[empathy.git] / libempathy-gtk / empathy-contact-menu.c
index 6dfe63a6ef2776a596aa79150cb3f483ec9ddee3..c7fd19b09218a4d5fdd42d3e40bb613a74cf807b 100644 (file)
@@ -216,8 +216,7 @@ static void
 empathy_contact_chat_menu_item_activated (GtkMenuItem *item,
        EmpathyContact *contact)
 {
-  empathy_dispatcher_chat_with_contact (contact, gtk_get_current_event_time (),
-      NULL, NULL);
+  empathy_dispatcher_chat_with_contact (contact, gtk_get_current_event_time ());
 }
 
 GtkWidget *
@@ -232,6 +231,7 @@ empathy_contact_chat_menu_item_new (EmpathyContact *contact)
        image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_MESSAGE,
                                              GTK_ICON_SIZE_MENU);
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+       gtk_widget_set_sensitive (item, !empathy_contact_is_user (contact));
        gtk_widget_show (image);
 
        g_signal_connect (item, "activate",
@@ -245,10 +245,9 @@ static void
 empathy_contact_audio_call_menu_item_activated (GtkMenuItem *item,
        EmpathyContact *contact)
 {
-       EmpathyCallFactory *factory;
 
-       factory = empathy_call_factory_get ();
-       empathy_call_factory_new_call_with_streams (factory, contact, TRUE, FALSE);
+       empathy_call_factory_new_call_with_streams (contact, TRUE, FALSE,
+               gtk_get_current_event_time (), NULL);
 }
 
 GtkWidget *
@@ -263,7 +262,8 @@ empathy_contact_audio_call_menu_item_new (EmpathyContact *contact)
        image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_VOIP,
                                              GTK_ICON_SIZE_MENU);
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
-       gtk_widget_set_sensitive (item, empathy_contact_can_voip_audio (contact));
+       gtk_widget_set_sensitive (item, empathy_contact_can_voip_audio (contact) &&
+                                       !empathy_contact_is_user (contact));
        gtk_widget_show (image);
 
        g_signal_connect (item, "activate",
@@ -277,10 +277,8 @@ static void
 empathy_contact_video_call_menu_item_activated (GtkMenuItem *item,
        EmpathyContact *contact)
 {
-       EmpathyCallFactory *factory;
-
-       factory = empathy_call_factory_get ();
-       empathy_call_factory_new_call_with_streams (factory, contact, TRUE, TRUE);
+       empathy_call_factory_new_call_with_streams (contact, TRUE, TRUE,
+               gtk_get_current_event_time (), NULL);
 }
 
 GtkWidget *
@@ -295,7 +293,8 @@ empathy_contact_video_call_menu_item_new (EmpathyContact *contact)
        image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_VIDEO_CALL,
                                              GTK_ICON_SIZE_MENU);
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
-       gtk_widget_set_sensitive (item, empathy_contact_can_voip_video (contact));
+       gtk_widget_set_sensitive (item, empathy_contact_can_voip_video (contact) &&
+                                       !empathy_contact_is_user (contact));
        gtk_widget_show (image);
 
        g_signal_connect (item, "activate",
@@ -356,7 +355,8 @@ empathy_contact_file_transfer_menu_item_new (EmpathyContact *contact)
        item = gtk_image_menu_item_new_with_mnemonic (_("Send File"));
        image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_DOCUMENT_SEND,
                                              GTK_ICON_SIZE_MENU);
-       gtk_widget_set_sensitive (item, empathy_contact_can_send_files (contact));
+       gtk_widget_set_sensitive (item, empathy_contact_can_send_files (contact) &&
+                                       !empathy_contact_is_user (contact));
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
        gtk_widget_show (image);
 
@@ -367,7 +367,6 @@ empathy_contact_file_transfer_menu_item_new (EmpathyContact *contact)
        return item;
 }
 
-/* FIXME  we should check if the contact supports vnc stream tube */
 GtkWidget *
 empathy_contact_share_my_desktop_menu_item_new (EmpathyContact *contact)
 {
@@ -581,6 +580,12 @@ empathy_contact_invite_menu_item_new (EmpathyContact *contact)
                                              GTK_ICON_SIZE_MENU);
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
 
+       if (empathy_contact_is_user (contact)) {
+               gtk_widget_set_sensitive (item, FALSE);
+               gtk_widget_show (image);
+               return item;
+       }
+
        mgr = empathy_chatroom_manager_dup_singleton (NULL);
        rooms = empathy_chatroom_manager_get_chatrooms (mgr,
                empathy_contact_get_account (contact));