From 2b97578ab6a3797895f80f58482a772d71cf214c Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sat, 16 Jan 2016 15:07:02 +0100 Subject: [PATCH] Implement get_room_tags --- src/matrix-http-api.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/matrix-http-api.c b/src/matrix-http-api.c index 28925a9..861da20 100644 --- a/src/matrix-http-api.c +++ b/src/matrix-http-api.c @@ -2596,6 +2596,31 @@ i_set_account_data(MatrixAPI *api, g_free(path); } +static void +i_get_room_tags(MatrixAPI *api, + MatrixAPICallback callback, + gpointer user_data, + const gchar *user_id, + const gchar *room_id, + GError **error) +{ + gchar *encoded_user_id, *encoded_room_id, *path; + + encoded_user_id = soup_uri_encode(user_id, NULL); + encoded_room_id = soup_uri_encode(room_id, NULL); + path = g_strdup_printf("user/%s/rooms/%s/tags", + encoded_user_id, encoded_room_id); + g_free(encoded_user_id); + g_free(encoded_room_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) { @@ -2683,7 +2708,7 @@ matrix_http_api_matrix_api_init(MatrixAPIInterface *iface) iface->set_display_name = i_set_display_name; iface->register_account = i_register_account; iface->set_account_data = i_set_account_data; - iface->get_room_tags = NULL; + iface->get_room_tags = i_get_room_tags; iface->delete_room_tag = NULL; iface->add_room_tag = NULL;