Resume accounts faster on client startup
This commit is contained in:
parent
7d8f67bfe2
commit
9da0b12e45
|
@ -1,13 +1,12 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging as log
|
import logging as log
|
||||||
from pathlib import Path
|
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 hsluv
|
||||||
|
|
||||||
import nio
|
import nio
|
||||||
|
|
||||||
from . import utils
|
|
||||||
from .app import App
|
from .app import App
|
||||||
from .errors import MatrixError
|
from .errors import MatrixError
|
||||||
from .matrix_client import MatrixClient
|
from .matrix_client import MatrixClient
|
||||||
|
|
|
@ -134,8 +134,9 @@ class MatrixClient(nio.AsyncClient):
|
||||||
|
|
||||||
|
|
||||||
async def resume(self, user_id: str, token: str, device_id: str) -> None:
|
async def resume(self, user_id: str, token: str, device_id: str) -> None:
|
||||||
response = nio.LoginResponse(user_id, device_id, token)
|
self.user_id = user_id
|
||||||
await self.receive_response(response)
|
self.access_token = token
|
||||||
|
self.device_id = device_id
|
||||||
|
|
||||||
asyncio.ensure_future(self.start())
|
asyncio.ensure_future(self.start())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user