irc.py

changeset 123
aeb0d0788869
parent 120
9880bb697149
child 124
7b2cd8b1ba86
equal deleted inserted replaced
122:f899af683bbe 123:aeb0d0788869
120 if self.verbose: 120 if self.verbose:
121 print "[%s] -> %s" % (self.name, line) 121 print "[%s] -> %s" % (self.name, line)
122 122
123 if line.startswith ("PING :"): 123 if line.startswith ("PING :"):
124 self.write ("PONG :%s" % line[6:]) 124 self.write ("PONG :%s" % line[6:])
125 self.send_all_now() # pings must be responded to immediately!
125 else: 126 else:
126 words = line.split(" ") 127 words = line.split(" ")
127 if len(words) >= 2: 128 if len(words) >= 2:
128 if words[1] == "001": 129 if words[1] == "001":
129 self.flags |= CLIF_CONNECTED 130 self.flags |= CLIF_CONNECTED

mercurial