Implement download_filter

This commit is contained in:
Gergely Polonkai 2016-01-15 18:46:32 +01:00
parent f2ccc585fe
commit b4e263cdd9

View File

@ -2199,6 +2199,31 @@ i_create_filter(MatrixAPI *api,
g_free(path);
}
static void
i_download_filter(MatrixAPI *api,
MatrixAPICallback callback,
gpointer user_data,
const gchar *user_id,
const gchar *filter_id,
GError **error)
{
gchar *encoded_user_id, *encoded_filter_id, *path;
encoded_user_id = soup_uri_encode(user_id, NULL);
encoded_filter_id = soup_uri_encode(filter_id, NULL);
path = g_strdup_printf("user/%s/filter/%s",
encoded_user_id, encoded_filter_id);
g_free(encoded_user_id);
g_free(encoded_filter_id);
_send(MATRIX_HTTP_API(api),
callback, user_data,
CALL_API,
"GET", path, NULL, NULL, NULL, NULL,
FALSE, error);
g_free(path);
}
static void
matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
{
@ -2263,7 +2288,7 @@ matrix_http_api_matrix_api_init(MatrixAPIInterface *iface)
iface->notify_room_typing = i_notify_room_typing;
iface->sync = i_sync;
iface->create_filter = i_create_filter;
iface->download_filter = NULL;
iface->download_filter = i_download_filter;
/* Search */