aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-09 17:28:44 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-09 17:28:44 +0800
commit8944f13286ba5293781f2d57980da284cb2aa29d (patch)
tree91aa682420a072399f03ac7fb456f62c13064add /libempathy
parent981a1377f660a9d1e3660dc66613b993b78486fc (diff)
parent3f52e59aa058c16a9ba115398681a16b1e289cd1 (diff)
downloadgsoc2013-empathy-8944f13286ba5293781f2d57980da284cb2aa29d.tar
gsoc2013-empathy-8944f13286ba5293781f2d57980da284cb2aa29d.tar.gz
gsoc2013-empathy-8944f13286ba5293781f2d57980da284cb2aa29d.tar.bz2
gsoc2013-empathy-8944f13286ba5293781f2d57980da284cb2aa29d.tar.lz
gsoc2013-empathy-8944f13286ba5293781f2d57980da284cb2aa29d.tar.xz
gsoc2013-empathy-8944f13286ba5293781f2d57980da284cb2aa29d.tar.zst
gsoc2013-empathy-8944f13286ba5293781f2d57980da284cb2aa29d.zip
Merge branch 'call'
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/Makefile.am10
-rw-r--r--libempathy/empathy-channel-factory.c9
-rw-r--r--libempathy/empathy-contact.c24
-rw-r--r--libempathy/empathy-request-util.h3
-rw-r--r--libempathy/empathy-utils.c59
-rw-r--r--libempathy/empathy-utils.h9
6 files changed, 42 insertions, 72 deletions
diff --git a/libempathy/Makefile.am b/libempathy/Makefile.am
index 41cec88fd..48846311f 100644
--- a/libempathy/Makefile.am
+++ b/libempathy/Makefile.am
@@ -10,6 +10,7 @@ AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"empathy\" \
-DGCR_API_SUBJECT_TO_CHANGE \
$(EMPATHY_CFLAGS) \
+ $(YELL_CFLAGS) \
$(GEOCLUE_CFLAGS) \
$(GEOCODE_CFLAGS) \
$(NETWORK_MANAGER_CFLAGS) \
@@ -110,6 +111,7 @@ 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) \
@@ -134,12 +136,12 @@ empathy-marshal.list: $(libempathy_la_SOURCES) Makefile.am
mv $@.tmp $@; \
fi
-%-marshal.h: %-marshal.list Makefile
- $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_$(subst -,_,$*)_marshal $< > $*-marshal.h
+empathy-marshal.h: empathy-marshal.list Makefile
+ $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_empathy_marshal $< > empathy-marshal.h
-%-marshal.c: %-marshal.list Makefile
+empathy-marshal.c: empathy-marshal.list Makefile
$(AM_V_GEN)echo "#include \"empathy-marshal.h\"" > $@ && \
- $(GLIB_GENMARSHAL) --body --prefix=_$(subst -,_,$*)_marshal $< >> $*-marshal.c
+ $(GLIB_GENMARSHAL) --body --prefix=_empathy_marshal $< >> empathy-marshal.c
empathy-enum-types.h: stamp-empathy-enum-types.h
$(AM_V_GEN)true
diff --git a/libempathy/empathy-channel-factory.c b/libempathy/empathy-channel-factory.c
index d1da3047d..d8b1cd941 100644
--- a/libempathy/empathy-channel-factory.c
+++ b/libempathy/empathy-channel-factory.c
@@ -19,6 +19,8 @@
* Authors: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
*/
+#include <config.h>
+
#include "empathy-channel-factory.h"
#include "empathy-tp-chat.h"
@@ -26,6 +28,8 @@
#include <telepathy-glib/telepathy-glib.h>
+#include <telepathy-yell/telepathy-yell.h>
+
static void factory_iface_init (gpointer, gpointer);
G_DEFINE_TYPE_WITH_CODE (EmpathyChannelFactory, empathy_channel_factory,
@@ -113,6 +117,11 @@ empathy_channel_factory_create_channel (
return TP_CHANNEL (empathy_tp_chat_new (account, conn, path, properties));
}
+ else if (!tp_strdiff (chan_type, TPY_IFACE_CHANNEL_TYPE_CALL))
+ {
+ return TP_CHANNEL (tpy_call_channel_new (conn, path, properties,
+ error));
+ }
return tp_client_channel_factory_create_channel (
self->priv->automatic_factory, conn, path, properties, error);
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index a90b20ece..55bc40bdd 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -28,6 +28,7 @@
#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>
@@ -1660,6 +1661,29 @@ 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))
+ {
+ guint j;
+
+ if (tp_asv_get_boolean (fixed_prop,
+ TPY_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))
+ 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))
+ capabilities |= EMPATHY_CAPABILITIES_AUDIO;
+ else if (!tp_strdiff (allowed_prop[j],
+ TPY_PROP_CHANNEL_TYPE_CALL_INITIAL_VIDEO))
+ capabilities |= EMPATHY_CAPABILITIES_VIDEO;
+ }
+ }
}
return capabilities;
diff --git a/libempathy/empathy-request-util.h b/libempathy/empathy-request-util.h
index 49b98a433..70a607e73 100644
--- a/libempathy/empathy-request-util.h
+++ b/libempathy/empathy-request-util.h
@@ -36,6 +36,9 @@ G_BEGIN_DECLS
#define EMPATHY_AV_BUS_NAME_SUFFIX "Empathy.AudioVideo"
#define EMPATHY_AV_BUS_NAME TP_CLIENT_BUS_NAME_BASE EMPATHY_AV_BUS_NAME_SUFFIX
+#define EMPATHY_CALL_BUS_NAME_SUFFIX "Empathy.Call"
+#define EMPATHY_CALL_BUS_NAME TP_CLIENT_BUS_NAME_BASE EMPATHY_CALL_BUS_NAME_SUFFIX
+
#define EMPATHY_FT_BUS_NAME_SUFFIX "Empathy.FileTransfer"
#define EMPATHY_FT_BUS_NAME TP_CLIENT_BUS_NAME_BASE EMPATHY_FT_BUS_NAME_SUFFIX
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 4d6506b6e..d35f4bced 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -238,65 +238,6 @@ empathy_xml_node_find_child_prop_value (xmlNodePtr node,
return found;
}
-GHashTable *
-empathy_call_create_streamed_media_request (EmpathyContact *contact,
- gboolean initial_audio,
- gboolean initial_video)
-{
- return tp_asv_new (
- TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING,
- TP_IFACE_CHANNEL_TYPE_STREAMED_MEDIA,
- TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, G_TYPE_UINT,
- TP_HANDLE_TYPE_CONTACT,
- TP_PROP_CHANNEL_TARGET_HANDLE, G_TYPE_UINT,
- empathy_contact_get_handle (contact),
- TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_AUDIO, G_TYPE_BOOLEAN,
- initial_audio,
- TP_PROP_CHANNEL_TYPE_STREAMED_MEDIA_INITIAL_VIDEO, G_TYPE_BOOLEAN,
- initial_video,
- NULL);
-}
-
-static void
-create_media_channel_cb (GObject *source,
- GAsyncResult *result,
- gpointer user_data)
-{
- GError *error = NULL;
-
- if (!tp_account_channel_request_create_channel_finish (TP_ACCOUNT_CHANNEL_REQUEST (source),
- result,
- &error)) {
- DEBUG ("Failed to create StreamedMedia channel: %s", error->message);
- g_error_free (error);
- }
-}
-
-void
-empathy_call_new_with_streams (EmpathyContact *contact,
- gboolean initial_audio,
- gboolean initial_video,
- gint64 timestamp)
-{
- GHashTable *request;
- TpAccount *account;
- TpAccountChannelRequest *req;
-
- request = empathy_call_create_streamed_media_request (contact,
- initial_audio,
- initial_video);
-
- account = empathy_contact_get_account (contact);
-
- req = tp_account_channel_request_new (account, request, timestamp);
-
- tp_account_channel_request_create_channel_async (req, EMPATHY_AV_BUS_NAME,
- NULL, create_media_channel_cb, NULL);
-
- g_hash_table_unref (request);
- g_object_unref (req);
-}
-
const gchar *
empathy_presence_get_default_message (TpConnectionPresenceType presence)
{
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index 157569453..9a2f3b924 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -66,15 +66,6 @@ xmlNodePtr empathy_xml_node_find_child_prop_value (xmlNodePtr node,
const gchar *prop_name,
const gchar *prop_value);
-/* Calls */
-void empathy_call_new_with_streams (EmpathyContact *contact,
- gboolean initial_audio,
- gboolean initial_video,
- gint64 timestamp);
-GHashTable * empathy_call_create_streamed_media_request (EmpathyContact *contact,
- gboolean initial_audio,
- gboolean initial_video);
-
/* Others */
const gchar * empathy_presence_get_default_message (TpConnectionPresenceType presence);
const gchar * empathy_presence_to_str (TpConnectionPresenceType presence);