3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

Actually check recvpass field (Closes #9)

This commit is contained in:
James Lu 2015-06-02 16:55:04 -07:00
parent 955ffbd012
commit 38bd58f7ff
2 changed files with 10 additions and 2 deletions

View File

@ -33,9 +33,9 @@ class Irc():
self.socket = socket.socket()
self.socket.connect((ip, port))
proto.connect(self)
self.connected = True
self.loaded = []
self.load_plugins()
self.connected = True
self.run()
def run(self):

View File

@ -191,8 +191,16 @@ def handle_events(irc, data):
# Each server message looks something like this:
# :70M FJOIN #chat 1423790411 +AFPfjnt 6:5 7:5 9:5 :v,1SRAAESWE
# :<sid> <command> <argument1> <argument2> ... :final multi word argument
args = data.split()
if args and args[0] == 'SERVER':
# SERVER whatever.net abcdefgh 0 10X :something
servername = args[1]
if args[2] != irc.serverdata['recvpass']:
# Check if recvpass is correct
print('Error: recvpass from uplink server %s does not match configuration!' % servername)
sys.exit(1)
return
try:
args = data.split()
real_args = []
for arg in args:
real_args.append(arg)