aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dave@treblig.org>2018-03-11 20:17:40 +0000
committerDr. David Alan Gilbert <dave@treblig.org>2019-12-28 18:41:04 +0000
commit9ea0bc559109c117ab699cc4ca9b386900d299fa (patch)
treef94005cf133ad9f4de9508192cd66fcd2e652ca0
parent32995caa9606c80a1752ae54fa4a9250a60ccde3 (diff)
downloadpurple-matrix-9ea0bc559109c117ab699cc4ca9b386900d299fa.tar.gz
connection: store access token
Store the access token we get after login. Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
-rw-r--r--libmatrix.h2
-rw-r--r--matrix-connection.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/libmatrix.h b/libmatrix.h
index 86ce891..852d5f8 100644
--- a/libmatrix.h
+++ b/libmatrix.h
@@ -117,6 +117,8 @@
#define PRPL_ACCOUNT_OPT_SKIP_OLD_MESSAGES "skip_old_messages"
/* Pickled account info from olm_pickle_account */
#define PRPL_ACCOUNT_OPT_OLM_ACCOUNT_KEYS "olm_account_keys"
+/* Access token, after a login */
+#define PRPL_ACCOUNT_OPT_ACCESS_TOKEN "access_token"
/* defaults for account options */
#define DEFAULT_HOME_SERVER "https://matrix.org"
diff --git a/matrix-connection.c b/matrix-connection.c
index 736782b..7a03e32 100644
--- a/matrix-connection.c
+++ b/matrix-connection.c
@@ -186,6 +186,8 @@ static void _login_completed(MatrixConnectionData *conn,
"user_id"));
device_id = matrix_json_object_get_string_member(root_obj, "device_id");
purple_account_set_string(pc->account, "device_id", device_id);
+ purple_account_set_string(pc->account, PRPL_ACCOUNT_OPT_ACCESS_TOKEN,
+ access_token);
if (device_id) {
matrix_e2e_get_device_keys(conn, device_id);