From ded4fc04bd3a874974e48783a4a4c9b48a9a7e09 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 15 Dec 2015 13:31:08 +0100 Subject: [PATCH] Add create room to test client --- src/test-client.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/test-client.c b/src/test-client.c index 5c2bc2d..d87058a 100644 --- a/src/test-client.c +++ b/src/test-client.c @@ -30,6 +30,15 @@ static GOptionEntry entries[] = { {"password", 'p', 0, G_OPTION_ARG_STRING, &password}, }; +static void +create_room_finished(MatrixAPI *api, + JsonNode *content, + gpointer data, + GError *err) +{ + g_printf("Room registered\n"); +} + static void login_finished(MatrixAPI *api, JsonNode *content, gpointer data, GError *err) { @@ -58,6 +67,11 @@ login_finished(MatrixAPI *api, JsonNode *content, gpointer data, GError *err) user_id = json_array_get_string_element(array, 0); g_printf("Logged in as %s\n", user_id); + + matrix_http_api_create_room(api, + create_room_finished, NULL, + "matrix-glib-sdk-test", TRUE, + NULL); } else { g_printf("Login unsuccessful!\n"); } @@ -98,7 +112,7 @@ main(int argc, char *argv[]) /* * [ ] register * [X] login - * [ ] create_room + * [X] create_room * [ ] join_room */ api = matrix_http_api_new(url, NULL);