http://sourceforge.net/projects/python-irclib
"""
-# TO-DO: use the CHANLIMIT field in 005.
-
# These things might need tuning
HOST = "localhost"
DISCONNECT_TTL = (24 * 60 * 60) # Time to live, seconds from last connect
UNSEEN_TTL = 60 # Time to live, seconds since first request
CHANNEL_MAX = 18 # Max channels open per socket (freenet limit)
-ANTI_FLOOD_DELAY = 0.025 # Anti-flood delay after transmissions, seconds
+ANTI_FLOOD_DELAY = 0.125 # Anti-flood delay after transmissions, seconds
# No user-serviceable parts below this line
self.last_xmit = time.time()
self.last_ping = time.time()
self.channels_joined = []
+ self.channel_max = CHANNEL_MAX
# The consumer thread
self.queue = Queue.Queue()
self.thread = threading.Thread(target=self.dequeue)
return channel in self.channels_joined
def accepting(self):
"Can this connection accept new channel joins?"
- return len(self.channels_joined) < CHANNEL_MAX
+ return len(self.channels_joined) < self.channel_max
class Target():
"Represent a transmission target."
for lump in event.arguments():
if lump.startswith("DEAF="):
connection.mode(connection.context.nickname(), "+"+lump[5:])
+ elif lump.startswith("CHANLIMIT=#:"):
+ connection.context.channel_max = int(lump[12:])
def drop_server(self, servername, port):
"Drop a server out of the server map."
del self.servers[(servername, port)]