diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2011-11-14 11:23:57 +0100 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.co.uk> | 2012-01-10 14:26:59 +0100 |
commit | af4d97822b9055fd8a7670b53b28c7c1f820ec65 (patch) | |
tree | ea2618caaee98e447e20e87dedf72ccd3d2bcbbb | |
parent | 66e1966ee3b3303968997f229f62ada8d7b519ba (diff) |
Remove tp-yell and use TpCallChannel
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rwxr-xr-x | autogen.sh | 13 | ||||
-rw-r--r-- | configure.ac | 15 | ||||
-rw-r--r-- | data/Empathy.Call.client | 16 | ||||
-rw-r--r-- | libempathy-gtk/empathy-call-utils.c | 89 | ||||
-rw-r--r-- | libempathy-gtk/empathy-call-utils.h | 5 | ||||
-rw-r--r-- | libempathy-gtk/empathy-log-window.c | 8 | ||||
-rw-r--r-- | libempathy-gtk/empathy-new-call-dialog.c | 2 | ||||
-rw-r--r-- | libempathy/Makefile.am | 2 | ||||
-rw-r--r-- | libempathy/empathy-client-factory.c | 35 | ||||
-rw-r--r-- | libempathy/empathy-contact.c | 15 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/empathy-call-factory.c | 112 | ||||
-rw-r--r-- | src/empathy-call-handler.c | 160 | ||||
-rw-r--r-- | src/empathy-call-handler.h | 4 | ||||
-rw-r--r-- | src/empathy-call-observer.c | 12 | ||||
-rw-r--r-- | src/empathy-call-window.c | 63 | ||||
-rw-r--r-- | src/empathy-call-window.h | 2 | ||||
-rw-r--r-- | src/empathy-call.c | 6 | ||||
-rw-r--r-- | src/empathy-event-manager.c | 45 | ||||
-rw-r--r-- | src/empathy-notifications-approver.c | 11 | ||||
-rw-r--r-- | src/empathy.c | 3 | ||||
m--------- | telepathy-yell | 0 |
24 files changed, 230 insertions, 395 deletions
diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index a61f9732..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "telepathy-yell"] - path = telepathy-yell - url = git://anongit.freedesktop.org/telepathy/telepathy-yell.git diff --git a/Makefile.am b/Makefile.am index f86a3a46..1a3a118b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -MY_SUBDIRS = tools extensions po data telepathy-yell libempathy libempathy-gtk src help tests +MY_SUBDIRS = tools extensions po data libempathy libempathy-gtk src help tests NST_SUBDIRS = nautilus-sendto-plugin GOA_SUBDIRS = goa-mc-plugin @@ -18,17 +18,4 @@ which gnome-autogen.sh || { exit 1 } -# Fetch submodules if needed -if test ! -f telepathy-yell/autogen.sh; -then - echo "+ Setting up submodules" - git submodule init -fi -git submodule update - -# launch tp-yell's autogen.sh -cd telepathy-yell -sh autogen.sh --no-configure -cd .. - USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh diff --git a/configure.ac b/configure.ac index f0b2eb90..efc7583b 100644 --- a/configure.ac +++ b/configure.ac @@ -71,15 +71,6 @@ CHAMPLAIN_REQUIRED=0.12.1 # those warnings later during the cycle (bgo #662662) AC_DEFINE(GLIB_DISABLE_DEPRECATION_WARNINGS, 1, [Build with GLib deprecated]) -# telepathy-yell -prev_top_build_prefix=$ac_top_build_prefix -prev_ac_configure_args=$ac_configure_args -ac_configure_args="$ac_configure_args --disable-shared-library" -AX_CONFIG_DIR([telepathy-yell]) -ac_top_build_prefix=$prev_top_build_prefix -ac_configure_args=$prev_ac_configure_args -export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"$ac_top_build_prefix"telepathy-yell/telepathy-yell - AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([configure.ac]) @@ -204,8 +195,6 @@ PKG_CHECK_MODULES(EMPATHY, libsoup-2.4 ]) -PKG_CHECK_MODULES(YELL, [telepathy-yell]) - PKG_CHECK_MODULES(EMPATHY_AV, [ farsight2-0.10 @@ -225,8 +214,8 @@ AC_ARG_ENABLE(call, if test "x$enable_call" != "xno" ; then PKG_CHECK_MODULES(EMPATHY_CALL, [ - farsight2-0.10 - telepathy-farstream >= 0.1.2 + farstream-0.1 + telepathy-farstream >= 0.2.0 clutter-1.0 >= $CLUTTER_REQUIRED clutter-gtk-1.0 clutter-gst-1.0 diff --git a/data/Empathy.Call.client b/data/Empathy.Call.client index 259025d8..468a9962 100644 --- a/data/Empathy.Call.client +++ b/data/Empathy.Call.client @@ -2,20 +2,20 @@ Interfaces=org.freedesktop.Telepathy.Client.Handler [org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 0] -org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call.DRAFT +org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call1 org.freedesktop.Telepathy.Channel.TargetHandleType u=1 [org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 1] -org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call.DRAFT +org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call1 org.freedesktop.Telepathy.Channel.TargetHandleType u=1 -org.freedesktop.Telepathy.Channel.Type.Call.DRAFT.InitialAudio b=true +org.freedesktop.Telepathy.Channel.Type.Call1.InitialAudio b=true [org.freedesktop.Telepathy.Client.Handler.HandlerChannelFilter 2] -org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call.DRAFT +org.freedesktop.Telepathy.Channel.ChannelType s=org.freedesktop.Telepathy.Channel.Type.Call1 org.freedesktop.Telepathy.Channel.TargetHandleType u=1 -org.freedesktop.Telepathy.Channel.Type.Call.DRAFT.InitialVideo b=true +org.freedesktop.Telepathy.Channel.Type.Call1.InitialVideo b=true [org.freedesktop.Telepathy.Client.Handler.Capabilities] -org.freedesktop.Telepathy.Channel.Type.Call.DRAFT/ice-udp=true -org.freedesktop.Telepathy.Channel.Type.Call.DRAFT/gtalk-p2p=true -org.freedesktop.Telepathy.Channel.Type.Call.DRAFT/video/h264=true +org.freedesktop.Telepathy.Channel.Type.Call1/ice-udp=true +org.freedesktop.Telepathy.Channel.Type.Call1/gtalk-p2p=true +org.freedesktop.Telepathy.Channel.Type.Call1/video/h264=true diff --git a/libempathy-gtk/empathy-call-utils.c b/libempathy-gtk/empathy-call-utils.c index 16526d35..c2363c41 100644 --- a/libempathy-gtk/empathy-call-utils.c +++ b/libempathy-gtk/empathy-call-utils.c @@ -27,8 +27,6 @@ #include <telepathy-glib/telepathy-glib.h> -#include <telepathy-yell/telepathy-yell.h> - #include "empathy-call-utils.h" #include <libempathy/empathy-gsettings.h> @@ -85,14 +83,14 @@ empathy_call_create_call_request (const gchar *contact, { return tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TPY_IFACE_CHANNEL_TYPE_CALL, + TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, TP_PROP_CHANNEL_TARGET_ID, G_TYPE_STRING, contact, - TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, G_TYPE_BOOLEAN, + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, G_TYPE_BOOLEAN, initial_audio, - TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, G_TYPE_BOOLEAN, + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, G_TYPE_BOOLEAN, initial_video, NULL); } @@ -283,3 +281,84 @@ empathy_call_set_stream_properties (GstElement *element, g_object_unref (gsettings_call); } + +/* Copied from telepathy-yell call-channel.c */ +void +empathy_call_channel_send_video (TpCallChannel *self, + gboolean send) +{ + GPtrArray *contents; + gboolean found = FALSE; + guint i; + + g_return_if_fail (TP_IS_CALL_CHANNEL (self)); + + /* Loop over all the contents, if some of them a video set all their + * streams to sending, otherwise request a video channel in case we want to + * sent */ + contents = tp_call_channel_get_contents (self); + for (i = 0 ; i < contents->len ; i++) + { + TpCallContent *content = g_ptr_array_index (contents, i); + + if (tp_call_content_get_media_type (content) == + TP_MEDIA_STREAM_TYPE_VIDEO) + { + GPtrArray *streams; + guint j; + + found = TRUE; + streams = tp_call_content_get_streams (content); + for (j = 0; j < streams->len; j++) + { + TpCallStream *stream = g_ptr_array_index (streams, j); + + tp_call_stream_set_sending_async (stream, send, NULL, NULL); + } + } + } + + if (send && !found) + { + tp_call_channel_add_content_async (self, "video", + TP_MEDIA_STREAM_TYPE_VIDEO, NULL, NULL); + } +} + +/* Copied from telepathy-yell call-channel.c */ +TpSendingState +empathy_call_channel_get_video_state (TpCallChannel *self) +{ + TpSendingState result = TP_SENDING_STATE_NONE; + GPtrArray *contents; + guint i; + + g_return_val_if_fail (TP_IS_CALL_CHANNEL (self), TP_SENDING_STATE_NONE); + + contents = tp_call_channel_get_contents (self); + for (i = 0 ; i < contents->len ; i++) + { + TpCallContent *content = g_ptr_array_index (contents, i); + + if (tp_call_content_get_media_type (content) == + TP_MEDIA_STREAM_TYPE_VIDEO) + { + GPtrArray *streams; + guint j; + + streams = tp_call_content_get_streams (content); + for (j = 0; j < streams->len; j++) + { + TpCallStream *stream = g_ptr_array_index (streams, j); + TpSendingState state; + + state = tp_call_stream_get_local_sending_state (stream); + if (state != TP_SENDING_STATE_PENDING_STOP_SENDING && + state > result) + result = state; + } + } + } + + return result; +} diff --git a/libempathy-gtk/empathy-call-utils.h b/libempathy-gtk/empathy-call-utils.h index 83610310..99e4ecf9 100644 --- a/libempathy-gtk/empathy-call-utils.h +++ b/libempathy-gtk/empathy-call-utils.h @@ -43,6 +43,11 @@ GHashTable * empathy_call_create_streamed_media_request (const gchar *contact, void empathy_call_set_stream_properties (GstElement *element, gboolean echo_cancellation); +TpSendingState empathy_call_channel_get_video_state (TpCallChannel *self); +void empathy_call_channel_send_video (TpCallChannel *self, + gboolean send); + + G_END_DECLS #endif /* __EMPATHY_CALL_UTILS_H__ */ diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index 51a47c7a..13fdefbd 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -34,8 +34,6 @@ #include <telepathy-glib/telepathy-glib.h> #include <telepathy-glib/proxy-subclass.h> -#include <telepathy-yell/telepathy-yell.h> - #include <telepathy-logger/telepathy-logger.h> #ifdef HAVE_CALL_LOGS # include <telepathy-logger/call-event.h> @@ -873,7 +871,7 @@ maybe_refresh_logs (TpChannel *channel, !(event_mask & TPL_EVENT_MASK_TEXT)) goto out; if ((!tp_strdiff (type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA) || - !tp_strdiff (type, TPY_IFACE_CHANNEL_TYPE_CALL)) && + !tp_strdiff (type, TP_IFACE_CHANNEL_TYPE_CALL)) && !(event_mask & TPL_EVENT_MASK_CALL)) goto out; @@ -1015,7 +1013,7 @@ observe_channels (TpSimpleObserver *observer, tp_g_signal_connect_object (channel, "invalidated", G_CALLBACK (on_channel_ended), self, 0); } - else if (!tp_strdiff (type, TPY_IFACE_CHANNEL_TYPE_CALL) || + else if (!tp_strdiff (type, TP_IFACE_CHANNEL_TYPE_CALL) || !tp_strdiff (type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA)) { g_hash_table_insert (self->priv->channels, @@ -1060,7 +1058,7 @@ log_window_create_observer (EmpathyLogWindow *self) tp_base_client_take_observer_filter (self->priv->observer, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TPY_IFACE_CHANNEL_TYPE_CALL, + TP_IFACE_CHANNEL_TYPE_CALL, NULL)); tp_base_client_register (self->priv->observer, NULL); diff --git a/libempathy-gtk/empathy-new-call-dialog.c b/libempathy-gtk/empathy-new-call-dialog.c index 0fecedde..ba44721d 100644 --- a/libempathy-gtk/empathy-new-call-dialog.c +++ b/libempathy-gtk/empathy-new-call-dialog.c @@ -28,8 +28,6 @@ #include <telepathy-glib/interfaces.h> -#include <telepathy-yell/telepathy-yell.h> - #include <libempathy/empathy-tp-contact-factory.h> #include <libempathy/empathy-camera-monitor.h> #include <libempathy/empathy-utils.h> diff --git a/libempathy/Makefile.am b/libempathy/Makefile.am index da37ef37..ca02a18d 100644 --- a/libempathy/Makefile.am +++ b/libempathy/Makefile.am @@ -10,7 +10,6 @@ AM_CPPFLAGS = \ -DG_LOG_DOMAIN=\"empathy\" \ -DGCR_API_SUBJECT_TO_CHANGE \ $(EMPATHY_CFLAGS) \ - $(YELL_CFLAGS) \ $(GEOCLUE_CFLAGS) \ $(GEOCODE_CFLAGS) \ $(NETWORK_MANAGER_CFLAGS) \ @@ -147,7 +146,6 @@ nodist_libempathy_la_SOURCES =\ libempathy_la_LIBADD = \ $(top_builddir)/extensions/libemp-extensions.la \ - $(top_builddir)/telepathy-yell/telepathy-yell/libtelepathy-yell.la \ $(GCR_LIBS) \ $(EMPATHY_LIBS) \ $(GEOCLUE_LIBS) \ diff --git a/libempathy/empathy-client-factory.c b/libempathy/empathy-client-factory.c index 035c5695..65c0d267 100644 --- a/libempathy/empathy-client-factory.c +++ b/libempathy/empathy-client-factory.c @@ -26,42 +26,12 @@ #include "empathy-tp-chat.h" #include "empathy-utils.h" -#include <telepathy-yell/telepathy-yell.h> - G_DEFINE_TYPE (EmpathyClientFactory, empathy_client_factory, TP_TYPE_AUTOMATIC_CLIENT_FACTORY) #define chainup ((TpSimpleClientFactoryClass *) \ empathy_client_factory_parent_class) -/* FIXME: move to yell */ -static TpyCallChannel * -call_channel_new_with_factory (TpSimpleClientFactory *factory, - TpConnection *conn, - const gchar *object_path, - const GHashTable *immutable_properties, - GError **error) -{ - TpProxy *conn_proxy = (TpProxy *) conn; - - g_return_val_if_fail (TP_IS_CONNECTION (conn), NULL); - g_return_val_if_fail (object_path != NULL, NULL); - g_return_val_if_fail (immutable_properties != NULL, NULL); - - if (!tp_dbus_check_valid_object_path (object_path, error)) - return NULL; - - return g_object_new (TPY_TYPE_CALL_CHANNEL, - "factory", factory, - "connection", conn, - "dbus-daemon", conn_proxy->dbus_daemon, - "bus-name", conn_proxy->bus_name, - "object-path", object_path, - "handle-type", (guint) TP_UNKNOWN_HANDLE_TYPE, - "channel-properties", immutable_properties, - NULL); -} - static TpChannel * empathy_client_factory_create_channel (TpSimpleClientFactory *factory, TpConnection *conn, @@ -83,11 +53,6 @@ empathy_client_factory_create_channel (TpSimpleClientFactory *factory, TP_SIMPLE_CLIENT_FACTORY (factory), account, conn, path, properties)); } - else if (!tp_strdiff (chan_type, TPY_IFACE_CHANNEL_TYPE_CALL)) - { - return TP_CHANNEL (call_channel_new_with_factory ( - TP_SIMPLE_CLIENT_FACTORY (factory), conn, path, properties, error)); - } return chainup->create_channel (factory, conn, path, properties, error); } diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c index c947fad6..b8d2f3c4 100644 --- a/libempathy/empathy-contact.c +++ b/libempathy/empathy-contact.c @@ -28,7 +28,6 @@ #include <telepathy-glib/account-manager.h> #include <telepathy-glib/interfaces.h> #include <telepathy-glib/util.h> -#include <telepathy-yell/telepathy-yell.h> #include <telepathy-logger/log-manager.h> @@ -1741,8 +1740,7 @@ tp_caps_to_capabilities (TpCapabilities *caps) if (!tp_strdiff (service, "rfb")) capabilities |= EMPATHY_CAPABILITIES_RFB_STREAM_TUBE; } - else if (!tp_strdiff (chan_type, - TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA)) + else if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA)) { guint j; @@ -1769,26 +1767,25 @@ tp_caps_to_capabilities (TpCapabilities *caps) TP_PROP_CHANNEL_INTERFACE_SMS_SMS_CHANNEL, NULL)) capabilities |= EMPATHY_CAPABILITIES_SMS; } - else if (!tp_strdiff (chan_type, - TPY_IFACE_CHANNEL_TYPE_CALL)) + else if (!tp_strdiff (chan_type, TP_IFACE_CHANNEL_TYPE_CALL)) { guint j; if (tp_asv_get_boolean (fixed_prop, - TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL)) + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, NULL)) capabilities |= EMPATHY_CAPABILITIES_AUDIO; if (tp_asv_get_boolean (fixed_prop, - TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL)) + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, NULL)) capabilities |= EMPATHY_CAPABILITIES_VIDEO; for (j = 0; allowed_prop[j] != NULL; j++) { if (!tp_strdiff (allowed_prop[j], - TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO)) + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO)) capabilities |= EMPATHY_CAPABILITIES_AUDIO; else if (!tp_strdiff (allowed_prop[j], - TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO)) + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO)) capabilities |= EMPATHY_CAPABILITIES_VIDEO; } } diff --git a/src/Makefile.am b/src/Makefile.am index 06eaf173..4b42fd11 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,6 @@ include $(top_srcdir)/tools/flymake.mk CPPFLAGS_COMMON = \ - $(YELL_CFLAGS) \ $(EMPATHY_CFLAGS) \ $(EDS_CFLAGS) \ $(ERROR_CFLAGS) \ @@ -24,7 +23,6 @@ LDADD = \ $(top_builddir)/extensions/libemp-extensions.la \ $(GCR_LIBS) \ $(EMPATHY_LIBS) \ - $(YELL_LIBS) \ $(LIBCHAMPLAIN_LIBS) \ $(NULL) diff --git a/src/empathy-call-factory.c b/src/empathy-call-factory.c index b3c85f4b..4ff8ebe5 100644 --- a/src/empathy-call-factory.c +++ b/src/empathy-call-factory.c @@ -27,8 +27,6 @@ #include <telepathy-glib/interfaces.h> #include <telepathy-glib/util.h> -#include <telepathy-yell/telepathy-yell.h> - #include <libempathy/empathy-client-factory.h> #include <libempathy/empathy-request-util.h> #include <libempathy/empathy-tp-contact-factory.h> @@ -76,32 +74,32 @@ empathy_call_factory_init (EmpathyCallFactory *obj) tp_base_client_take_approver_filter (client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TPY_IFACE_CHANNEL_TYPE_CALL, + TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL)); tp_base_client_take_handler_filter (client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TPY_IFACE_CHANNEL_TYPE_CALL, + TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL)); tp_base_client_take_handler_filter (client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TPY_IFACE_CHANNEL_TYPE_CALL, + TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, - TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, G_TYPE_BOOLEAN, TRUE, + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_AUDIO, G_TYPE_BOOLEAN, TRUE, NULL)); tp_base_client_take_handler_filter (client, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TPY_IFACE_CHANNEL_TYPE_CALL, + TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, - TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, G_TYPE_BOOLEAN, TRUE, + TP_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO, G_TYPE_BOOLEAN, TRUE, NULL)); tp_base_client_add_handler_capabilities_varargs (client, @@ -151,7 +149,7 @@ empathy_call_factory_class_init (EmpathyCallFactoryClass *klass) NULL, NULL, g_cclosure_marshal_generic, G_TYPE_BOOLEAN, - 4, G_TYPE_UINT, TPY_TYPE_CALL_CHANNEL, + 4, G_TYPE_UINT, TP_TYPE_CALL_CHANNEL, TP_TYPE_CHANNEL_DISPATCH_OPERATION, TP_TYPE_ADD_DISPATCH_OPERATION_CONTEXT); } @@ -189,66 +187,6 @@ empathy_call_factory_get (void) } static void -call_channel_got_contact (TpConnection *connection, - EmpathyContact *contact, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - EmpathyCallFactory *factory = EMPATHY_CALL_FACTORY (weak_object); - EmpathyCallHandler *handler; - TpyCallChannel *call = TPY_CALL_CHANNEL (user_data); - - if (contact == NULL) - { - /* FIXME use hangup with an appropriate error */ - tp_channel_close_async (TP_CHANNEL (call), NULL, NULL); - return; - } - - handler = empathy_call_handler_new_for_channel (call, contact); - - g_signal_emit (factory, signals[NEW_CALL_HANDLER], 0, - handler, FALSE); - - g_object_unref (handler); -} - -static void -call_channel_ready (EmpathyCallFactory *factory, - TpyCallChannel *call) -{ - TpChannel *channel = TP_CHANNEL (call); - const gchar *id; - - id = tp_channel_get_identifier (channel); - - /* The ready callback has a reference, so pass that on */ - empathy_tp_contact_factory_get_from_id ( - tp_channel_borrow_connection (channel), - id, - call_channel_got_contact, - channel, - g_object_unref, - (GObject *) factory); -} - -static void -call_channel_ready_cb (TpyCallChannel *call, - GParamSpec *spec, - EmpathyCallFactory *factory) -{ - gboolean ready; - - g_object_get (call, "ready", &ready, NULL); - if (!ready) - return; - - call_channel_ready (factory, call); -} - - -static void handle_channels (TpBaseClient *client, TpAccount *account, TpConnection *connection, @@ -263,36 +201,38 @@ handle_channels (TpBaseClient *client, for (l = channels; l != NULL; l = g_list_next (l)) { TpChannel *channel = l->data; - TpyCallChannel *call; - gboolean ready; + TpCallChannel *call; + TpContact *tp_contact; + EmpathyContact *contact; + EmpathyCallHandler *handler; if (tp_proxy_get_invalidated (channel) != NULL) continue; if (tp_channel_get_channel_type_id (channel) != - TPY_IFACE_QUARK_CHANNEL_TYPE_CALL) + TP_IFACE_QUARK_CHANNEL_TYPE_CALL) continue; - if (!TPY_IS_CALL_CHANNEL (channel)) + if (!TP_IS_CALL_CHANNEL (channel)) continue; - call = TPY_CALL_CHANNEL (channel); + call = TP_CALL_CHANNEL (channel); + + tp_contact = tp_channel_get_target_contact (channel); + contact = empathy_contact_dup_from_tp_contact (tp_contact); + handler = empathy_call_handler_new_for_channel (call, contact); - /* Take a ref to keep while hopping through the async callbacks */ - g_object_ref (call); - g_object_get (call, "ready", &ready, NULL); + g_signal_emit (self, signals[NEW_CALL_HANDLER], 0, + handler, FALSE); - if (!ready) - tp_g_signal_connect_object (call, "notify::ready", - G_CALLBACK (call_channel_ready_cb), self, 0); - else - call_channel_ready (self, call); + g_object_unref (handler); + g_object_unref (contact); } tp_handle_channels_context_accept (context); } -static TpyCallChannel * +static TpCallChannel * find_call_channel (GList *channels) { GList *l; @@ -307,8 +247,8 @@ find_call_channel (GList *channels) channel_type = tp_channel_get_channel_type_id (channel); - if (channel_type == TPY_IFACE_QUARK_CHANNEL_TYPE_CALL) - return TPY_CALL_CHANNEL (channel); + if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_CALL) + return TP_CALL_CHANNEL (channel); } return NULL; @@ -323,7 +263,7 @@ approve_channels (TpBaseClient *client, TpAddDispatchOperationContext *context) { EmpathyCallFactory *self = EMPATHY_CALL_FACTORY (client); - TpyCallChannel *channel; + TpCallChannel *channel; guint handle; GError error = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "" }; gboolean handled = FALSE; diff --git a/src/empathy-call-handler.c b/src/empathy-call-handler.c index 4014ad6c..11974665 100644 --- a/src/empathy-call-handler.c +++ b/src/empathy-call-handler.c @@ -26,8 +26,6 @@ #include <telepathy-glib/util.h> #include <telepathy-glib/interfaces.h> -#include <telepathy-yell/telepathy-yell.h> - #include <telepathy-farstream/telepathy-farstream.h> #include <libempathy/empathy-utils.h> @@ -63,7 +61,6 @@ enum { PROP_CALL_CHANNEL = 1, PROP_GST_BUS, PROP_CONTACT, - PROP_MEMBERS, PROP_INITIAL_AUDIO, PROP_INITIAL_VIDEO, PROP_SEND_AUDIO_CODEC, @@ -79,11 +76,9 @@ enum { /* private structure */ struct _EmpathyCallHandlerPriv { - TpyCallChannel *call; + TpCallChannel *call; EmpathyContact *contact; - /* GArray of TpContacts */ - GArray *members; TfChannel *tfchannel; gboolean initial_audio; gboolean initial_video; @@ -109,8 +104,6 @@ empathy_call_handler_dispose (GObject *object) tp_clear_object (&priv->call); tp_clear_object (&priv->contact); - tp_clear_pointer (&priv->members, g_array_unref); - G_OBJECT_CLASS (empathy_call_handler_parent_class)->dispose (object); } @@ -141,36 +134,7 @@ empathy_call_handler_init (EmpathyCallHandler *obj) } static void -on_get_contacts_cb (TpConnection *connection, - guint n_contacts, - EmpathyContact * const * contacts, - guint n_failed, - const TpHandle *failed, - const GError *error, - gpointer user_data, - GObject *weak_object) -{ - EmpathyCallHandler *self = EMPATHY_CALL_HANDLER (weak_object); - EmpathyCallHandlerPriv *priv = GET_PRIV (self); - guint i; - - if (n_failed > 0) - g_warning ("Failed to get %d EmpathyContacts: %s", - n_failed, error->message); - - priv->members = g_array_sized_new (FALSE, TRUE, - sizeof (EmpathyContact *), n_contacts); - - for (i = 0; i < n_contacts; i++) - g_object_ref (contacts[i]); - - g_array_append_vals (priv->members, contacts, n_contacts); - - g_object_notify (G_OBJECT (self), "members"); -} - -static void -on_call_invalidated_cb (TpyCallChannel *call, +on_call_invalidated_cb (TpCallChannel *call, guint domain, gint code, gchar *message, @@ -182,30 +146,26 @@ on_call_invalidated_cb (TpyCallChannel *call, { /* Invalidated unexpectedly? Fake call ending */ g_signal_emit (self, signals[STATE_CHANGED], 0, - TPY_CALL_STATE_ENDED, NULL); + TP_CALL_STATE_ENDED, NULL); tp_clear_object (&priv->call); tp_clear_object (&priv->tfchannel); } } static void -on_call_state_changed_cb (TpyCallChannel *call, - TpyCallState state, - TpyCallFlags flags, - const GValueArray *call_state_reason, - GHashTable *call_state_details, +on_call_state_changed_cb (TpCallChannel *call, + TpCallState state, + TpCallFlags flags, + TpCallStateReason *reason, + GHashTable *details, EmpathyCallHandler *handler) { EmpathyCallHandlerPriv *priv = handler->priv; - gchar *dbus_reason; - guint actor, reason; - - tp_value_array_unpack ((GValueArray *) call_state_reason, 3, - &actor, &reason, &dbus_reason); - g_signal_emit (handler, signals[STATE_CHANGED], 0, state, dbus_reason); + g_signal_emit (handler, signals[STATE_CHANGED], 0, state, + reason->dbus_reason); - if (state == TPY_CALL_STATE_ENDED) + if (state == TP_CALL_STATE_ENDED) { tp_channel_close_async (TP_CHANNEL (call), NULL, NULL); @@ -215,58 +175,6 @@ on_call_state_changed_cb (TpyCallChannel *call, } static void -on_members_changed_cb (TpyCallChannel *call, - GHashTable *members, - EmpathyCallHandler *self) -{ - EmpathyCallHandlerPriv *priv = GET_PRIV (self); - GHashTableIter iter; - gpointer key, value; - TpHandle *handles; - guint n_handles; - guint i = 0; - - if (members == NULL) - return; - - n_handles = g_hash_table_size (members); - if (n_handles == 0) - return; - - handles = g_new0 (TpHandle, n_handles); - - g_hash_table_iter_init (&iter, members); - while (g_hash_table_iter_next (&iter, &key, &value)) - handles[i++] = GPOINTER_TO_UINT (key); - - empathy_tp_contact_factory_get_from_handles ( - tp_channel_borrow_connection (TP_CHANNEL (priv->call)), - n_handles, handles, - on_get_contacts_cb, - NULL, NULL, G_OBJECT (self)); - - g_free (handles); -} - -static void -empathy_call_handler_constructed (GObject *object) -{ - EmpathyCallHandler *self = EMPATHY_CALL_HANDLER (object); - EmpathyCallHandlerPriv *priv = GET_PRIV (self); -// GHashTable *members; - - g_signal_connect (priv->call, "members-changed", - G_CALLBACK (on_members_changed_cb), object); - -/* FIXME - g_object_get (priv->call, "members", &members, NULL); - - if (members) - on_members_changed_cb (priv->call, members, self); -*/ -} - -static void empathy_call_handler_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { @@ -277,9 +185,6 @@ empathy_call_handler_set_property (GObject *object, case PROP_CONTACT: priv->contact = g_value_dup_object (value); break; - case PROP_MEMBERS: - priv->members = g_value_get_boxed (value); - break; case PROP_CALL_CHANNEL: g_return_if_fail (priv->call == NULL); @@ -312,9 +217,6 @@ empathy_call_handler_get_property (GObject *object, case PROP_CONTACT: g_value_set_object (value, priv->contact); break; - case PROP_MEMBERS: - g_value_set_boxed (value, priv->members); - break; case PROP_CALL_CHANNEL: g_value_set_object (value, priv->call); break; @@ -362,7 +264,6 @@ empathy_call_handler_class_init (EmpathyCallHandlerClass *klass) g_type_class_add_private (klass, sizeof (EmpathyCallHandlerPriv)); - object_class->constructed = empathy_call_handler_constructed; object_class->set_property = empathy_call_handler_set_property; object_class->get_property = empathy_call_handler_get_property; object_class->dispose = empathy_call_handler_dispose; @@ -374,15 +275,9 @@ empathy_call_handler_class_init (EmpathyCallHandlerClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTACT, param_spec); - param_spec = g_param_spec_boxed ("members", - "call members", "The call participants", - G_TYPE_ARRAY, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); - g_object_class_install_property (object_class, PROP_MEMBERS, param_spec); - param_spec = g_param_spec_object ("call-channel", "call channel", "The call channel", - TPY_TYPE_CALL_CHANNEL, + TP_TYPE_CALL_CHANNEL, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CALL_CHANNEL, param_spec); @@ -529,12 +424,12 @@ empathy_call_handler_class_init (EmpathyCallHandlerClass *klass) } EmpathyCallHandler * -empathy_call_handler_new_for_channel (TpyCallChannel *call, +empathy_call_handler_new_for_channel (TpCallChannel *call, EmpathyContact *contact) { return EMPATHY_CALL_HANDLER (g_object_new (EMPATHY_TYPE_CALL_HANDLER, "call-channel", call, - "initial-video", tpy_call_channel_has_initial_video (call), + "initial-video", tp_call_channel_has_initial_video (call, NULL), "target-contact", contact, NULL)); } @@ -748,8 +643,7 @@ src_pad_added_error_idle (gpointer data) { TfContent *content = data; - tf_content_error (content, 0 /* FIXME */, - "Could not link sink", NULL); + tf_content_error_literal (content, "Could not link sink"); g_object_unref (content); return FALSE; @@ -822,8 +716,7 @@ on_tf_channel_content_added_cb (TfChannel *tfchannel, content, &retval); if (!retval) - tf_content_error (content, 0 /* FIXME */, - "Could not link source", NULL); + tf_content_error_literal (content, "Could not link source"); /* Get sending codec */ g_object_get (content, "fs-session", &session, NULL); @@ -891,8 +784,7 @@ on_tf_channel_content_removed_cb (TfChannel *tfchannel, { g_warning ("Could not remove content!"); - tf_content_error (content, 0 /* FIXME */, - "Could not link source", NULL); + tf_content_error_literal (content, "Could not link source"); } } @@ -949,10 +841,10 @@ on_call_accepted_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { - TpyCallChannel *call = TPY_CALL_CHANNEL (source_object); + TpCallChannel *call = TP_CALL_CHANNEL (source_object); GError *error = NULL; - if (!tpy_call_channel_accept_finish (call, res, &error)) + if (!tp_call_channel_accept_finish (call, res, &error)) { g_warning ("could not accept Call: %s", error->message); g_error_free (error); @@ -979,13 +871,13 @@ empathy_call_handler_request_cb (GObject *source, return; } - if (!TPY_IS_CALL_CHANNEL (channel)) + if (!TP_IS_CALL_CHANNEL (channel)) { DEBUG ("The channel is not a Call channel!"); return; } - priv->call = TPY_CALL_CHANNEL (channel); + priv->call = TP_CALL_CHANNEL (channel); tp_g_signal_connect_object (priv->call, "state-changed", G_CALLBACK (on_call_state_changed_cb), self, 0); tp_g_signal_connect_object (priv->call, "invalidated", @@ -994,7 +886,7 @@ empathy_call_handler_request_cb (GObject *source, g_object_notify (G_OBJECT (self), "call-channel"); empathy_call_handler_start_tpfs (self); - tpy_call_channel_accept_async (priv->call, on_call_accepted_cb, NULL); + tp_call_channel_accept_async (priv->call, on_call_accepted_cb, NULL); } void @@ -1009,11 +901,11 @@ empathy_call_handler_start_call (EmpathyCallHandler *handler, if (priv->call != NULL) { empathy_call_handler_start_tpfs (handler); - tpy_call_channel_accept_async (priv->call, on_call_accepted_cb, NULL); + tp_call_channel_accept_async (priv->call, on_call_accepted_cb, NULL); return; } - /* No TpyCallChannel (we are redialing). Request a new call channel */ + /* No TpCallChannel (we are redialing). Request a new call channel */ g_assert (priv->contact != NULL); account = empathy_contact_get_account (priv->contact); @@ -1043,8 +935,8 @@ empathy_call_handler_stop_call (EmpathyCallHandler *handler) if (priv->call != NULL) { - tpy_call_channel_hangup_async (priv->call, - TPY_CALL_STATE_CHANGE_REASON_USER_REQUESTED, + tp_call_channel_hangup_async (priv->call, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "", NULL, NULL); tp_channel_close_async (TP_CHANNEL (priv->call), NULL, NULL); diff --git a/src/empathy-call-handler.h b/src/empathy-call-handler.h index 330d368a..3586f158 100644 --- a/src/empathy-call-handler.h +++ b/src/empathy-call-handler.h @@ -26,7 +26,7 @@ #include <gst/gst.h> #include <gst/farsight/fs-conference-iface.h> -#include <telepathy-yell/telepathy-yell.h> +#include <telepathy-glib/telepathy-glib.h> #include <libempathy/empathy-contact.h> @@ -68,7 +68,7 @@ EmpathyCallHandler * empathy_call_handler_new_for_contact ( EmpathyContact *contact); EmpathyCallHandler * empathy_call_handler_new_for_channel ( - TpyCallChannel *call, + TpCallChannel *call, EmpathyContact *contact); void empathy_call_handler_start_call (EmpathyCallHandler *handler, diff --git a/src/empathy-call-observer.c b/src/empathy-call-observer.c index 0fecbdca..2019cd02 100644 --- a/src/empathy-call-observer.c +++ b/src/empathy-call-observer.c @@ -24,8 +24,6 @@ #include <telepathy-glib/telepathy-glib.h> -#include <telepathy-yell/telepathy-yell.h> - #include <libnotify/notification.h> #include <libempathy/empathy-utils.h> @@ -185,7 +183,7 @@ find_main_channel (GList *channels) channel_type = tp_channel_get_channel_type_id (channel); if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA || - channel_type == TPY_IFACE_QUARK_CHANNEL_TYPE_CALL) + channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_CALL) return channel; } @@ -203,9 +201,9 @@ has_ongoing_calls (EmpathyCallObserver *self) GQuark type = tp_channel_get_channel_type_id (channel); /* Check that Call channels are not ended */ - if (type == TPY_IFACE_QUARK_CHANNEL_TYPE_CALL && - tpy_call_channel_get_state (TPY_CALL_CHANNEL (channel), NULL, NULL) - == TPY_CALL_STATE_ENDED) + if (type == TP_IFACE_QUARK_CHANNEL_TYPE_CALL && + tp_call_channel_get_state (TP_CALL_CHANNEL (channel), + NULL, NULL, NULL) == TP_CALL_STATE_ENDED) continue; return TRUE; @@ -372,7 +370,7 @@ empathy_call_observer_init (EmpathyCallObserver *self) tp_base_client_take_observer_filter (self->priv->observer, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TPY_IFACE_CHANNEL_TYPE_CALL, + TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL)); diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index a89d220c..1802b01a 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -53,6 +53,7 @@ #include <libempathy-gtk/empathy-sound-manager.h> #include <libempathy-gtk/empathy-geometry.h> #include <libempathy-gtk/empathy-images.h> +#include <libempathy-gtk/empathy-call-utils.h> #define DEBUG_FLAG EMPATHY_DEBUG_VOIP #include <libempathy/empathy-debug.h> @@ -194,7 +195,7 @@ struct _EmpathyCallWindowPriv /* These are used to accept or reject an incoming call when the status is RINGING. */ GtkWidget *incoming_call_dialog; - TpyCallChannel *pending_channel; + TpCallChannel *pending_channel; TpChannelDispatchOperation *pending_cdo; TpAddDispatchOperationContext *pending_context; @@ -1550,7 +1551,7 @@ empathy_call_window_set_state_ringing (EmpathyCallWindow *self) g_assert (self->priv->call_state != CONNECTED); - video = tpy_call_channel_has_initial_video (self->priv->pending_channel); + video = tp_call_channel_has_initial_video (self->priv->pending_channel, NULL); empathy_call_window_status_message (self, _("Incoming call")); self->priv->call_state = RINGING; @@ -1594,7 +1595,7 @@ empathy_call_window_cdo_invalidated_cb (TpProxy *channel, void empathy_call_window_start_ringing (EmpathyCallWindow *self, - TpyCallChannel *channel, + TpCallChannel *channel, TpChannelDispatchOperation *dispatch_operation, TpAddDispatchOperationContext *context) { @@ -2247,14 +2248,14 @@ empathy_call_window_constructed (GObject *object) { EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (object); EmpathyCallWindowPriv *priv = GET_PRIV (self); - TpyCallChannel *call; - TpyCallState state; + TpCallChannel *call; + TpCallState state; g_assert (priv->handler != NULL); g_object_get (priv->handler, "call-channel", &call, NULL); - state = tpy_call_channel_get_state (call, NULL, NULL); - priv->outgoing = (state == TPY_CALL_STATE_PENDING_INITIATOR); + state = tp_call_channel_get_state (call, NULL, NULL, NULL); + priv->outgoing = (state == TP_CALL_STATE_PENDING_INITIATOR); tp_clear_object (&call); g_object_get (priv->handler, "target-contact", &priv->contact, NULL); @@ -3055,7 +3056,7 @@ display_error (EmpathyCallWindow *self, #if 0 static gchar * media_stream_error_to_txt (EmpathyCallWindow *self, - TpyCallChannel *call, + TpCallChannel *call, gboolean audio, TpMediaStreamError error) { @@ -3127,7 +3128,7 @@ media_stream_error_to_txt (EmpathyCallWindow *self, static void empathy_call_window_stream_error (EmpathyCallWindow *self, - TpyCallChannel *call, + TpCallChannel *call, gboolean audio, guint code, const gchar *msg, @@ -3151,7 +3152,7 @@ empathy_call_window_stream_error (EmpathyCallWindow *self, } static void -empathy_call_window_audio_stream_error (TpyCallChannel *call, +empathy_call_window_audio_stream_error (TpCallChannel *call, guint code, const gchar *msg, EmpathyCallWindow *self) @@ -3161,7 +3162,7 @@ empathy_call_window_audio_stream_error (TpyCallChannel *call, } static void -empathy_call_window_video_stream_error (TpyCallChannel *call, +empathy_call_window_video_stream_error (TpCallChannel *call, guint code, const gchar *msg, EmpathyCallWindow *self) @@ -3220,22 +3221,22 @@ show_balance_error (EmpathyCallWindow *self) static void empathy_call_window_state_changed_cb (EmpathyCallHandler *handler, - TpyCallState state, + TpCallState state, gchar *reason, EmpathyCallWindow *self) { EmpathyCallWindowPriv *priv = GET_PRIV (self); - TpyCallChannel *call; + TpCallChannel *call; gboolean can_send_video; - if (state == TPY_CALL_STATE_ENDED && + if (state == TP_CALL_STATE_ENDED && !tp_strdiff (reason, TP_ERROR_STR_INSUFFICIENT_BALANCE)) { show_balance_error (self); return; } - if (state != TPY_CALL_STATE_ACCEPTED) + if (state != TP_CALL_STATE_ACCEPTED) return; if (priv->call_state == CONNECTED) @@ -3252,7 +3253,7 @@ empathy_call_window_state_changed_cb (EmpathyCallHandler *handler, g_object_get (priv->handler, "call-channel", &call, NULL); - if (tpy_call_channel_has_dtmf (call)) + if (tp_call_channel_has_dtmf (call)) gtk_widget_set_sensitive (priv->dtmf_panel, TRUE); if (priv->video_input == NULL) @@ -3597,20 +3598,20 @@ start_call (EmpathyCallWindow *self) if (empathy_call_handler_has_initial_video (priv->handler)) { - TpyCallChannel *call; - TpySendingState s; + TpCallChannel *call; + TpSendingState s; g_object_get (priv->handler, "call-channel", &call, NULL); /* If the call channel isn't set yet we're requesting it, if we're * requesting it with initial video it should be PENDING_SEND when we get * it */ if (call == NULL) - s = TPY_SENDING_STATE_PENDING_SEND; + s = TP_SENDING_STATE_PENDING_SEND; else - s = tpy_call_channel_get_video_state (call); + s = empathy_call_channel_get_video_state (call); - if (s == TPY_SENDING_STATE_PENDING_SEND || - s == TPY_SENDING_STATE_SENDING) + if (s == TP_SENDING_STATE_PENDING_SEND || + s == TP_SENDING_STATE_SENDING) { /* Enable 'send video' buttons and display the preview */ gtk_toggle_tool_button_set_active ( @@ -3726,8 +3727,10 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message, } static void -empathy_call_window_members_changed_cb (TpyCallChannel *call, - GHashTable *members, +empathy_call_window_members_changed_cb (TpCallChannel *call, + GHashTable *updates, + GPtrArray *removed, + TpCallStateReason *reason, EmpathyCallWindow *self) { EmpathyCallWindowPriv *priv = GET_PRIV (self); @@ -3735,10 +3738,10 @@ empathy_call_window_members_changed_cb (TpyCallChannel *call, gpointer key, value; gboolean held = FALSE; - g_hash_table_iter_init (&iter, members); + g_hash_table_iter_init (&iter, updates); while (g_hash_table_iter_next (&iter, &key, &value)) { - if (GPOINTER_TO_INT (value) & TPY_CALL_MEMBER_FLAG_HELD) + if (GPOINTER_TO_INT (value) & TP_CALL_MEMBER_FLAG_HELD) { /* This assumes this is a 1-1 call, otherwise one participant * putting the call on hold wouldn't mean the call is on hold @@ -3760,7 +3763,7 @@ call_handler_notify_call_cb (EmpathyCallHandler *handler, EmpathyCallWindow *self) { EmpathyCallWindowPriv *priv = GET_PRIV (self); - TpyCallChannel *call; + TpCallChannel *call; g_object_get (priv->handler, "call-channel", &call, NULL); if (call == NULL) @@ -3787,7 +3790,7 @@ static void empathy_call_window_connect_handler (EmpathyCallWindow *self) { EmpathyCallWindowPriv *priv = GET_PRIV (self); - TpyCallChannel *call; + TpCallChannel *call; g_signal_connect (priv->handler, "state-changed", G_CALLBACK (empathy_call_window_state_changed_cb), self); @@ -4000,7 +4003,7 @@ empathy_call_window_set_send_video (EmpathyCallWindow *window, CameraState state) { EmpathyCallWindowPriv *priv = GET_PRIV (window); - TpyCallChannel *call; + TpCallChannel *call; priv->sending_video = (state == CAMERA_STATE_ON); @@ -4020,7 +4023,7 @@ empathy_call_window_set_send_video (EmpathyCallWindow *window, g_object_get (priv->handler, "call-channel", &call, NULL); DEBUG ("%s sending video", priv->sending_video ? "start": "stop"); - tpy_call_channel_send_video (call, priv->sending_video); + empathy_call_channel_send_video (call, priv->sending_video); g_object_unref (call); } diff --git a/src/empathy-call-window.h b/src/empathy-call-window.h index abaae276..a5df2dac 100644 --- a/src/empathy-call-window.h +++ b/src/empathy-call-window.h @@ -66,7 +66,7 @@ EmpathyCallWindow *empathy_call_window_new (EmpathyCallHandler *handler); void empathy_call_window_present (EmpathyCallWindow *window, EmpathyCallHandler *handler); void empathy_call_window_start_ringing (EmpathyCallWindow *self, - TpyCallChannel *channel, + TpCallChannel *channel, TpChannelDispatchOperation *dispatch_operation, TpAddDispatchOperationContext *context); diff --git a/src/empathy-call.c b/src/empathy-call.c index 2ff49a81..21b751df 100644 --- a/src/empathy-call.c +++ b/src/empathy-call.c @@ -32,8 +32,6 @@ #include <telepathy-glib/debug-sender.h> -#include <telepathy-yell/telepathy-yell.h> - #include <libempathy/empathy-client-factory.h> #include <libempathy-gtk/empathy-ui-utils.h> @@ -87,7 +85,7 @@ find_window_for_handle (gpointer key, static gboolean incoming_call_cb (EmpathyCallFactory *factory, guint handle, - TpyCallChannel *channel, + TpCallChannel *channel, TpChannelDispatchOperation *dispatch_operation, TpAddDispatchOperationContext *context, gpointer user_data) @@ -209,8 +207,6 @@ main (int argc, g_option_context_free (optcontext); - tpy_cli_init (); - gtk_clutter_init (&argc, &argv); clutter_gst_init (&argc, &argv); diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index 321cd1cc..c6b3e29e 100644 --- a/src/empathy-event-manager.c +++ b/src/empathy-event-manager.c @@ -29,8 +29,6 @@ #include <telepathy-glib/interfaces.h> #include <telepathy-glib/simple-approver.h> -#include <telepathy-yell/telepathy-yell.h> - #include <libempathy/empathy-presence-manager.h> #include <libempathy/empathy-tp-contact-factory.h> #include <libempathy/empathy-connection-aggregator.h> @@ -45,6 +43,7 @@ #include <libempathy-gtk/empathy-contact-dialogs.h> #include <libempathy-gtk/empathy-sound-manager.h> #include <libempathy-gtk/empathy-ui-utils.h> +#include <libempathy-gtk/empathy-call-utils.h> #include "empathy-event-manager.h" #include "empathy-roster-window.h" @@ -413,10 +412,10 @@ reject_channel_claim_cb (GObject *source, { empathy_tp_streamed_media_close (user_data); } - else if (TPY_IS_CALL_CHANNEL (user_data)) + else if (TP_IS_CALL_CHANNEL (user_data)) { - tpy_call_channel_hangup_async (user_data, - TPY_CALL_STATE_CHANGE_REASON_USER_REQUESTED, + tp_call_channel_hangup_async (user_data, + TP_CALL_STATE_CHANGE_REASON_USER_REQUESTED, "", "", NULL, NULL); tp_channel_close_async (user_data, NULL, NULL); } @@ -474,7 +473,7 @@ event_manager_call_window_confirmation_dialog_response_cb (GtkDialog *dialog, } else if (response == ACCEPT_WITHOUT_VIDEO) { - tpy_call_channel_send_video (TPY_CALL_CHANNEL (approval->main_channel), + empathy_call_channel_send_video (TP_CALL_CHANNEL (approval->main_channel), FALSE); event_manager_approval_approve (approval); } @@ -508,9 +507,9 @@ event_channel_process_voip_func (EventPriv *event) } else if (etype == EMPATHY_EVENT_TYPE_CALL) { - TpyCallChannel *call; - call = TPY_CALL_CHANNEL (event->approval->handler_instance); - g_object_get (G_OBJECT (call), "initial-video", &video, NULL); + TpCallChannel *call; + call = TP_CALL_CHANNEL (event->approval->handler_instance); + video = tp_call_channel_has_initial_video (call, NULL); } else { @@ -638,7 +637,7 @@ event_manager_approval_done (EventManagerApproval *approval) channel_type = tp_channel_get_channel_type_id (approval->main_channel); if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA || - channel_type == TPY_IFACE_QUARK_CHANNEL_TYPE_CALL) + channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_CALL) { priv->ringing--; if (priv->ringing == 0) @@ -676,14 +675,14 @@ cdo_invalidated_cb (TpProxy *cdo, } static void -event_manager_call_state_changed_cb (TpyCallChannel *call, - TpyCallState state, - TpyCallFlags flags, - const GValueArray *call_state_reason, - GHashTable *call_state_details, +event_manager_call_state_changed_cb (TpCallChannel *call, + TpCallState state, + TpCallFlags flags, + TpCallStateReason *reason, + GHashTable *details, EventManagerApproval *approval) { - if (state == TPY_CALL_STATE_ENDED) + if (state == TP_CALL_STATE_ENDED) { DEBUG ("Call ended, seems we missed it :/"); reject_approval (approval); @@ -700,11 +699,11 @@ event_manager_call_channel_got_contact_cb (TpConnection *connection, EventManagerApproval *approval = (EventManagerApproval *) user_data; EmpathyEventManagerPriv *priv = GET_PRIV (approval->manager); GtkWidget *window; - TpyCallChannel *call; + TpCallChannel *call; gchar *header; gboolean video; - call = TPY_CALL_CHANNEL (approval->handler_instance); + call = TP_CALL_CHANNEL (approval->handler_instance); if (error != NULL) { @@ -713,7 +712,7 @@ event_manager_call_channel_got_contact_cb (TpConnection *connection, return; } - if (tpy_call_channel_get_state (call, NULL, NULL) == TPY_CALL_STATE_ENDED) + if (tp_call_channel_get_state (call, NULL, NULL, NULL) == TP_CALL_STATE_ENDED) { DEBUG ("Call already ended, seems we missed it :/"); reject_approval (approval); @@ -982,7 +981,7 @@ find_main_channel (GList *channels) channel_type = tp_channel_get_channel_type_id (channel); if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_STREAMED_MEDIA || - channel_type == TPY_IFACE_QUARK_CHANNEL_TYPE_CALL || + channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_CALL || channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_FILE_TRANSFER || channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_SERVER_AUTHENTICATION) return channel; @@ -1104,9 +1103,9 @@ approve_channels (TpSimpleApprover *approver, } } - else if (channel_type == TPY_IFACE_QUARK_CHANNEL_TYPE_CALL) + else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_CALL) { - TpyCallChannel *call = TPY_CALL_CHANNEL (channel); + TpCallChannel *call = TP_CALL_CHANNEL (channel); const gchar *id; approval->handler_instance = g_object_ref (call); @@ -1510,7 +1509,7 @@ empathy_event_manager_init (EmpathyEventManager *manager) tp_base_client_take_approver_filter (priv->approver, tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, - TPY_IFACE_CHANNEL_TYPE_CALL, + TP_IFACE_CHANNEL_TYPE_CALL, TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT, TP_HANDLE_TYPE_CONTACT, NULL)); diff --git a/src/empathy-notifications-approver.c b/src/empathy-notifications-approver.c index ac51459f..7a4f0373 100644 --- a/src/empathy-notifications-approver.c +++ b/src/empathy-notifications-approver.c @@ -25,11 +25,10 @@ #include <libnotify/notify.h> #include <telepathy-glib/telepathy-glib.h> -#include <telepathy-yell/telepathy-yell.h> - #include <libempathy/empathy-tp-streamed-media.h> #include <libempathy-gtk/empathy-notify-manager.h> +#include <libempathy-gtk/empathy-call-utils.h> #include "empathy-event-manager.h" @@ -127,8 +126,8 @@ notification_approve_no_video_cb (NotifyNotification *notification, { if (self->priv->event) { - tpy_call_channel_send_video ( - TPY_CALL_CHANNEL (self->priv->event->handler_instance), + empathy_call_channel_send_video ( + TP_CALL_CHANNEL (self->priv->event->handler_instance), FALSE); empathy_event_approve (self->priv->event); } @@ -197,8 +196,8 @@ add_notification_actions (EmpathyNotificationsApprover *self, video = empathy_tp_streamed_media_has_initial_video ( EMPATHY_TP_STREAMED_MEDIA (self->priv->event->handler_instance)); else - video = tpy_call_channel_has_initial_video ( - TPY_CALL_CHANNEL (self->priv->event->handler_instance)); + video = tp_call_channel_has_initial_video ( + TP_CALL_CHANNEL (self->priv->event->handler_instance), NULL); notify_notification_add_action (notification, "reject", _("Reject"), (NotifyActionCallback) notification_decline_cb, diff --git a/src/empathy.c b/src/empathy.c index f59a54f1..766ffaa2 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -44,8 +44,6 @@ #include <telepathy-glib/connection-manager.h> #include <telepathy-glib/interfaces.h> -#include <telepathy-yell/telepathy-yell.h> - #include <telepathy-logger/log-manager.h> #include <libempathy/empathy-client-factory.h> @@ -854,7 +852,6 @@ main (int argc, char *argv[]) #endif g_type_init (); - tpy_cli_init (); empathy_init (); gtk_init (&argc, &argv); empathy_gtk_init (); diff --git a/telepathy-yell b/telepathy-yell deleted file mode 160000 -Subproject ec9faee52bf288d811f51071e405153b1a5b5a6 |