summaryrefslogtreecommitdiff
path: root/telepathy-glib/channel-request.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-25 16:03:12 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-02-22 16:29:48 +0100
commitad698b29f23c9201efff7b4923760eefe4686488 (patch)
tree8121b0d5fafe73c34613676d2965d37dc5da9cc9 /telepathy-glib/channel-request.c
parent5ee96ec71302185c84e78b771f9acaa948823ad1 (diff)
downloadtelepathy-glib-ad698b29f23c9201efff7b4923760eefe4686488.tar.gz
TpChannelRequest: add API to get the hints
Diffstat (limited to 'telepathy-glib/channel-request.c')
-rw-r--r--telepathy-glib/channel-request.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/telepathy-glib/channel-request.c b/telepathy-glib/channel-request.c
index f0be316be..ca86977a8 100644
--- a/telepathy-glib/channel-request.c
+++ b/telepathy-glib/channel-request.c
@@ -102,6 +102,7 @@ enum {
enum {
PROP_CHANNEL_FACTORY = 1,
PROP_IMMUTABLE_PROPERTIES,
+ PROP_HINTS,
};
static guint signals[N_SIGNALS] = { 0 };
@@ -165,6 +166,10 @@ tp_channel_request_get_property (GObject *object,
g_value_set_boxed (value, self->priv->immutable_properties);
break;
+ case PROP_HINTS:
+ g_value_set_boxed (value, tp_channel_request_get_hints (self));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -299,6 +304,7 @@ tp_channel_request_dispose (GObject *object)
G_OBJECT_CLASS (tp_channel_request_parent_class)->dispose;
tp_clear_pointer (&self->priv->immutable_properties, g_hash_table_unref);
+
tp_clear_object (&self->priv->channel_factory);
if (dispose != NULL)
@@ -366,6 +372,22 @@ tp_channel_request_class_init (TpChannelRequestClass *klass)
param_spec);
/**
+ * TpChannelRequest:hints:
+ *
+ * A #TP_HASH_TYPE_STRING_VARIANT_MAP of metadata provided by
+ * the channel requester; or %NULL if #TpChannelRequest:immutable-properties
+ * is not defined or if no hints has been defined.
+ *
+ * Read-only.
+ *
+ * Since: 0.13.UNRELEASED
+ */
+ param_spec = g_param_spec_boxed ("hints", "Hints", "Hints",
+ TP_HASH_TYPE_STRING_VARIANT_MAP,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class, PROP_HINTS, param_spec);
+
+ /**
* TpChannelRequest::succeeded:
* @self: the channel request proxy
*
@@ -527,3 +549,26 @@ tp_channel_request_get_immutable_properties (TpChannelRequest *self)
return self->priv->immutable_properties;
}
+
+/**
+ * tp_channel_request_get_hints:
+ * @self: a #TpChannelRequest
+ *
+ * Return the #TpChannelRequest:hints property
+ *
+ * Returns: (transfer none): the value of
+ * #TpChannelRequest:hints
+ *
+ * Since: 0.13.UNRELEASED
+ */
+const GHashTable *
+tp_channel_request_get_hints (TpChannelRequest *self)
+{
+ g_return_val_if_fail (TP_IS_CHANNEL_REQUEST (self), NULL);
+
+ if (self->priv->immutable_properties == NULL)
+ return NULL;
+
+ return tp_asv_get_boxed (self->priv->immutable_properties,
+ TP_PROP_CHANNEL_REQUEST_HINTS, TP_HASH_TYPE_STRING_VARIANT_MAP);
+}