X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fircserverhandler.cpp;h=9bdb3c674fee457585333dbfdda4436f80e10d8a;hp=5034a71456ab642e66f07b4e517ba56d9aaa1304;hb=c30f8eb1f1d360284b38016655cdb6a3e40db8ed;hpb=c9ee7972b2c9b84e37f363befa05bf5fb04114af diff --git a/src/core/ircserverhandler.cpp b/src/core/ircserverhandler.cpp index 5034a714..9bdb3c67 100644 --- a/src/core/ircserverhandler.cpp +++ b/src/core/ircserverhandler.cpp @@ -22,6 +22,7 @@ #include "util.h" #include "coresession.h" +#include "coreirclisthelper.h" #include "networkconnection.h" #include "network.h" #include "identity.h" @@ -144,7 +145,7 @@ void IrcServerHandler::defaultHandler(QString cmd, const QString &prefix, const break; } // Ignore these commands. - case 366: case 376: + case 321: case 366: case 376: break; // Everything else will be marked in red, so we can add them somewhere. @@ -433,7 +434,6 @@ void IrcServerHandler::handle005(const QString &prefix, const QList const int numParams = params.size(); if(numParams < 1) { qWarning() << "IrcServerHandler::handle005(): received RPL_ISUPPORT (005) with too few parameters:" << serverDecode(params); - return; } QString rpl_isupport_suffix = serverDecode(params.last()); @@ -723,6 +723,37 @@ void IrcServerHandler::handle320(const QString &prefix, const QList emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Whois] %1").arg(serverDecode(params).join(" "))); } +/* RPL_LIST - " <# visible> :" */ +void IrcServerHandler::handle322(const QString &prefix, const QList ¶ms) { + Q_UNUSED(prefix) + QString channelName; + quint32 userCount = 0; + QString topic; + + int paramCount = params.count(); + switch(paramCount) { + case 3: + topic = serverDecode(params[2]); + case 2: + userCount = serverDecode(params[1]).toUInt(); + case 1: + channelName = serverDecode(params[0]); + default: + break; + } + if(!networkConnection()->coreSession()->ircListHelper()->addChannel(network()->networkId(), channelName, userCount, topic)) + emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("Channel %1 has %2 users. Topic is: %3").arg(channelName).arg(userCount).arg(topic)); +} + +/* RPL_LISTEND ":End of LIST" */ +void IrcServerHandler::handle323(const QString &prefix, const QList ¶ms) { + Q_UNUSED(prefix) + Q_UNUSED(params) + + if(!networkConnection()->coreSession()->ircListHelper()->endOfChannelList(network()->networkId())) + emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("End of channel list")); +} + /* RPL_CHANNELMODEIS - " " */ void IrcServerHandler::handle324(const QString &prefix, const QList ¶ms) { Q_UNUSED(prefix);