Implement counting nickname changes and remove check on listener
This commit is contained in:
parent
da6c45f093
commit
5b1e3c6fb1
|
@ -101,6 +101,10 @@ class IRCBot(IRCClient):
|
|||
newnick = nickname + "_"
|
||||
return newnick
|
||||
|
||||
def nickChanged(self, nick):
|
||||
self.nickname = nick
|
||||
count.event(self.name, "selfnick")
|
||||
|
||||
def irc_ERR_NICKNAMEINUSE(self, prefix, params):
|
||||
self._attemptedNick = self.alterCollidedNick(self._attemptedNick)
|
||||
self.setNick(self._attemptedNick)
|
||||
|
|
|
@ -34,13 +34,10 @@ class Server(Protocol):
|
|||
def connectionLost(self, reason):
|
||||
self.authed = False
|
||||
log("Connection lost from %s:%s -- %s" % (self.addr.host, self.addr.port, reason.getErrorMessage()))
|
||||
if not listener == None:
|
||||
if self.addr in connections.keys():
|
||||
del connections[self.addr]
|
||||
else:
|
||||
warn("Tried to remove a non-existant connection.")
|
||||
if self.addr in connections.keys():
|
||||
del connections[self.addr]
|
||||
else:
|
||||
warn("Tried to remove a connection from a listener that wasn't running.")
|
||||
warn("Tried to remove a non-existant connection.")
|
||||
if self.addr in MonitorPool:
|
||||
MonitorPool.remove(self.addr)
|
||||
|
||||
|
|
Loading…
Reference in New Issue