From f86e25d9fbbdd32aa838840aadcbc9daf7ed334a Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 5 Sep 2015 12:43:22 +0200 Subject: [PATCH] Prevent authentication hanging if the server supports no capability the bot asks. --- src/irclib.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/irclib.py b/src/irclib.py index fffa6479c..672e033e3 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -1091,8 +1091,10 @@ class Irc(IrcCommandDispatcher, log.Firewalled): # NOTE: Capabilities are requested in alphabetic order, because # sets are unordered, and their "order" is nondeterministic. # This is needed for the tests. - self.sendMsg(ircmsgs.IrcMsg(command='CAP', - args=('REQ', ' '.join(sorted(common_supported_capabilities))))) + if common_supported_capabilities: + caps = ' '.join(sorted(common_supported_capabilities)) + self.sendMsg(ircmsgs.IrcMsg(command='CAP', + args=('REQ', caps))) else: log.warning('Bad CAP LS from server: %r', msg) return