From b9268db55763d04d5bf91fecc09460280ccda4ae Mon Sep 17 00:00:00 2001 From: Chandni Verma Date: Tue, 28 Aug 2012 18:46:56 +0530 Subject: [PATCH 2/2] Fire off an ensure_channel_async() request for legacy Tubes channel Workaround for https://bugs.freedesktop.org/show_bug.cgi?id=47760 --- examples/client/dbus-tubes/offerer.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/examples/client/dbus-tubes/offerer.c b/examples/client/dbus-tubes/offerer.c index fb7c151..43e3559 100644 --- a/examples/client/dbus-tubes/offerer.c +++ b/examples/client/dbus-tubes/offerer.c @@ -175,6 +175,34 @@ channel_created (GObject *source, tp_dbus_tube_channel_offer_async (tube, NULL, tube_offered, NULL); } +static void ensure_legacy_channel_async (TpAccount *account, + const gchar* contact) +{ + GHashTable *request = tp_asv_new ( + TP_PROP_CHANNEL_CHANNEL_TYPE, + G_TYPE_STRING, + TP_IFACE_CHANNEL_TYPE_TUBES, + + TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, + TP_TYPE_HANDLE, + TP_HANDLE_TYPE_CONTACT, + + TP_PROP_CHANNEL_TARGET_ID, + G_TYPE_STRING, + contact, + + NULL); + + TpAccountChannelRequest *req = + tp_account_channel_request_new (account, request, + TP_USER_ACTION_TIME_CURRENT_TIME); + + tp_account_channel_request_ensure_channel_async (req, NULL, NULL, NULL, NULL); + + g_hash_table_unref (request); + g_object_unref (req); +} + int main (int argc, const char **argv) @@ -199,6 +227,9 @@ main (int argc, g_assert_no_error (error); g_free (account_path); + /* Workaround for https://bugs.freedesktop.org/show_bug.cgi?id=47760 */ + ensure_legacy_channel_async (account, argv[2]); + request = tp_asv_new ( TP_PROP_CHANNEL_CHANNEL_TYPE, G_TYPE_STRING, -- 1.7.9.5