From 2cb3928cf0d3a2630969f77f01e44d79db50cd04 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Fri, 15 Jan 2016 15:56:51 +0100 Subject: [PATCH] Implement forget_room --- src/matrix-http-api.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/matrix-http-api.c b/src/matrix-http-api.c index da94c93..39bb2ce 100644 --- a/src/matrix-http-api.c +++ b/src/matrix-http-api.c @@ -1667,6 +1667,27 @@ i_ban_user(MatrixAPI *api, g_free(path); } +static void +i_forget_room(MatrixAPI *api, + MatrixAPICallback callback, + gpointer user_data, + const gchar *room_id, + GError **error) +{ + gchar *encoded_room_id, *path; + + encoded_room_id = soup_uri_encode(room_id, NULL); + path = g_strdup_printf("rooms/%s/forget", encoded_room_id); + g_free(encoded_room_id); + + _send(MATRIX_HTTP_API(api), + callback, user_data, + CALL_API, + "POST", path, NULL, NULL, NULL, NULL, + FALSE, error); + g_free(path); +} + static void matrix_http_api_matrix_api_init(MatrixAPIInterface *iface) { @@ -1709,7 +1730,7 @@ matrix_http_api_matrix_api_init(MatrixAPIInterface *iface) /* Room membership */ iface->ban_user = i_ban_user; - iface->forget_room = NULL; + iface->forget_room = i_forget_room; iface->invite_user_3rdparty = NULL; iface->invite_user = NULL; iface->join_room = i_join_room;