diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-04-20 05:37:29 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-04-20 05:37:29 +0800 |
commit | 6967bdfefbf338080434fba5b01879e388d988a8 (patch) | |
tree | 47c6d0666365bdfee96eae747b79adc88fdebe12 /src | |
parent | 26716c54fc25e2e853fb919659c3f7f1e5460918 (diff) | |
download | gsoc2013-empathy-6967bdfefbf338080434fba5b01879e388d988a8.tar gsoc2013-empathy-6967bdfefbf338080434fba5b01879e388d988a8.tar.gz gsoc2013-empathy-6967bdfefbf338080434fba5b01879e388d988a8.tar.bz2 gsoc2013-empathy-6967bdfefbf338080434fba5b01879e388d988a8.tar.lz gsoc2013-empathy-6967bdfefbf338080434fba5b01879e388d988a8.tar.xz gsoc2013-empathy-6967bdfefbf338080434fba5b01879e388d988a8.tar.zst gsoc2013-empathy-6967bdfefbf338080434fba5b01879e388d988a8.zip |
Advertise VoIP capabilities and disable VoIP if it's disabled at build time.
svn path=/trunk/; revision=993
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-filter.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/empathy-filter.c b/src/empathy-filter.c index 888aff6e3..e71504ccb 100644 --- a/src/empathy-filter.c +++ b/src/empathy-filter.c @@ -243,6 +243,7 @@ filter_chat_handle_channel (EmpathyFilter *filter, } } +#ifdef HAVE_VOIP static void filter_call_dispatch (EmpathyFilter *filter, gpointer user_data) @@ -299,6 +300,7 @@ filter_call_handle_channel (EmpathyFilter *filter, filter); } } +#endif static void filter_contact_list_subscribe (EmpathyFilter *filter, @@ -654,9 +656,11 @@ filter_conection_new_channel_cb (TpConnection *connection, if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_TEXT)) { func = filter_chat_handle_channel; } +#ifdef HAVE_VOIP else if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA)) { func = filter_call_handle_channel; } +#endif else if (!tp_strdiff (channel_type, TP_IFACE_CHANNEL_TYPE_CONTACT_LIST)) { func = filter_contact_list_handle_channel; } @@ -703,11 +707,33 @@ filter_connection_list_channels_cb (TpConnection *connection, } } +#ifdef HAVE_VOIP +static void +filter_connection_advertise_capabilities_cb (TpConnection *connection, + const GPtrArray *capabilities, + const GError *error, + gpointer user_data, + GObject *filter) +{ + if (error) { + empathy_debug (DEBUG_DOMAIN, "Error advertising capabilities: %s", + error->message); + } +} +#endif + static void filter_connection_ready_cb (TpConnection *connection, gpointer unused, EmpathyFilter *filter) { +#ifdef HAVE_VOIP + GPtrArray *capabilities; + GType cap_type; + GValue cap; + const gchar *remove = NULL; +#endif + empathy_debug (DEBUG_DOMAIN, "Connection ready, accepting new channels"); tp_cli_connection_connect_to_new_channel (connection, @@ -718,6 +744,29 @@ filter_connection_ready_cb (TpConnection *connection, filter_connection_list_channels_cb, NULL, NULL, G_OBJECT (filter)); + +#ifdef HAVE_VOIP + /* Advertise VoIP capabilities */ + capabilities = g_ptr_array_sized_new (1); + cap_type = dbus_g_type_get_struct ("GValueArray", G_TYPE_STRING, + G_TYPE_UINT, G_TYPE_INVALID); + g_value_init (&cap, cap_type); + g_value_take_boxed (&cap, dbus_g_type_specialized_construct (cap_type)); + dbus_g_type_struct_set (&cap, + 0, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA, + 1, TP_CHANNEL_MEDIA_CAPABILITY_AUDIO | + TP_CHANNEL_MEDIA_CAPABILITY_VIDEO | + TP_CHANNEL_MEDIA_CAPABILITY_NAT_TRAVERSAL_STUN | + TP_CHANNEL_MEDIA_CAPABILITY_NAT_TRAVERSAL_GTALK_P2P, + G_MAXUINT); + g_ptr_array_add (capabilities, g_value_get_boxed (&cap)); + + tp_cli_connection_interface_capabilities_call_advertise_capabilities ( + connection, -1, + capabilities, &remove, + filter_connection_advertise_capabilities_cb, + NULL, NULL, G_OBJECT (filter)); +#endif } static void |