New callback _on_connect, called after 001 numeric reply reception: currently it joins channels
This commit is contained in:
parent
c32f1579ee
commit
85ec2dcd01
2 changed files with 15 additions and 1 deletions
|
|
@ -33,6 +33,16 @@ class IRCServer(SocketServer):
|
|||
self.realname = realname
|
||||
self.id = "TODO"
|
||||
|
||||
def _on_connect():
|
||||
# First, JOIN some channels
|
||||
for chn in node.getNodes("channel"):
|
||||
if chn["password"] is not None:
|
||||
self.write("JOIN %s %s" % (chn["name"], chn["password"]))
|
||||
else:
|
||||
self.write("JOIN %s" % chn["name"])
|
||||
self._on_connect = _on_connect
|
||||
|
||||
|
||||
def _open(self):
|
||||
if SocketServer._open(self):
|
||||
if self.password is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue