aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-09 20:53:08 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-08-11 18:27:57 +0800
commit17810b94827e9103136ea2cf9192629eebe689b0 (patch)
tree9eb9d0e20609f23e57a16764e49beb34c9763544
parent617ccb69392445c4843b879ddc997885df81e8f8 (diff)
downloadgsoc2013-empathy-17810b94827e9103136ea2cf9192629eebe689b0.tar
gsoc2013-empathy-17810b94827e9103136ea2cf9192629eebe689b0.tar.gz
gsoc2013-empathy-17810b94827e9103136ea2cf9192629eebe689b0.tar.bz2
gsoc2013-empathy-17810b94827e9103136ea2cf9192629eebe689b0.tar.lz
gsoc2013-empathy-17810b94827e9103136ea2cf9192629eebe689b0.tar.xz
gsoc2013-empathy-17810b94827e9103136ea2cf9192629eebe689b0.tar.zst
gsoc2013-empathy-17810b94827e9103136ea2cf9192629eebe689b0.zip
factor out empathy_call_factory_create_request
-rw-r--r--libempathy/empathy-call-factory.c31
-rw-r--r--libempathy/empathy-call-factory.h4
2 files changed, 24 insertions, 11 deletions
diff --git a/libempathy/empathy-call-factory.c b/libempathy/empathy-call-factory.c
index 0021b3905..8d46310be 100644
--- a/libempathy/empathy-call-factory.c
+++ b/libempathy/empathy-call-factory.c
@@ -188,6 +188,24 @@ empathy_call_factory_get (void)
return EMPATHY_CALL_FACTORY (call_factory);
}
+GHashTable *
+empathy_call_factory_create_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);
+}
+
/**
* empathy_call_factory_new_call_with_streams:
* @factory: an #EmpathyCallFactory
@@ -208,17 +226,8 @@ empathy_call_factory_new_call_with_streams (EmpathyContact *contact,
EmpathyDispatcher *dispatcher;
GHashTable *request;
- request = 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);
+ request = empathy_call_factory_create_request (contact, initial_audio,
+ initial_video);
dispatcher = empathy_dispatcher_dup_singleton ();
diff --git a/libempathy/empathy-call-factory.h b/libempathy/empathy-call-factory.h
index abd8c92dc..aa2175a2d 100644
--- a/libempathy/empathy-call-factory.h
+++ b/libempathy/empathy-call-factory.h
@@ -75,6 +75,10 @@ void empathy_call_factory_new_call_with_streams (EmpathyContact *contact,
gboolean empathy_call_factory_register (EmpathyCallFactory *self,
GError **error);
+GHashTable * empathy_call_factory_create_request (EmpathyContact *contact,
+ gboolean initial_audio,
+ gboolean initial_video);
+
G_END_DECLS
#endif /* #ifndef __EMPATHY_CALL_FACTORY_H__*/