From 43be7a2f0a6899210f70389665d9802652b02ae8 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 1 Sep 2012 08:37:37 -0400 Subject: [PATCH] Shorten the nick negotiation when multiple instances are active. --- irker | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/irker b/irker index 2d24958..01d0585 100755 --- a/irker +++ b/irker @@ -74,13 +74,13 @@ version = "1.0" # . class Connection: - def __init__(self, irkerd, servername, port): + def __init__(self, irkerd, servername, port, nick_base=1): self.irker = irkerd self.servername = servername self.port = port + self.nick_trial = nick_base self.connection = None self.status = "unseen" - self.nick_trial = 1 self.last_xmit = time.time() self.last_ping = time.time() self.channels_joined = [] @@ -214,7 +214,8 @@ class Dispatcher: if not eligibles: newconn = Connection(self.irker, self.servername, - self.port) + self.port, + len(self.connections)+1) self.connections.append(newconn) eligibles = [newconn] eligibles[0].enqueue(channel, message) -- 2.26.2