diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-04-16 19:34:59 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-04-30 19:19:45 +0100 |
commit | 199fd080e4a6ad07936d295a30bba7fab8b05e30 (patch) | |
tree | f01eedb3d4baeced421313f47d9925cc65cfd27c /telepathy-glib/account-channel-request.c | |
parent | 2e07d043286d90064679b066118877d26bae1f58 (diff) | |
download | telepathy-glib-199fd080e4a6ad07936d295a30bba7fab8b05e30.tar.gz |
tp_account_channel_request_set_request_property: add
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48780
Diffstat (limited to 'telepathy-glib/account-channel-request.c')
-rw-r--r-- | telepathy-glib/account-channel-request.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/telepathy-glib/account-channel-request.c b/telepathy-glib/account-channel-request.c index 16174faf4..f84f2f569 100644 --- a/telepathy-glib/account-channel-request.c +++ b/telepathy-glib/account-channel-request.c @@ -1831,3 +1831,56 @@ tp_account_channel_request_new_text ( g_hash_table_unref (request); return self; } + +/** + * tp_account_channel_request_set_request_property: + * @self: a #TpAccountChannelRequest + * @name: a D-Bus property name + * @value: an arbitrary value for the property + * + * Configure this channel request to include the given property, as + * documented in the Telepathy D-Bus API Specification or an + * implementation-specific extension. + * + * Using this method is not recommended, but it can be necessary for + * experimental or implementation-specific interfaces. + * + * If the property is not supported by the protocol or channel type, the + * channel request will fail. Use #TpCapabilities and the Telepathy + * D-Bus API Specification to determine which properties are available. + * + * If @value is a floating reference, this method takes ownership of it + * by using g_variant_ref_sink(). This allows convenient inline use of + * #GVariant constructors: + * + * |[ + * tp_account_channel_request_set_request_property (acr, "com.example.Int", + * g_variant_new_int32 (17)); + * tp_account_channel_request_set_request_property (acr, "com.example.String", + * g_variant_new_string ("ferret")); + * ]| + * + * It is an error to provide a @value which contains types not supported by + * D-Bus. + * + * This function can't be called once @self has been used to request a + * channel. + * + * Since: 0.19.UNRELEASED + */ +void +tp_account_channel_request_set_request_property ( + TpAccountChannelRequest *self, + const gchar *name, + GVariant *value) +{ + GValue *v; + + g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self)); + g_return_if_fail (!self->priv->requested); + + v = g_slice_new0 (GValue); + dbus_g_value_parse_g_variant (value, v); + + g_hash_table_insert (self->priv->request, g_strdup (name), v); +} |