New callback _on_connect, called after 001 numeric reply reception: currently it joins channels

This commit is contained in:
nemunaire 2014-09-04 10:43:50 +02:00
commit 85ec2dcd01
2 changed files with 15 additions and 1 deletions

View file

@ -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: