Set some Connection parameters in join_room
This commit is contained in:
parent
d55d05826f
commit
78bb6b935f
2 changed files with 5 additions and 4 deletions
|
|
@ -66,11 +66,11 @@ class Bot(Inhabitant):
|
||||||
|
|
||||||
# ROOM MANAGEMENT
|
# ROOM MANAGEMENT
|
||||||
|
|
||||||
def join_room(self, roomname, password=None):
|
def join_room(self, roomname, **kwargs):
|
||||||
if roomname in self.rooms:
|
if roomname in self.rooms:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.rooms[roomname] = Room(self, roomname, self.target_nick, password=password, cookiejar=self.cookiejar)
|
self.rooms[roomname] = Room(self, roomname, self.target_nick, cookiejar=self.cookiejar, **kwargs)
|
||||||
|
|
||||||
async def part_room(self, roomname):
|
async def part_room(self, roomname):
|
||||||
room = self.rooms.pop(roomname, None)
|
room = self.rooms.pop(roomname, None)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class Room:
|
||||||
CLOSED = 3
|
CLOSED = 3
|
||||||
FORWARDING = 4
|
FORWARDING = 4
|
||||||
|
|
||||||
def __init__(self, inhabitant, roomname, nick, password=None, human=False, cookiejar=None):
|
def __init__(self, inhabitant, roomname, nick, password=None, human=False, cookiejar=None, **kwargs):
|
||||||
# TODO: Connect to room etc.
|
# TODO: Connect to room etc.
|
||||||
# TODO: Deal with room/connection states of:
|
# TODO: Deal with room/connection states of:
|
||||||
# disconnected connecting, fast-forwarding, connected
|
# disconnected connecting, fast-forwarding, connected
|
||||||
|
|
@ -59,7 +59,8 @@ class Room:
|
||||||
self._receive_packet,
|
self._receive_packet,
|
||||||
self._disconnected,
|
self._disconnected,
|
||||||
self._stopped,
|
self._stopped,
|
||||||
cookiejar
|
cookiejar,
|
||||||
|
**kwargs
|
||||||
)
|
)
|
||||||
|
|
||||||
asyncio.ensure_future(self._inhabitant.on_created(self))
|
asyncio.ensure_future(self._inhabitant.on_created(self))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue