From 0b6e285b6eadc3b1be475071dfc62193d834b58c Mon Sep 17 00:00:00 2001 From: Shiz Date: Sat, 22 Feb 2014 21:04:34 +0100 Subject: [PATCH] Don't throttle connection during registration. --- pydle/features/rfc1459/client.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pydle/features/rfc1459/client.py b/pydle/features/rfc1459/client.py index 17821b8..f2d5d4a 100644 --- a/pydle/features/rfc1459/client.py +++ b/pydle/features/rfc1459/client.py @@ -146,23 +146,28 @@ class RFC1459Support(BasicClient): """ Perform IRC connection registration. """ if self.registered: return - self._registration_attempts += 1 + # Don't throttle during registration, most ircds don't care for flooding during registration, + # and it might speed it up significantly. + self.connection.throttle = False + # Password first. if self.password: self.rawmsg('PASS', self.password) # Then nickname... self.set_nickname(self._attempt_nicknames.pop(0)) - # And now for the rest of the user information. self.rawmsg('USER', self.username, '0', '*', self.realname) def _registration_completed(self, message): """ We're connected and registered. Receive proper nickname and emit fake NICK message. """ if not self.registered: + # Re-enable throttling. self.registered = True + self.connection.throttle = True + target = message.params[0] fakemsg = self._create_message('NICK', target, source=self.nickname) self.on_raw_nick(fakemsg)