From f44380b57b8f1bdfe4b2de41445d21fe99f85c92 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Fri, 18 Feb 2011 16:31:35 +0000 Subject: Teach EmpathyChannelFactory how to create Call channels --- libempathy/Makefile.am | 2 ++ libempathy/empathy-channel-factory.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/libempathy/Makefile.am b/libempathy/Makefile.am index 5336064d1..c184fde44 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 bbe0cb0ba..87cdf7af7 100644 --- a/libempathy/empathy-channel-factory.c +++ b/libempathy/empathy-channel-factory.c @@ -19,10 +19,16 @@ * Authors: Guillaume Desmottes */ +#include + #include "empathy-channel-factory.h" #include +#if HAVE_CALL + #include +#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); -- cgit v1.2.3