Implement MatrixClient.logout

This commit is contained in:
Gergely Polonkai 2016-01-22 16:01:11 +01:00
parent 65213319d3
commit 9badfa6f28

View File

@ -118,12 +118,20 @@ i_register_with_password(MatrixClient *client,
error); error);
} }
static void
i_logout(MatrixClient *client, GError **error)
{
matrix_api_set_token(MATRIX_API(client), NULL);
matrix_api_set_refresh_token(MATRIX_API(client), NULL);
matrix_api_abort_pending(MATRIX_API(client));
}
static void static void
matrix_http_client_matrix_client_init(MatrixClientInterface *iface) matrix_http_client_matrix_client_init(MatrixClientInterface *iface)
{ {
iface->login_with_password = i_login_with_password; iface->login_with_password = i_login_with_password;
iface->register_with_password = i_register_with_password; iface->register_with_password = i_register_with_password;
iface->logout = NULL; iface->logout = i_logout;
iface->begin_polling = NULL; iface->begin_polling = NULL;
iface->stop_polling = NULL; iface->stop_polling = NULL;
} }