aboutsummaryrefslogtreecommitdiffstats
path: root/matrix-api.h
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dave@treblig.org>2016-11-03 02:30:43 +0000
committerDr. David Alan Gilbert <dave@treblig.org>2016-11-13 17:17:29 +0000
commitb6923359750e7c0564d4d5009415708d789c364c (patch)
tree48955a84ce2d70bfcbb25219b095e4a924c4acf1 /matrix-api.h
parent991af2d7984aaf6c23bcb9ab2cc9c36477f0b1b0 (diff)
downloadpurple-matrix-b6923359750e7c0564d4d5009415708d789c364c.tar.gz
Add matrix_api_download_file
Download a file given a URI. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Diffstat (limited to 'matrix-api.h')
-rw-r--r--matrix-api.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/matrix-api.h b/matrix-api.h
index 10ed37b..4245cd7 100644
--- a/matrix-api.h
+++ b/matrix-api.h
@@ -253,6 +253,29 @@ MatrixApiRequestData *matrix_api_upload_file(MatrixConnectionData *conn,
MatrixApiBadResponseCallback bad_response_callback,
gpointer user_data);
+/**
+ * Download a file
+ *
+ * @param conn The connection with which to make the request
+ * @param uri The Matrix uri to fetch starting mxc://
+ * @param max_size A maximum size of file to receive.
+ * @param callback Function to be called when the request completes
+ * @param error_callback Function to be called if there is an error making
+ * the request. If NULL, matrix_api_error will be
+ * used.
+ * @param bad_response_callback Function to be called if the API gives a non-200
+ * response. If NULL, matrix_api_bad_response will be
+ * used.
+ * @param user_data Opaque data to be passed to the callbacks
+ *
+ */
+MatrixApiRequestData *matrix_api_download_file(MatrixConnectionData *conn,
+ const gchar *uri,
+ gsize max_size,
+ MatrixApiCallback callback,
+ MatrixApiErrorCallback error_callback,
+ MatrixApiBadResponseCallback bad_response_callback,
+ gpointer user_data);
#if 0
/**