Add API method for /account/whoami

This commit is contained in:
2018-02-28 11:02:37 +01:00
parent d310f34228
commit cec83e7bae
4 changed files with 40 additions and 0 deletions

View File

@@ -2161,6 +2161,15 @@ matrix_http_api_get_turn_server(MatrixAPI *matrix_api, MatrixAPICallback cb, voi
NULL, NULL, NULL, NULL, FALSE, error);
}
static void
whoami(MatrixAPI *api, MatrixAPICallback cb, void *cb_target, GError **error)
{
_matrix_http_api_send(MATRIX_HTTP_API(api),
cb, cb_target,
CALL_TYPE_API, "GET", "account/whoami",
NULL, NULL, NULL, NULL, FALSE, error);
}
static void
matrix_http_api_abort_pending (MatrixAPI *matrix_api)
{
@@ -2530,6 +2539,7 @@ matrix_http_api_matrix_api_interface_init(MatrixAPIInterface * iface)
iface->get_token = matrix_http_api_get_token;
iface->set_token = matrix_http_api_set_token;
iface->get_homeserver = matrix_http_api_get_homeserver;
iface->whoami = whoami;
}
static void