summaryrefslogtreecommitdiff
path: root/telepathy-glib
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-02-25 12:39:59 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-02-25 12:39:59 +0100
commit410e44a648eb3bd2eb5db31a39326b01ac953eac (patch)
treeb1cc0f0a4a0ca6f63f1139c00fc08077749d69ed /telepathy-glib
parent8cc41d121d1579893c2c7f7cc7bc90670170380f (diff)
downloadtelepathy-glib-410e44a648eb3bd2eb5db31a39326b01ac953eac.tar.gz
add tp_account_channel_request_set_file_transfer_hash()
Diffstat (limited to 'telepathy-glib')
-rw-r--r--telepathy-glib/account-channel-request.c33
-rw-r--r--telepathy-glib/account-channel-request.h6
2 files changed, 39 insertions, 0 deletions
diff --git a/telepathy-glib/account-channel-request.c b/telepathy-glib/account-channel-request.c
index 5269a39f6..a1000f986 100644
--- a/telepathy-glib/account-channel-request.c
+++ b/telepathy-glib/account-channel-request.c
@@ -2390,3 +2390,36 @@ tp_account_channel_request_set_file_transfer_initial_offset (
tp_g_value_slice_new_uint64 (offset));
}
}
+
+/**
+ * tp_account_channel_request_set_file_transfer_hash:
+ * @self: a #TpAccountChannelRequest
+ * @hash_type: a type of @hash
+ * @hash: hash of the contents of the file transfer
+ *
+ * Configure this channel request to accompany the file transfer with
+ * the hash of the file.
+ *
+ * This function can't be called once @self has been used to request a
+ * channel.
+ *
+ * Since: UNRELEASED
+ */
+void
+tp_account_channel_request_set_file_transfer_hash (
+ TpAccountChannelRequest *self,
+ TpFileHashType hash_type,
+ const gchar *hash)
+{
+ g_return_if_fail (TP_IS_ACCOUNT_CHANNEL_REQUEST (self));
+ g_return_if_fail (!self->priv->requested);
+ g_return_if_fail (hash_type < TP_NUM_FILE_HASH_TYPES);
+
+ g_hash_table_insert (self->priv->request,
+ g_strdup (TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH_TYPE),
+ tp_g_value_slice_new_uint (hash_type));
+
+ g_hash_table_insert (self->priv->request,
+ g_strdup (TP_PROP_CHANNEL_TYPE_FILE_TRANSFER_CONTENT_HASH),
+ tp_g_value_slice_new_string (hash));
+}
diff --git a/telepathy-glib/account-channel-request.h b/telepathy-glib/account-channel-request.h
index f05571417..f143df821 100644
--- a/telepathy-glib/account-channel-request.h
+++ b/telepathy-glib/account-channel-request.h
@@ -152,6 +152,12 @@ void tp_account_channel_request_set_file_transfer_initial_offset (
TpAccountChannelRequest *self,
guint64 offset);
+_TP_AVAILABLE_IN_0_24
+void tp_account_channel_request_set_file_transfer_hash (
+ TpAccountChannelRequest *self,
+ TpFileHashType hash_type,
+ const gchar *hash);
+
/* Channel target (shared between all channel types) */
_TP_AVAILABLE_IN_0_20