diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-06-22 17:25:01 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-06-22 17:59:33 +0800 |
commit | 2064d5324ec602a7a6c2e9e63d5b406e5228824c (patch) | |
tree | 37f6f9b12da536062a888570ee0d5df42885bd2e /libempathy-gtk | |
parent | 57459c6892de159e92a90231e8c10e63c566ac32 (diff) | |
download | gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.tar gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.tar.gz gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.tar.bz2 gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.tar.lz gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.tar.xz gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.tar.zst gsoc2013-empathy-2064d5324ec602a7a6c2e9e63d5b406e5228824c.zip |
empathy_call_factory_new_call_with_streams: request channel using the CD
Also allow caller to pass the timestamp and an optionnal callback.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-contact-menu.c | 6 | ||||
-rw-r--r-- | libempathy-gtk/empathy-new-call-dialog.c | 33 |
2 files changed, 34 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c index 6dfe63a6e..7c18694ae 100644 --- a/libempathy-gtk/empathy-contact-menu.c +++ b/libempathy-gtk/empathy-contact-menu.c @@ -248,7 +248,8 @@ empathy_contact_audio_call_menu_item_activated (GtkMenuItem *item, EmpathyCallFactory *factory; factory = empathy_call_factory_get (); - empathy_call_factory_new_call_with_streams (factory, contact, TRUE, FALSE); + empathy_call_factory_new_call_with_streams (factory, contact, TRUE, FALSE, + gtk_get_current_event_time (), NULL, NULL); } GtkWidget * @@ -280,7 +281,8 @@ empathy_contact_video_call_menu_item_activated (GtkMenuItem *item, EmpathyCallFactory *factory; factory = empathy_call_factory_get (); - empathy_call_factory_new_call_with_streams (factory, contact, TRUE, TRUE); + empathy_call_factory_new_call_with_streams (factory, contact, TRUE, TRUE, + gtk_get_current_event_time (), NULL, NULL); } GtkWidget * diff --git a/libempathy-gtk/empathy-new-call-dialog.c b/libempathy-gtk/empathy-new-call-dialog.c index 10d34f36c..c266f895a 100644 --- a/libempathy-gtk/empathy-new-call-dialog.c +++ b/libempathy-gtk/empathy-new-call-dialog.c @@ -68,6 +68,29 @@ struct _EmpathyNewCallDialogPriv { * to be started with any contact on any enabled account. */ +typedef struct +{ + gboolean video; + gint64 timestamp; +} new_call_ctx; + +static new_call_ctx * +new_call_ctx_new (gboolean video, + gint64 timestamp) +{ + new_call_ctx *ctx = g_slice_new (new_call_ctx); + + ctx->video = video; + ctx->timestamp = timestamp; + return ctx; +} + +static void +new_call_ctx_free (new_call_ctx *ctx) +{ + g_slice_free (new_call_ctx, ctx); +} + static void got_contact_cb (TpConnection *connection, EmpathyContact *contact, @@ -76,7 +99,7 @@ got_contact_cb (TpConnection *connection, GObject *object) { EmpathyCallFactory *call_factory; - gboolean video = GPOINTER_TO_UINT (user_data); + new_call_ctx *ctx = user_data; if (error != NULL) { @@ -85,8 +108,9 @@ got_contact_cb (TpConnection *connection, } call_factory = empathy_call_factory_get (); + empathy_call_factory_new_call_with_streams (call_factory, contact, TRUE, - video); + ctx->video, ctx->timestamp, NULL, NULL); } static void @@ -96,6 +120,7 @@ empathy_new_call_dialog_response (GtkDialog *dialog, int response_id) gboolean video; TpConnection *connection; const gchar *contact_id; + new_call_ctx *ctx; if (response_id != GTK_RESPONSE_ACCEPT) goto out; @@ -108,8 +133,10 @@ empathy_new_call_dialog_response (GtkDialog *dialog, int response_id) * we return from this function. */ video = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_video)); + ctx = new_call_ctx_new (video, gtk_get_current_event_time ()); + empathy_tp_contact_factory_get_from_id (connection, contact_id, - got_contact_cb, GUINT_TO_POINTER (video), NULL, NULL); + got_contact_cb, ctx, (GDestroyNotify) new_call_ctx_free, NULL); out: gtk_widget_destroy (GTK_WIDGET (dialog)); |