From 3ac37f6f44ebd2db709604be81af56360ae330a7 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 24 Jun 2011 14:00:21 +0200 Subject: [PATCH] add tp_account_channel_request_set_delegate_to_preferred_handler() --- docs/reference/telepathy-glib-sections.txt | 1 + telepathy-glib/account-channel-request.c | 29 ++++++++++++++++++++++++++++ telepathy-glib/account-channel-request.h | 4 +++ 3 files changed, 34 insertions(+), 0 deletions(-) diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt index fb42746..67af5a2 100644 --- a/docs/reference/telepathy-glib-sections.txt +++ b/docs/reference/telepathy-glib-sections.txt @@ -5207,6 +5207,7 @@ tp_account_channel_request_ensure_and_observe_channel_finish tp_account_channel_request_set_channel_factory tp_account_channel_request_get_channel_request tp_account_channel_request_set_hints +tp_account_channel_request_set_delegate_to_preferred_handler tp_account_channel_request_get_type TP_ACCOUNT_CHANNEL_REQUEST diff --git a/telepathy-glib/account-channel-request.c b/telepathy-glib/account-channel-request.c index e0a60e1..0033525 100644 --- a/telepathy-glib/account-channel-request.c +++ b/telepathy-glib/account-channel-request.c @@ -1573,3 +1573,32 @@ tp_account_channel_request_set_hints (TpAccountChannelRequest *self, tp_clear_pointer (&self->priv->hints, g_hash_table_unref); self->priv->hints = g_hash_table_ref (hints); } + +/** + * tp_account_channel_request_set_delegate_to_preferred_handler: + * @self: a #TpAccountChannelRequest + * @delegate: %TRUE to request to delegate channels + * + * If @delegate is %TRUE, asks to the client currently handling the channels to + * delegate them to the preferred handler (passed when calling + * tp_account_channel_request_ensure_channel_async() for example). + * + * This function can't be called once @self has been used to request a + * channel. + * + * Since: 0.15.UNRELEASED + */ +void +tp_account_channel_request_set_delegate_to_preferred_handler ( + TpAccountChannelRequest *self, + gboolean delegate) +{ + g_return_if_fail (!self->priv->requested); + + if (self->priv->hints == NULL) + self->priv->hints = tp_asv_new (NULL, NULL); + + tp_asv_set_boolean (self->priv->hints, + "org.freedesktop.Telepathy.ChannelRequest.DelegateToPreferredHandler", + delegate); +} diff --git a/telepathy-glib/account-channel-request.h b/telepathy-glib/account-channel-request.h index 39d8b29..07b3238 100644 --- a/telepathy-glib/account-channel-request.h +++ b/telepathy-glib/account-channel-request.h @@ -82,6 +82,10 @@ TpChannelRequest * tp_account_channel_request_get_channel_request ( void tp_account_channel_request_set_hints (TpAccountChannelRequest *self, GHashTable *hints); +void tp_account_channel_request_set_delegate_to_preferred_handler ( + TpAccountChannelRequest *self, + gboolean delegate); + /* Request and handle API */ void tp_account_channel_request_create_and_handle_channel_async ( -- 1.7.4.1