Implement media_upload

This commit is contained in:
Gergely Polonkai 2016-01-15 13:57:53 +01:00
parent 84c0eb569d
commit 74ec6100c9

View File

@ -1214,6 +1214,21 @@ i_media_thumbnail(MatrixAPI *api,
g_free(path);
}
static void
i_media_upload(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *content_type,
GByteArray *content,
GError **error)
{
_send(MATRIX_HTTP_API(api),
callback, user_data,
CALL_MEDIA,
"POST", "upload", NULL, content_type, NULL, content,
FALSE, error);
}
static void
matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
{
@ -1227,7 +1242,7 @@ matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
/* Media */
iface->media_download = i_media_download;
iface->media_thumbnail = i_media_thumbnail;
iface->media_upload = NULL;
iface->media_upload = i_media_upload;
/* Presence */
iface->get_presence_list = i_get_presence_list;