Error fixes

This commit is contained in:
Gergely Polonkai 2016-01-15 10:36:47 +01:00
parent b42c9ab1e9
commit a037cb7aad
4 changed files with 6 additions and 6 deletions

View File

@ -1025,7 +1025,7 @@ matrix_api_invite_user(MatrixAPI *api,
* finished * finished
* @user_data: (closure): user data to pass to the callback function * @user_data: (closure): user data to pass to the callback function
* @callback * @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 * @error: return location for a #GError, or %NULL
* *
* Join a room. * Join a room.
@ -1040,7 +1040,7 @@ matrix_api_join_room(MatrixAPI *api,
g_return_if_fail(MATRIX_IS_API(api)); g_return_if_fail(MATRIX_IS_API(api));
MATRIX_API_GET_IFACE(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);
} }
/** /**

View File

@ -639,7 +639,7 @@ void matrix_api_invite_user(MatrixAPI *api,
void matrix_api_join_room(MatrixAPI *api, void matrix_api_join_room(MatrixAPI *api,
MatrixAPICallback callback, MatrixAPICallback callback,
gpointer user_data, gpointer user_data,
const gchar *room_id_or_alias, const gchar *room_id,
GError **error); GError **error);
void matrix_api_leave_room(MatrixAPI *api, void matrix_api_leave_room(MatrixAPI *api,
MatrixAPICallback callback, MatrixAPICallback callback,

View File

@ -973,14 +973,14 @@ i_join_room(MatrixAPI *api,
// TODO: a more thorough check should be used here // TODO: a more thorough check should be used here
if (*room_id != '!') { if (*room_id != '!') {
g_set_error(err, g_set_error(error,
MATRIX_API_ERROR, MATRIX_API_ERROR_INVALID_ROOM_ID, MATRIX_API_ERROR, MATRIX_API_ERROR_INVALID_ROOM_ID,
"Invalid room ID"); "Invalid room ID");
return; 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); path = g_strdup_printf("rooms/%s/join", encoded_room_id);
g_free(encoded_room_id); g_free(encoded_room_id);

View File

@ -87,7 +87,7 @@ login_finished(MatrixAPI *api, JsonNode *content, gpointer data, GError *err)
g_printf("Result is not one long?\n"); 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); g_printf("Logged in as %s\n", user_id);