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 + "_"
|
newnick = nickname + "_"
|
||||||
return newnick
|
return newnick
|
||||||
|
|
||||||
|
def nickChanged(self, nick):
|
||||||
|
self.nickname = nick
|
||||||
|
count.event(self.name, "selfnick")
|
||||||
|
|
||||||
def irc_ERR_NICKNAMEINUSE(self, prefix, params):
|
def irc_ERR_NICKNAMEINUSE(self, prefix, params):
|
||||||
self._attemptedNick = self.alterCollidedNick(self._attemptedNick)
|
self._attemptedNick = self.alterCollidedNick(self._attemptedNick)
|
||||||
self.setNick(self._attemptedNick)
|
self.setNick(self._attemptedNick)
|
||||||
|
|
|
@ -34,13 +34,10 @@ class Server(Protocol):
|
||||||
def connectionLost(self, reason):
|
def connectionLost(self, reason):
|
||||||
self.authed = False
|
self.authed = False
|
||||||
log("Connection lost from %s:%s -- %s" % (self.addr.host, self.addr.port, reason.getErrorMessage()))
|
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():
|
if self.addr in connections.keys():
|
||||||
del connections[self.addr]
|
del connections[self.addr]
|
||||||
else:
|
else:
|
||||||
warn("Tried to remove a non-existant connection.")
|
warn("Tried to remove a non-existant connection.")
|
||||||
else:
|
|
||||||
warn("Tried to remove a connection from a listener that wasn't running.")
|
|
||||||
if self.addr in MonitorPool:
|
if self.addr in MonitorPool:
|
||||||
MonitorPool.remove(self.addr)
|
MonitorPool.remove(self.addr)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue