small changes

This commit is contained in:
histausse 2021-10-08 16:40:40 +02:00
parent 139b9e138b
commit b9f87bf42f
Signed by: histausse
GPG key ID: 67486F107F62E9E9

View file

@ -48,7 +48,8 @@ class Client(Aobject):
__sync_token_queue: asyncio.Queue[str] __sync_token_queue: asyncio.Queue[str]
__invite_queue: asyncio.Queue[tuple[RoomId, nio.responses.InviteInfo]] __invite_queue: asyncio.Queue[tuple[RoomId, nio.responses.InviteInfo]]
__invite_policy: InvitePolicy __invite_policy: InvitePolicy
user: str user_name: str
user_id: str
async def __init__( async def __init__(
self, self,
@ -87,6 +88,7 @@ class Client(Aobject):
if isinstance(resp, nio.responses.LoginError): if isinstance(resp, nio.responses.LoginError):
raise RuntimeError(f"Fail to connect: {resp.message}") raise RuntimeError(f"Fail to connect: {resp.message}")
log.info("logged in") log.info("logged in")
self.user_name = username
self.user_id = self.__client.user_id self.user_id = self.__client.user_id
async def resolve_room( async def resolve_room(
@ -292,7 +294,7 @@ class Client(Aobject):
def add_message_callback( def add_message_callback(
self, self,
callback: Callable[[Client, nio.rooms.Room, nio.events.room_events.RoomMessageText], Awaitable[None]] callback: Callable[[Client, nio.rooms.MatrixRoom, nio.events.room_events.RoomMessageText], Awaitable[None]]
): ):
""" """
Add a callback called when a message is received. Add a callback called when a message is received.