Resume accounts faster on client startup
This commit is contained in:
parent
7d8f67bfe2
commit
9da0b12e45
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user