From b14ea4f051ad7ea2c5fd0951a5d005c0827ae27c Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 3 Mar 2017 15:39:28 -0800 Subject: [PATCH] clientbot: send CAP LS before NICK/USER so that it consistently gets a response before connect Previously, SASL was failing on networks like freenode, as the connection completed before a CAP response was received. (cherry picked from commit 9420f21680058e50a8134eed7a050bb4abb9ae73) --- protocols/clientbot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 4516d79..17212c6 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -73,6 +73,8 @@ class ClientbotWrapperProtocol(Protocol): if sendpass: f('PASS %s' % sendpass) + f('CAP LS 302') + # This is a really gross hack to get the defined NICK/IDENT/HOST/GECOS. # But this connection stuff is done before any of the spawnClient stuff in # services_support fires. @@ -82,8 +84,6 @@ class ClientbotWrapperProtocol(Protocol): f('USER %s 8 * :%s' % (ident, # TODO: per net realnames or hostnames aren't implemented yet. conf.conf["bot"].get("realname", "PyLink Clientbot"))) - f('CAP LS 302') - # Note: clientbot clients are initialized with umode +i by default def spawnClient(self, nick, ident='unknown', host='unknown.host', realhost=None, modes={('i', None)}, server=None, ip='0.0.0.0', realname='', ts=None, opertype=None,