Update of /cvsroot/pybot/pybot/pybot/modules
In directory sc8-pr-cvs1:/tmp/cvs-serv7204/pybot/modules
Modified Files:
pong.py servercontrol.py
Log Message:
Fixed code which were still using old code from the Command class.
Index: pong.py
===================================================================
RCS file: /cvsroot/pybot/pybot/pybot/modules/pong.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** pong.py 12 May 2003 20:42:21 -0000 1.5
--- pong.py 22 Aug 2003 13:49:10 -0000 1.6
***************
*** 30,34 ****
def pong(self, cmd):
if cmd.cmd == "PING":
! cmd.server.sendcmd("", "PONG", cmd.params, priority=10)
def ping(self):
--- 30,34 ----
def pong(self, cmd):
if cmd.cmd == "PING":
! cmd.server.sendcmd("", "PONG", cmd.line, priority=10)
def ping(self):
Index: servercontrol.py
===================================================================
RCS file: /cvsroot/pybot/pybot/pybot/modules/servercontrol.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** servercontrol.py 22 Aug 2003 13:22:11 -0000 1.6
--- servercontrol.py 22 Aug 2003 13:49:10 -0000 1.7
***************
*** 211,243 ****
def command(self, cmd):
if cmd.cmd == "001":
cmd.server.sendcmd("", "WHOIS", cmd.server.user.nick, priority=10)
! elif cmd.cmd == "311" and cmd.server.user.nick == cmd.params[1]:
! cmd.server.user.set(cmd.params[1], cmd.params[2], cmd.params[3])
hooks.call("Registered", cmd.server)
elif cmd.cmd == "JOIN":
if cmd.prefix == cmd.server.user.string:
! hooks.call("Joined", cmd.server, cmd.params[0][1:])
else:
user = User()
user.setstring(cmd.prefix)
! hooks.call("UserJoined", cmd.server, cmd.params[0][1:], user)
elif cmd.cmd == "PART":
if cmd.prefix == cmd.server.user.string:
! hooks.call("Parted", cmd.server, cmd.params[0])
else:
user = User()
user.setstring(cmd.prefix)
! if len(cmd.params) > 1:
! reason = join([cmd.params[1][1:]]+cmd.params[2:])
else:
reason = None
hooks.call("UserParted",
! cmd.server, cmd.params[0], user, reason)
elif cmd.cmd == "QUIT":
user = User()
user.setstring(cmd.prefix)
! if len(cmd.params) > 0:
! reason = join([cmd.params[0][1:]]+cmd.params[2:])
else:
reason = None
--- 211,244 ----
def command(self, cmd):
+ params = cmd.line.split()
if cmd.cmd == "001":
cmd.server.sendcmd("", "WHOIS", cmd.server.user.nick, priority=10)
! elif cmd.cmd == "311" and cmd.server.user.nick == params[1]:
! cmd.server.user.set(params[1], params[2], params[3])
hooks.call("Registered", cmd.server)
elif cmd.cmd == "JOIN":
if cmd.prefix == cmd.server.user.string:
! hooks.call("Joined", cmd.server, params[0][1:])
else:
user = User()
user.setstring(cmd.prefix)
! hooks.call("UserJoined", cmd.server, params[0][1:], user)
elif cmd.cmd == "PART":
if cmd.prefix == cmd.server.user.string:
! hooks.call("Parted", cmd.server, params[0])
else:
user = User()
user.setstring(cmd.prefix)
! if len(params) > 1:
! reason = join([params[1][1:]]+params[2:])
else:
reason = None
hooks.call("UserParted",
! cmd.server, params[0], user, reason)
elif cmd.cmd == "QUIT":
user = User()
user.setstring(cmd.prefix)
! if len(params) > 0:
! reason = join([params[0][1:]]+params[2:])
else:
reason = None
|