-static void
-empathy_new_call_dialog_account_filter (EmpathyContactSelectorDialog *dialog,
- EmpathyAccountChooserFilterResultCallback callback,
- gpointer callback_data,
- TpAccount *account)
-{
- TpConnection *connection;
- gboolean supported = FALSE;
- guint i;
- TpCapabilities *caps;
- GPtrArray *classes;
-
- /* check if CM supports calls */
- connection = tp_account_get_connection (account);
- if (connection == NULL)
- goto out;
-
- caps = tp_connection_get_capabilities (connection);
- if (caps == NULL)
- goto out;
-
- classes = tp_capabilities_get_channel_classes (caps);
-
- for (i = 0; i < classes->len; i++)
- {
- GHashTable *fixed;
- GStrv allowed;
- const gchar *chan_type;
-
- tp_value_array_unpack (g_ptr_array_index (classes, i), 2,
- &fixed, &allowed);
-
- chan_type = tp_asv_get_string (fixed, TP_PROP_CHANNEL_CHANNEL_TYPE);
-
- if (tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA)
- && tp_strdiff (chan_type, TPY_IFACE_CHANNEL_TYPE_CALL))
- continue;
-
- if (tp_asv_get_uint32 (fixed, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, NULL) !=
- TP_HANDLE_TYPE_CONTACT)
- continue;
-
- supported = TRUE;
- break;
- }
-
-out:
- callback (supported, callback_data);
-}
-