From 9badfa6f285da4e85b414bcfcaf20719bf994862 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Fri, 22 Jan 2016 16:01:11 +0100 Subject: [PATCH] Implement MatrixClient.logout --- src/matrix-http-client.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/matrix-http-client.c b/src/matrix-http-client.c index b934c77..f152c1a 100644 --- a/src/matrix-http-client.c +++ b/src/matrix-http-client.c @@ -118,12 +118,20 @@ i_register_with_password(MatrixClient *client, 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 matrix_http_client_matrix_client_init(MatrixClientInterface *iface) { iface->login_with_password = i_login_with_password; iface->register_with_password = i_register_with_password; - iface->logout = NULL; + iface->logout = i_logout; iface->begin_polling = NULL; iface->stop_polling = NULL; }