From 9da0b12e4595bb3407e8fb61e4610f6e2626e6d4 Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 16 Dec 2019 05:14:26 -0400 Subject: [PATCH] Resume accounts faster on client startup --- src/python/backend.py | 3 +-- src/python/matrix_client.py | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/python/backend.py b/src/python/backend.py index de2cea5f..72a0db75 100644 --- a/src/python/backend.py +++ b/src/python/backend.py @@ -1,13 +1,12 @@ import asyncio import logging as log from pathlib import Path -from typing import Any, DefaultDict, Dict, List, Optional, Tuple, Union +from typing import Any, DefaultDict, Dict, List, Optional, Tuple import hsluv import nio -from . import utils from .app import App from .errors import MatrixError from .matrix_client import MatrixClient diff --git a/src/python/matrix_client.py b/src/python/matrix_client.py index d231b2d1..36eace54 100644 --- a/src/python/matrix_client.py +++ b/src/python/matrix_client.py @@ -134,8 +134,9 @@ class MatrixClient(nio.AsyncClient): async def resume(self, user_id: str, token: str, device_id: str) -> None: - response = nio.LoginResponse(user_id, device_id, token) - await self.receive_response(response) + self.user_id = user_id + self.access_token = token + self.device_id = device_id asyncio.ensure_future(self.start())