aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-01-10 00:14:14 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-10 00:14:14 +0800
commitfee082df8617a9e878750bcd964940130dc5ff2a (patch)
tree31110df279ce7e527806bb5815aa57d8f4aec72e
parenta225d6d620e17306dbc5c1e7b7b886046e24c9db (diff)
downloadgsoc2013-empathy-fee082df8617a9e878750bcd964940130dc5ff2a.tar
gsoc2013-empathy-fee082df8617a9e878750bcd964940130dc5ff2a.tar.gz
gsoc2013-empathy-fee082df8617a9e878750bcd964940130dc5ff2a.tar.bz2
gsoc2013-empathy-fee082df8617a9e878750bcd964940130dc5ff2a.tar.lz
gsoc2013-empathy-fee082df8617a9e878750bcd964940130dc5ff2a.tar.xz
gsoc2013-empathy-fee082df8617a9e878750bcd964940130dc5ff2a.tar.zst
gsoc2013-empathy-fee082df8617a9e878750bcd964940130dc5ff2a.zip
Add a utility function to start a call to a contact
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> svn path=/trunk/; revision=2166
-rw-r--r--libempathy/empathy-utils.c36
-rw-r--r--libempathy/empathy-utils.h4
2 files changed, 40 insertions, 0 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 87e593a85..754526608 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -39,6 +39,9 @@
#include "empathy-utils.h"
#include "empathy-contact-factory.h"
#include "empathy-contact-manager.h"
+#include "empathy-dispatcher.h"
+#include "empathy-dispatch-operation.h"
+#include "empathy-tp-call.h"
#include <extensions/extensions.h>
@@ -448,3 +451,36 @@ empathy_proxy_equal (gconstpointer a,
return g_str_equal (proxy_a->object_path, proxy_b->object_path) &&
g_str_equal (proxy_a->bus_name, proxy_b->bus_name);
}
+
+static void
+empathy_call_request_cb (EmpathyDispatchOperation *operation,
+ const GError *error, gpointer user_data)
+{
+ EmpathyContact *contact = EMPATHY_CONTACT (user_data);
+
+ if (error != NULL)
+ {
+ DEBUG ("Failed to request streamed media channel %s",
+ error->message);
+ }
+ else
+ {
+ EmpathyTpCall *call =
+ EMPATHY_TP_CALL (
+ empathy_dispatch_operation_get_channel_wrapper (operation));
+
+ empathy_tp_call_to (call, contact);
+
+ g_object_unref (call);
+ }
+
+ g_object_unref (contact);
+}
+
+void
+empathy_start_call_with_contact (EmpathyContact *contact)
+{
+ g_object_ref (contact);
+ empathy_dispatcher_call_with_contact (contact, empathy_call_request_cb,
+ contact);
+}
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index bfd8ce853..b51a19614 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -88,6 +88,10 @@ gboolean empathy_proxy_equal (gconstpointer a,
gconstpointer b);
guint empathy_proxy_hash (gconstpointer key);
+/* Temporary utility function, should be replaces by better voip infrastructure
+ * soon */
+void empathy_start_call_with_contact (EmpathyContact *contact);
+
G_END_DECLS
#endif /* __EMPATHY_UTILS_H__ */