[empathy/gnome-2-34] Teach EmpathyChannelFactory how to create Call channels



commit f44380b57b8f1bdfe4b2de41445d21fe99f85c92
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Fri Feb 18 16:31:35 2011 +0000

    Teach EmpathyChannelFactory how to create Call channels

 libempathy/Makefile.am               |    2 ++
 libempathy/empathy-channel-factory.c |   17 +++++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/libempathy/Makefile.am b/libempathy/Makefile.am
index 5336064..c184fde 100644
--- a/libempathy/Makefile.am
+++ b/libempathy/Makefile.am
@@ -9,6 +9,7 @@ AM_CPPFLAGS =                                           \
 	-DLOCALEDIR=\""$(datadir)/locale"\"		\
 	-DG_LOG_DOMAIN=\"empathy\"			\
 	$(EMPATHY_CFLAGS)				\
+	$(YELL_CFLAGS)					\
 	$(GEOCLUE_CFLAGS)				\
 	$(NETWORK_MANAGER_CFLAGS)			\
 	$(CONNMAN_CFLAGS)				\
@@ -109,6 +110,7 @@ nodist_libempathy_la_SOURCES =\
 libempathy_la_LIBADD =		\
 	$(top_builddir)/extensions/libemp-extensions.la \
 	$(EMPATHY_LIBS) \
+	$(YELL_LIBS) \
 	$(GEOCLUE_LIBS) \
 	$(NETWORK_MANAGER_LIBS) \
 	$(CONNMAN_LIBS)
diff --git a/libempathy/empathy-channel-factory.c b/libempathy/empathy-channel-factory.c
index bbe0cb0..87cdf7a 100644
--- a/libempathy/empathy-channel-factory.c
+++ b/libempathy/empathy-channel-factory.c
@@ -19,10 +19,16 @@
  * Authors: Guillaume Desmottes <guillaume desmottes collabora co uk>
  */
 
+#include <config.h>
+
 #include "empathy-channel-factory.h"
 
 #include <telepathy-glib/telepathy-glib.h>
 
+#if HAVE_CALL
+ #include <telepathy-yell/telepathy-yell.h>
+#endif
+
 static void factory_iface_init (gpointer, gpointer);
 
 G_DEFINE_TYPE_WITH_CODE (EmpathyChannelFactory, empathy_channel_factory,
@@ -98,6 +104,17 @@ empathy_channel_factory_create_channel (
     GError **error)
 {
   EmpathyChannelFactory *self = (EmpathyChannelFactory *) factory;
+  const gchar *chan_type;
+
+  chan_type = tp_asv_get_string (properties, TP_PROP_CHANNEL_CHANNEL_TYPE);
+
+#if HAVE_CALL
+  if (!tp_strdiff (chan_type, TPY_IFACE_CHANNEL_TYPE_CALL))
+    {
+      return TP_CHANNEL (tpy_call_channel_new (conn, path, properties,
+            error));
+    }
+#endif
 
   return tp_client_channel_factory_create_channel (
       self->priv->automatic_factory, conn, path, properties, error);



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