[gnome-contacts] Fix check is_callable to check for CALL not STREAMED type.



commit 5b9052aaeabc9ddee3fd6db552968389e7b05414
Author: Alban Browaeys <prahal yahoo com>
Date:   Thu Dec 13 22:10:16 2012 +0100

    Fix check is_callable to check for CALL not STREAMED type.
    
    Replace custom code with "caps.supports_audio_call
    (TelepathyGLib.HandleType.CONTACT)":
    - fixes the non introspectable call
    - removes the check on obsolete STREAMED type (all the other sources in
    gnome-contacts now switched to CALL type already, expect this leftover).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690179

 src/contacts-contact.vala |   32 +-------------------------------
 1 files changed, 1 insertions(+), 31 deletions(-)
---
diff --git a/src/contacts-contact.vala b/src/contacts-contact.vala
index fcd7e85..d06d481 100644
--- a/src/contacts-contact.vala
+++ b/src/contacts-contact.vala
@@ -1340,38 +1340,8 @@ public class Contacts.Contact : GLib.Object  {
     if (t_persona != null && t_persona.contact != null) {
       unowned TelepathyGLib.Capabilities caps =
       t_persona.contact.get_capabilities ();
-      unowned GLib.GenericArray<ValueArray> classes =
-	(GLib.GenericArray<ValueArray>) caps.get_channel_classes ();
-      for (var i=0; i < classes.length; i++) {
-	unowned ValueArray clazz = classes.get (i);
-	if (clazz.n_values != 2)
-	  continue;
-
-	unowned Value fixed_prop_val = clazz.get_nth (0);
-	unowned HashTable<string, Value?>? fixed_prop =
-	  (HashTable<string, Value?>) fixed_prop_val.get_boxed ();
-	unowned Value allowed_prop_val = clazz.get_nth (1);
-	unowned string[]? allowed_prop = (string[]) allowed_prop_val.get_boxed ();
-
-	if (fixed_prop == null || allowed_prop == null)
-	  continue;
-
-	var chan_type = fixed_prop.get (
-	    TelepathyGLib.PROP_CHANNEL_CHANNEL_TYPE).get_string ();
-	var handle_type = fixed_prop.get (
-	    TelepathyGLib.PROP_CHANNEL_TARGET_HANDLE_TYPE).get_uint ();
-	if (handle_type != (int) TelepathyGLib.HandleType.CONTACT)
-	  continue;
-
-	if (chan_type == TelepathyGLib.IFACE_CHANNEL_TYPE_STREAMED_MEDIA) {
-	  for (uint j=0; allowed_prop[j] != null; j++) {
-	    var prop = allowed_prop[j];
-	    if (prop ==
-		TelepathyGLib.PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO)
+      if (caps.supports_audio_call (TelepathyGLib.HandleType.CONTACT)) 
 	      return (t_persona.store as Tpf.PersonaStore).account;
-	  }
-	}
-      }
     }
 
     return null;



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