From bd75d0ebba7965c4b3d592f74b9f31806c7e30bf Mon Sep 17 00:00:00 2001 From: Joscha Date: Fri, 27 Jul 2018 12:21:33 +0000 Subject: [PATCH] Add new inhabitant callback --- yaboli/room.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yaboli/room.py b/yaboli/room.py index cf83e00..b8d9292 100644 --- a/yaboli/room.py +++ b/yaboli/room.py @@ -56,6 +56,8 @@ class Room: cookiejar ) + asyncio.ensure_future(self._inhabitant.created(self)) + async def exit(self): self._status = Room.CLOSED await self._connection.stop() @@ -327,12 +329,15 @@ class Inhabitant: # They're launched via asyncio.ensure_future(), so they don't block execution of the room. # Just overwrite the events you need (make sure to keep the arguments the same though). - async def disconnected(self, room): + async def created(self, room): pass async def connected(self, room, log): pass + async def disconnected(self, room): + pass + async def join(self, room, session): pass