[empathy: 1/4] replace empathy_contact_can_use_stream_tube by empathy_contact_can_use_rfb_stream_tube



commit 6a401905c9f98fcf821383012e71f9ea8abe0bc3
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Fri Jun 18 16:10:29 2010 +0200

    replace empathy_contact_can_use_stream_tube by empathy_contact_can_use_rfb_stream_tube
    
    That's the only type of tube we care about and that allows us to enable the
    'Share my Desktop' option only with contacts having a tube enabled Vinagre
    installed (#589225).

 libempathy-gtk/empathy-contact-menu.c |    3 ++-
 libempathy/empathy-contact.c          |   12 +++++++++---
 libempathy/empathy-contact.h          |    4 ++--
 3 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c
index 9ea19af..1df51ca 100644
--- a/libempathy-gtk/empathy-contact-menu.c
+++ b/libempathy-gtk/empathy-contact-menu.c
@@ -381,7 +381,8 @@ empathy_contact_share_my_desktop_menu_item_new (EmpathyContact *contact)
 	item = gtk_image_menu_item_new_with_mnemonic (_("Share My Desktop"));
 	image = gtk_image_new_from_icon_name (GTK_STOCK_NETWORK,
 					      GTK_ICON_SIZE_MENU);
-	gtk_widget_set_sensitive (item, empathy_contact_can_use_stream_tube (contact));
+	gtk_widget_set_sensitive (item, empathy_contact_can_use_rfb_stream_tube (
+		contact));
 	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
 	gtk_widget_show (image);
 
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index cbd3bd0..ba695ca 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -970,7 +970,7 @@ empathy_contact_can_send_files (EmpathyContact *contact)
 }
 
 gboolean
-empathy_contact_can_use_stream_tube (EmpathyContact *contact)
+empathy_contact_can_use_rfb_stream_tube (EmpathyContact *contact)
 {
   EmpathyContactPriv *priv;
 
@@ -978,7 +978,7 @@ empathy_contact_can_use_stream_tube (EmpathyContact *contact)
 
   priv = GET_PRIV (contact);
 
-  return priv->capabilities & EMPATHY_CAPABILITIES_STREAM_TUBE;
+  return priv->capabilities & EMPATHY_CAPABILITIES_RFB_STREAM_TUBE;
 }
 
 static gchar *
@@ -1448,7 +1448,13 @@ tp_caps_to_capabilities (TpCapabilities *caps)
         }
       else if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_STREAM_TUBE))
         {
-          capabilities |= EMPATHY_CAPABILITIES_STREAM_TUBE;
+          const gchar *service;
+
+          service = tp_asv_get_string (fixed_prop,
+              TP_PROP_CHANNEL_TYPE_STREAM_TUBE_SERVICE);
+
+          if (!tp_strdiff (service, "rfb"))
+            capabilities |= EMPATHY_CAPABILITIES_RFB_STREAM_TUBE;
         }
       else if (!tp_strdiff (chan_type,
         TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA))
diff --git a/libempathy/empathy-contact.h b/libempathy/empathy-contact.h
index ddb3f66..b5f24d0 100644
--- a/libempathy/empathy-contact.h
+++ b/libempathy/empathy-contact.h
@@ -65,7 +65,7 @@ typedef enum {
   EMPATHY_CAPABILITIES_AUDIO = 1 << 0,
   EMPATHY_CAPABILITIES_VIDEO = 1 << 1,
   EMPATHY_CAPABILITIES_FT = 1 << 2,
-  EMPATHY_CAPABILITIES_STREAM_TUBE = 1 << 3,
+  EMPATHY_CAPABILITIES_RFB_STREAM_TUBE = 1 << 3,
   EMPATHY_CAPABILITIES_UNKNOWN = 1 << 7
 } EmpathyCapabilities;
 
@@ -106,7 +106,7 @@ gboolean empathy_contact_can_voip (EmpathyContact *contact);
 gboolean empathy_contact_can_voip_audio (EmpathyContact *contact);
 gboolean empathy_contact_can_voip_video (EmpathyContact *contact);
 gboolean empathy_contact_can_send_files (EmpathyContact *contact);
-gboolean empathy_contact_can_use_stream_tube (EmpathyContact *contact);
+gboolean empathy_contact_can_use_rfb_stream_tube (EmpathyContact *contact);
 gboolean empathy_contact_load_avatar_cache (EmpathyContact *contact,
     const gchar *token);
 



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