[empathy] Only follow available cameras if the contact can do Video calls



commit 4305ae9d96e4a6b3fb749b64d6d0c4b0045ab1fc
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Fri May 13 11:54:49 2011 +0100

    Only follow available cameras if the contact can do Video calls

 libempathy-gtk/empathy-individual-menu.c |   13 +++++++++----
 libempathy/empathy-contact.c             |   14 ++------------
 2 files changed, 11 insertions(+), 16 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index 4ae727c..6131bfd 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -700,10 +700,15 @@ empathy_individual_video_call_menu_item_new (FolksIndividual *individual,
           EMPATHY_ACTION_VIDEO_CALL);
     }
 
-  monitor = empathy_camera_monitor_dup_singleton ();
-  g_object_set_data_full (G_OBJECT (item), "monitor", monitor, g_object_unref);
-  g_object_bind_property (monitor, "available", item, "sensitive",
-      G_BINDING_SYNC_CREATE);
+  /* Only follow available cameras if the contact can do Video calls */
+  if (gtk_widget_get_sensitive (item))
+    {
+      monitor = empathy_camera_monitor_dup_singleton ();
+      g_object_set_data_full (G_OBJECT (item),
+          "monitor", monitor, g_object_unref);
+      g_object_bind_property (monitor, "available", item, "sensitive",
+          G_BINDING_SYNC_CREATE);
+    }
 
   return item;
 }
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index a4b35dc..cdca6dc 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -1302,18 +1302,8 @@ empathy_contact_can_do_action (EmpathyContact *self,
         sensitivity = empathy_contact_can_voip_audio (self);
         break;
       case EMPATHY_ACTION_VIDEO_CALL:
-        {
-          EmpathyCameraMonitor *monitor;
-
-          monitor = empathy_camera_monitor_dup_singleton ();
-
-          sensitivity = empathy_contact_can_voip_video (self);
-          sensitivity = sensitivity &&
-              empathy_camera_monitor_get_available (monitor);
-
-          g_object_unref (monitor);
-          break;
-        }
+        sensitivity = empathy_contact_can_voip_video (self);
+        break;
       case EMPATHY_ACTION_VIEW_LOGS:
         sensitivity = contact_has_log (self);
         break;



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