X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoresessioneventprocessor.cpp;h=ed2904cba692022e25abc932ed8c9319b0621653;hp=f3e94e8512bbdb0d5fe464d3fd86a74101a743e0;hb=f8ebd4fd9a59bcb34a6ce45ce1f0b4a22beae884;hpb=77611288238aef3777466f5d647dd2780f5f72d1 diff --git a/src/core/coresessioneventprocessor.cpp b/src/core/coresessioneventprocessor.cpp index f3e94e85..ed2904cb 100644 --- a/src/core/coresessioneventprocessor.cpp +++ b/src/core/coresessioneventprocessor.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2014 by the Quassel Project * + * Copyright (C) 2005-2015 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -144,19 +144,25 @@ void CoreSessionEventProcessor::processIrcEventCap(IrcEvent *e) // additional CAP messages (ls, multi-prefix, et cetera). if (e->params().count() == 3) { - if (e->params().at(2).startsWith("sasl")) { // Freenode (at least) sends "sasl " with a trailing space for some reason! - // FIXME use event - // if the current identity has a cert set, use SASL EXTERNAL + if (e->params().at(1) == "NAK") { + // CAP REQ sasl was denied + coreNetwork(e)->putRawLine("CAP END"); + } + else if (e->params().at(1) == "ACK") { + if (e->params().at(2).startsWith("sasl")) { // Freenode (at least) sends "sasl " with a trailing space for some reason! + // FIXME use event + // if the current identity has a cert set, use SASL EXTERNAL #ifdef HAVE_SSL - if (!coreNetwork(e)->identityPtr()->sslCert().isNull()) { - coreNetwork(e)->putRawLine(coreNetwork(e)->serverEncode("AUTHENTICATE EXTERNAL")); - } else { + if (!coreNetwork(e)->identityPtr()->sslCert().isNull()) { + coreNetwork(e)->putRawLine(coreNetwork(e)->serverEncode("AUTHENTICATE EXTERNAL")); + } else { #endif - // Only working with PLAIN atm, blowfish later - coreNetwork(e)->putRawLine(coreNetwork(e)->serverEncode("AUTHENTICATE PLAIN")); + // Only working with PLAIN atm, blowfish later + coreNetwork(e)->putRawLine(coreNetwork(e)->serverEncode("AUTHENTICATE PLAIN")); #ifdef HAVE_SSL - } + } #endif + } } } } @@ -367,7 +373,8 @@ void CoreSessionEventProcessor::processIrcEventPing(IrcEvent *e) { QString param = e->params().count() ? e->params().first() : QString(); // FIXME use events - coreNetwork(e)->putRawLine("PONG " + coreNetwork(e)->serverEncode(param)); + // Take priority so this won't get stuck behind other queued messages. + coreNetwork(e)->putRawLine("PONG " + coreNetwork(e)->serverEncode(param), true); } @@ -442,6 +449,21 @@ void CoreSessionEventProcessor::processIrcEventTopic(IrcEvent *e) } } +/* ERROR - "ERROR :reason" +Example: ERROR :Closing Link: nickname[xxx.xxx.xxx.xxx] (Large base64 image paste.) +See https://tools.ietf.org/html/rfc2812#section-3.7.4 */ +void CoreSessionEventProcessor::processIrcEventError(IrcEvent *e) +{ + if (!checkParamCount(e, 1)) + return; + + if (coreNetwork(e)->disconnectExpected()) { + // During QUIT, the server should send an error (often, but not always, "Closing Link"). As + // we're expecting it, don't show this to the user. + e->setFlag(EventManager::Silent); + } +} + #ifdef HAVE_QCA2 void CoreSessionEventProcessor::processKeyEvent(KeyEvent *e) @@ -1089,5 +1111,5 @@ void CoreSessionEventProcessor::handleCtcpTime(CtcpEvent *e) void CoreSessionEventProcessor::handleCtcpVersion(CtcpEvent *e) { e->setReply(QString("Quassel IRC %1 (built on %2) -- http://www.quassel-irc.org") - .arg(Quassel::buildInfo().plainVersionString).arg(Quassel::buildInfo().buildDate)); + .arg(Quassel::buildInfo().plainVersionString).arg(Quassel::buildInfo().commitDate)); }