Fix SASL auth with Freenode
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 19 Feb 2013 20:29:02 +0000 (21:29 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 19 Feb 2013 20:29:02 +0000 (21:29 +0100)
Looks like Freenode adds a trailing space to its CAP ACK reply, so Quassel
would hang after we don't trim incoming messages anymore.

I don't particularly like the startsWith() workaround, but I guess we'll need
a more capable parser anyway, should we support more caps in the future...

src/core/coresessioneventprocessor.cpp

index c9a7365..07362b6 100644 (file)
@@ -129,7 +129,7 @@ void CoreSessionEventProcessor::processIrcEventCap(IrcEvent *e)
     // additional CAP messages (ls, multi-prefix, et cetera).
 
     if (e->params().count() == 3) {
-        if (e->params().at(2) == "sasl") {
+        if (e->params().at(2).startsWith("sasl")) { // Freenode (at least) sends "sasl " with a trailing space for some reason!
             // FIXME use event
             coreNetwork(e)->putRawLine(coreNetwork(e)->serverEncode("AUTHENTICATE PLAIN")); // Only working with PLAIN atm, blowfish later
         }