From a037cb7aad3e17381ef31067c0f29669b279d214 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Fri, 15 Jan 2016 10:36:47 +0100 Subject: [PATCH] Error fixes --- src/matrix-api.c | 4 ++-- src/matrix-api.h | 2 +- src/matrix-http-api.c | 4 ++-- src/test-client.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/matrix-api.c b/src/matrix-api.c index eab5054..b649422 100644 --- a/src/matrix-api.c +++ b/src/matrix-api.c @@ -1025,7 +1025,7 @@ matrix_api_invite_user(MatrixAPI *api, * finished * @user_data: (closure): user data to pass to the callback function * @callback - * @room_ids: the room ID to join to + * @room_id: the room ID to join to * @error: return location for a #GError, or %NULL * * Join a room. @@ -1040,7 +1040,7 @@ matrix_api_join_room(MatrixAPI *api, g_return_if_fail(MATRIX_IS_API(api)); MATRIX_API_GET_IFACE(api) - ->join_room(api, callback, user_data, room_id_or_alias, error); + ->join_room(api, callback, user_data, room_id, error); } /** diff --git a/src/matrix-api.h b/src/matrix-api.h index de4adca..5e686e8 100644 --- a/src/matrix-api.h +++ b/src/matrix-api.h @@ -639,7 +639,7 @@ void matrix_api_invite_user(MatrixAPI *api, void matrix_api_join_room(MatrixAPI *api, MatrixAPICallback callback, gpointer user_data, - const gchar *room_id_or_alias, + const gchar *room_id, GError **error); void matrix_api_leave_room(MatrixAPI *api, MatrixAPICallback callback, diff --git a/src/matrix-http-api.c b/src/matrix-http-api.c index 8fd8d2d..c8178a0 100644 --- a/src/matrix-http-api.c +++ b/src/matrix-http-api.c @@ -973,14 +973,14 @@ i_join_room(MatrixAPI *api, // TODO: a more thorough check should be used here if (*room_id != '!') { - g_set_error(err, + g_set_error(error, MATRIX_API_ERROR, MATRIX_API_ERROR_INVALID_ROOM_ID, "Invalid room ID"); return; } - encoded_room_id = soup_uri_encode(room_id_or_alias, NULL); + encoded_room_id = soup_uri_encode(room_id, NULL); path = g_strdup_printf("rooms/%s/join", encoded_room_id); g_free(encoded_room_id); diff --git a/src/test-client.c b/src/test-client.c index 1269b96..c59e357 100644 --- a/src/test-client.c +++ b/src/test-client.c @@ -87,7 +87,7 @@ login_finished(MatrixAPI *api, JsonNode *content, gpointer data, GError *err) g_printf("Result is not one long?\n"); } - user_id = json_array_get_string_element(array, 0); + user_id = matrix_api_get_user_id(MATRIX_API(api)); g_printf("Logged in as %s\n", user_id);