]> git.0d.be Git - empathy.git/commitdiff
Merge remote-tracking branch 'origin/call1' into master+call
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 21 Feb 2012 07:26:19 +0000 (08:26 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 21 Feb 2012 07:26:19 +0000 (08:26 +0100)
Conflicts:
configure.ac
telepathy-yell

24 files changed:
.gitmodules [deleted file]
Makefile.am
autogen.sh
configure.ac
data/Empathy.Call.client
libempathy-gtk/empathy-call-utils.c
libempathy-gtk/empathy-call-utils.h
libempathy-gtk/empathy-log-window.c
libempathy-gtk/empathy-new-call-dialog.c
libempathy/Makefile.am
libempathy/empathy-client-factory.c
libempathy/empathy-contact.c
src/Makefile.am
src/empathy-call-factory.c
src/empathy-call-handler.c
src/empathy-call-handler.h
src/empathy-call-observer.c
src/empathy-call-window.c
src/empathy-call-window.h
src/empathy-call.c
src/empathy-event-manager.c
src/empathy-notifications-approver.c
src/empathy.c
telepathy-yell [deleted submodule]

diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644 (file)
index a61f973..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "telepathy-yell"]
-       path = telepathy-yell
-       url = git://anongit.freedesktop.org/telepathy/telepathy-yell.git
index f86a3a46f078ebe64ed36e7913dca6340fa9bdd0..1a3a118b5aa7a2164d730d660e565d3bdc392023 100644 (file)
@@ -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
 
index 7c73adb9fbbc51328780cc6ca7deb1a67b7243da..2753d641cd2f4b1a0e0b498b788f0e63365a1869 100755 (executable)
@@ -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
index 32459f5432914cac8f7d669f56b457f29294c033..68e50444b612d4b496b9980506a2e485f76b1133 100644 (file)
@@ -74,15 +74,6 @@ AC_DEFINE(GLIB_DISABLE_DEPRECATION_WARNINGS, 1, [Build with GLib deprecated])
 # FIXME: bgo #669673
 AC_DEFINE(CLUTTER_DISABLE_DEPRECATION_WARNINGS, 1, [Build with Clutter 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])
@@ -206,8 +197,6 @@ PKG_CHECK_MODULES(EMPATHY,
    libsoup-2.4
 ])
 
-PKG_CHECK_MODULES(YELL, [telepathy-yell])
-
 PKG_CHECK_MODULES(EMPATHY_AV,
 [
    farsight2-0.10
@@ -227,8 +216,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
index 259025d869bd0a48f6d6fc8e09ed6c19397ca4ba..468a99625c0ab65ec6ee28c1f7ecf42a54f1db0d 100644 (file)
@@ -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
index 16526d3544d4e5b6aa945703d257fe9da099605c..c2363c419d773ef55735b6409fc1b8c79311ac44 100644 (file)
@@ -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;
+}
index 8361031002ac3b5df5d3195daae582601bb48b9a..99e4ecf9116b9881658701041e2cc457f94eb5a9 100644 (file)
@@ -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__ */
index 51a47c7a39b527246d2e777857db931796b3e69c..13fdefbd576ef7f5d47b5ba9d9ac01e1e96efd1c 100644 (file)
@@ -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);
index 0fecedde5c45682c15d20016e40b3a40aa5c3619..ba44721d3a1b52f02ebf3f8327ca29bacc52221d 100644 (file)
@@ -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>
index 6a6e2ce7e517ddf3bb44b92896c0ba96dd66cdb0..cc288bfa853edee3d2732ce3bad1f1e1c754553f 100644 (file)
@@ -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)                       \
@@ -149,7 +148,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) \
index 294eaf5ff43cc41b7144c014e927c01dc1213fbd..2a85594410daeae3c557fceda61484c3e4410193 100644 (file)
 #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);
 }
index c947fad6295d10e85006c93ef0c64363317bdfe0..b8d2f3c401f12dbb2e4195ee1e6f3a19ca527712 100644 (file)
@@ -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;
             }
         }
index 8623ac2dda0074f68681a07fbe36758b717aaac8..a2aa31d5b53db43d427e628b64f2169e4368234f 100644 (file)
@@ -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)
 
index b3c85f4b045e665c9813f8f0cceacd3749311103..4ff8ebe517ca8174ccaf7c35c05fcc78f8f544fd 100644 (file)
@@ -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);
 }
@@ -188,66 +186,6 @@ empathy_call_factory_get (void)
   return EMPATHY_CALL_FACTORY (call_factory);
 }
 
-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,
@@ -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;
index 4014ad6c663aca92935cab37deff9db77ed861bb..3389c83747685978bddd74725f69a58f35e51bd4 100644 (file)
@@ -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;
@@ -96,6 +91,7 @@ struct _EmpathyCallHandlerPriv {
   FsCandidate *video_remote_candidate;
   FsCandidate *audio_local_candidate;
   FsCandidate *video_local_candidate;
+  gboolean accept_when_initialised;
 };
 
 #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyCallHandler)
@@ -109,8 +105,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 +135,22 @@ 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)
+on_call_accepted_cb (GObject *source_object,
+    GAsyncResult *res,
+    gpointer user_data)
 {
-  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);
+  TpCallChannel *call = TP_CALL_CHANNEL (source_object);
+  GError *error = NULL;
 
-  g_object_notify (G_OBJECT (self), "members");
+  if (!tp_call_channel_accept_finish (call, res, &error))
+    {
+      g_warning ("could not accept Call: %s", error->message);
+      g_error_free (error);
+    }
 }
 
 static void
-on_call_invalidated_cb (TpyCallChannel *call,
+on_call_invalidated_cb (TpCallChannel *call,
     guint domain,
     gint code,
     gchar *message,
@@ -182,90 +162,42 @@ 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);
+      priv->accept_when_initialised = FALSE;
       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,
+      reason->dbus_reason);
 
-  g_signal_emit (handler, signals[STATE_CHANGED], 0, state, dbus_reason);
+  if (state == TP_CALL_STATE_INITIALISED &&
+      priv->accept_when_initialised)
+    {
+      tp_call_channel_accept_async (priv->call, on_call_accepted_cb, NULL);
+      priv->accept_when_initialised = FALSE;
+    }
 
-  if (state == TPY_CALL_STATE_ENDED)
+  if (state == TP_CALL_STATE_ENDED)
     {
       tp_channel_close_async (TP_CHANNEL (call), NULL, NULL);
-
+      priv->accept_when_initialised = FALSE;
       tp_clear_object (&priv->call);
       tp_clear_object (&priv->tfchannel);
     }
 }
 
-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 +209,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 +241,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 +288,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 +299,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 +448,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 +667,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 +740,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 +808,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");
     }
 }
 
@@ -944,21 +860,6 @@ empathy_call_handler_start_tpfs (EmpathyCallHandler *self)
       on_tf_channel_ready, self);
 }
 
-static void
-on_call_accepted_cb (GObject *source_object,
-    GAsyncResult *res,
-    gpointer user_data)
-{
-  TpyCallChannel *call = TPY_CALL_CHANNEL (source_object);
-  GError *error = NULL;
-
-  if (!tpy_call_channel_accept_finish (call, res, &error))
-    {
-      g_warning ("could not accept Call: %s", error->message);
-      g_error_free (error);
-    }
-}
-
 static void
 empathy_call_handler_request_cb (GObject *source,
     GAsyncResult *result,
@@ -979,13 +880,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 +895,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 +910,28 @@ 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);
+
+      if (tp_channel_get_requested (TP_CHANNEL (priv->call)))
+        {
+          /* accept outgoing channels immediately */
+          tp_call_channel_accept_async (priv->call,
+              on_call_accepted_cb, NULL);
+        }
+      else
+        {
+          /* accepting incoming channels when they are INITIALISED */
+          if (tp_call_channel_get_state (priv->call, NULL, NULL, NULL) ==
+              TP_CALL_STATE_INITIALISED)
+            tp_call_channel_accept_async (priv->call,
+                on_call_accepted_cb, NULL);
+          else
+            priv->accept_when_initialised = TRUE;
+        }
+
       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,13 +961,9 @@ 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);
-      tp_clear_object (&priv->call);
-      tp_clear_object (&priv->tfchannel);
     }
 }
 
index 330d368a5b2da0c19a798131d0dac250b36067a8..3586f15847d4554331b07d1d6ea4c849bbe43d0c 100644 (file)
@@ -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,
index 0fecbdca614f2b011f083ae12991ff02efb86e1e..2019cd02f60433cc3df53bc9db78d00f3b4ba8f4 100644 (file)
@@ -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));
index 451722839ae57f471c029de1ccac0086174e0d78..51732e0243ffa85983513f348941dc418d087c8c 100644 (file)
@@ -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,17 +195,13 @@ 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;
 
   gulong video_output_motion_handler_id;
   guint bus_message_source_id;
 
-  /* String that contains the queued tones to send after the current ones
-     are sent */
-  GString *tones;
-  gboolean sending_tones;
   GtkWidget *dtmf_panel;
 
   /* Details vbox */
@@ -346,61 +343,21 @@ empathy_call_window_video_call_cb (GtkToggleToolButton *button,
   empathy_call_window_restart_call (self);
 }
 
-static void
-empathy_call_window_emit_tones (EmpathyCallWindow *self)
-{
-  TpChannel *channel;
-
-  if (tp_str_empty (self->priv->tones->str))
-    return;
-
-  g_object_get (self->priv->handler, "call-channel", &channel, NULL);
-
-  DEBUG ("Emitting multiple tones: %s", self->priv->tones->str);
-
-  tp_cli_channel_interface_dtmf_call_multiple_tones (channel, -1,
-      self->priv->tones->str,
-      NULL, NULL, NULL, NULL);
-
-  self->priv->sending_tones = TRUE;
-
-  g_string_set_size (self->priv->tones, 0);
-
-  g_object_unref (channel);
-}
-
-static void
-empathy_call_window_maybe_emit_tones (EmpathyCallWindow *self)
-{
-  if (self->priv->sending_tones)
-    return;
-
-  empathy_call_window_emit_tones (self);
-}
-
-static void
-empathy_call_window_tones_stopped_cb (TpChannel *proxy,
-    gboolean arg_cancelled,
-    gpointer user_data,
-    GObject *weak_object)
-{
-  EmpathyCallWindow *self = EMPATHY_CALL_WINDOW (user_data);
-
-  self->priv->sending_tones = FALSE;
-
-  empathy_call_window_emit_tones (self);
-}
-
 static void
 dtmf_start_tone_cb (EmpathyDialpadWidget *dialpad,
     TpDTMFEvent event,
     EmpathyCallWindow *self)
 {
-  EmpathyCallWindowPriv *priv = GET_PRIV (self);
+  TpCallChannel *call;
+  gchar tones[2];
 
-  g_string_append_c (priv->tones, tp_dtmf_event_to_char (event));
+  g_object_get (self->priv->handler, "call-channel", &call, NULL);
 
-  empathy_call_window_maybe_emit_tones (self);
+  tones[0] = tp_dtmf_event_to_char (event);
+  tones[1] = '\0';
+  tp_call_channel_send_tones_async (call, tones, NULL, NULL, NULL);
+
+  g_object_unref (call);
 }
 
 static void
@@ -1557,7 +1514,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;
@@ -1601,7 +1558,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)
 {
@@ -1825,8 +1782,6 @@ empathy_call_window_init (EmpathyCallWindow *self)
   g_signal_connect (priv->dtmf_panel, "start-tone",
       G_CALLBACK (dtmf_start_tone_cb), self);
 
-  priv->tones = g_string_new ("");
-
   gtk_box_pack_start (GTK_BOX (priv->pane), priv->dtmf_panel,
       FALSE, FALSE, 6);
 
@@ -2254,14 +2209,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);
@@ -2451,8 +2406,6 @@ empathy_call_window_finalize (GObject *object)
 
   g_timer_destroy (priv->timer);
 
-  g_string_free (priv->tones, TRUE);
-
   G_OBJECT_CLASS (empathy_call_window_parent_class)->finalize (object);
 }
 
@@ -2604,9 +2557,6 @@ empathy_call_window_disconnected (EmpathyCallWindow *self,
   gtk_action_set_sensitive (priv->menu_fullscreen, FALSE);
   gtk_widget_set_sensitive (priv->dtmf_panel, FALSE);
 
-  priv->sending_tones = FALSE;
-  g_string_set_size (priv->tones, 0);
-
   could_reset_pipeline = empathy_call_window_reset_pipeline (self);
 
   if (priv->call_state == CONNECTING)
@@ -3062,7 +3012,7 @@ display_error (EmpathyCallWindow *self,
 #if 0
 static gchar *
 media_stream_error_to_txt (EmpathyCallWindow *self,
-    TpyCallChannel *call,
+    TpCallChannel *call,
     gboolean audio,
     TpMediaStreamError error)
 {
@@ -3134,7 +3084,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,
@@ -3158,7 +3108,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)
@@ -3168,7 +3118,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)
@@ -3227,22 +3177,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)
@@ -3259,7 +3209,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)
@@ -3604,20 +3554,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 (
@@ -3733,8 +3683,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);
@@ -3742,10 +3694,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
@@ -3767,7 +3719,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)
@@ -3783,10 +3735,6 @@ call_handler_notify_call_cb (EmpathyCallHandler *handler,
   tp_g_signal_connect_object (call, "members-changed",
       G_CALLBACK (empathy_call_window_members_changed_cb), self, 0);
 
-  tp_cli_channel_interface_dtmf_connect_to_stopped_tones (TP_CHANNEL (call),
-      empathy_call_window_tones_stopped_cb, self, NULL,
-      G_OBJECT (call), NULL);
-
   g_object_unref (call);
 }
 
@@ -3794,7 +3742,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);
@@ -4007,7 +3955,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);
 
@@ -4027,7 +3975,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);
 }
 
index abaae276308b0ea126a1db4bb5996d822f8ea791..a5df2dac4ffc5d55f76feb7a1b3fd7f3cf106225 100644 (file)
@@ -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);
 
index 71d9db707ec3869ba00b0d827556baa8a4739d94..5f45d1ee566b142b3f7df5faa03851179bbd9d0e 100644 (file)
@@ -36,8 +36,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>
@@ -91,7 +89,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)
@@ -219,8 +217,6 @@ main (int argc,
 
   g_option_context_free (optcontext);
 
-  tpy_cli_init ();
-
   gtk_clutter_init (&argc, &argv);
   clutter_gst_init (&argc, &argv);
 
index 321cd1cca1de9b48f7ff23f6e5d138a0dc53fef9..c6b3e29edfd64117e08f16816d616cdd92782493 100644 (file)
@@ -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));
 
index ac51459fb76eb8db1a1abd7bf93d1f0137a2162c..7a4f03731b256a5a592c29e6c1a15ec793fb7fa1 100644 (file)
 #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,
index f59a54f17f7c559ec41512f87077c5a5b95e5ee4..766ffaa2c7229dc34d9d88ee51de01d3b4e9d5f4 100644 (file)
@@ -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 (submodule)
index 32775ef..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 32775ef66842c5c1ff939e35a0870f82d692b556