X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fircserverhandler.cpp;h=138b75342d3efdc7688b9be7349ebf41e1998692;hp=5af0c5ab9b9890f51f9ff733b7b784cf90ba1704;hb=7a1202a4d6b127521ac1d460aed45ffe9383ebf0;hpb=b5385b3ddf6f0e8df8f0af7275b59dcc1fcd0ed1 diff --git a/src/core/ircserverhandler.cpp b/src/core/ircserverhandler.cpp index 5af0c5ab..138b7534 100644 --- a/src/core/ircserverhandler.cpp +++ b/src/core/ircserverhandler.cpp @@ -259,7 +259,10 @@ void IrcServerHandler::handleMode(const QString &prefix, const QList void IrcServerHandler::handleNick(const QString &prefix, const QList ¶ms) { IrcUser *ircuser = network()->updateNickFromMask(prefix); - Q_ASSERT(ircuser); + if(!ircuser) { + qWarning() << "IrcServerHandler::handleNick(): Unknown IrcUser!"; + return; + } QString newnick = serverDecode(params[0]); QString oldnick = ircuser->nick(); @@ -293,7 +296,10 @@ void IrcServerHandler::handleNotice(const QString &prefix, const QList ¶ms) { IrcUser *ircuser = network()->updateNickFromMask(prefix); QString channel = serverDecode(params[0]); - Q_ASSERT(ircuser); + if(!ircuser) { + qWarning() << "IrcServerHandler::handlePart(): Unknown IrcUser!"; + return; + } ircuser->partChannel(channel); @@ -312,7 +318,10 @@ void IrcServerHandler::handlePing(const QString &prefix, const QList void IrcServerHandler::handlePrivmsg(const QString &prefix, const QList ¶ms) { IrcUser *ircuser = network()->updateNickFromMask(prefix); - Q_ASSERT(ircuser); + if(!ircuser) { + qWarning() << "IrcServerHandler::handlePrivmsg(): Unknown IrcUser!"; + return; + } if(params.isEmpty()) { qWarning() << "IrcServerHandler::handlePrivmsg(): received PRIVMSG without target or message from:" << prefix; @@ -380,7 +389,7 @@ void IrcServerHandler::handle005(const QString &prefix, const QList qWarning() << "IrcServerHandler::handle005(): received RPL_ISUPPORT (005) with too few parameters:" << serverDecode(params); return; } - + QString rpl_isupport_suffix = serverDecode(params.last()); if(!rpl_isupport_suffix.toLower().contains("supported")) { qWarning() << "Received invalid RPL_ISUPPORT! Suffix is:" << rpl_isupport_suffix << "Excpected: are supported by this server"; @@ -397,6 +406,33 @@ void IrcServerHandler::handle005(const QString &prefix, const QList } } +/* RPL_UMODEIS - " []" */ +void IrcServerHandler::handle221(const QString &prefix, const QList ¶ms) { + Q_UNUSED(prefix) + //TODO: save information in network object + emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("%1").arg(serverDecode(params).join(" "))); +} + +/* RPL_STATSCONN - "Highest connection cout: 8000 (7999 clients)" */ +void IrcServerHandler::handle250(const QString &prefix, const QList ¶ms) { + Q_UNUSED(prefix) + //TODO: save information in network object + emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("%1").arg(serverDecode(params).join(" "))); +} + +/* RPL_LOCALUSERS - "Current local user: 5024 Max: 7999 */ +void IrcServerHandler::handle265(const QString &prefix, const QList ¶ms) { + Q_UNUSED(prefix) + //TODO: save information in network object + emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("%1").arg(serverDecode(params).join(" "))); +} + +/* RPL_GLOBALUSERS - "Current global users: 46093 Max: 47650" */ +void IrcServerHandler::handle266(const QString &prefix, const QList ¶ms) { + Q_UNUSED(prefix) + //TODO: save information in network object + emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("%1").arg(serverDecode(params).join(" "))); +} /* WHOIS-Message: @@ -442,6 +478,28 @@ void IrcServerHandler::handle301(const QString &prefix, const QList } } +/* RPL_WHOISSERVICE - " is registered nick" */ +void IrcServerHandler::handle307(const QString &prefix, const QList ¶ms) { + Q_UNUSED(prefix) + QString whoisServiceReply = serverDecode(params).join(" "); + IrcUser *ircuser = network()->ircUser(serverDecode(params[0])); + if(ircuser) { + ircuser->setWhoisServiceReply(whoisServiceReply); + } + emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Whois] %1").arg(whoisServiceReply)); +} + +/* RPL_SUSERHOST - " is available for help." */ +void IrcServerHandler::handle310(const QString &prefix, const QList ¶ms) { + Q_UNUSED(prefix) + QString suserHost = serverDecode(params).join(" "); + IrcUser *ircuser = network()->ircUser(serverDecode(params[0])); + if(ircuser) { + ircuser->setSuserHost(suserHost); + } + emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Whois] %1").arg(suserHost)); +} + /* RPL_WHOISUSER - " * :" */ void IrcServerHandler::handle311(const QString &prefix, const QList ¶ms) { Q_UNUSED(prefix) @@ -494,10 +552,15 @@ void IrcServerHandler::handle314(const QString &prefix, const QList /* RPL_ENDOFWHO: " :End of WHO list" */ void IrcServerHandler::handle315(const QString &prefix, const QList ¶ms) { - Q_UNUSED(prefix) - // FIXME temporarily made silent - Q_UNUSED(params) - // emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Who] %1").arg(serverDecode(params).join(" "))); + Q_UNUSED(prefix); + QStringList p = serverDecode(params); + if(p.count()) { + if(networkConnection()->setAutoWhoDone(p[0])) { + return; // stay silent + } + p.takeLast(); // should be "End of WHO list" + emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Who] End of /WHO list for %1").arg(p.join(" "))); + } } /* RPL_WHOISIDLE - " :seconds idle" @@ -602,8 +665,9 @@ void IrcServerHandler::handle352(const QString &prefix, const QList ircuser->setRealName(serverDecode(params.last()).section(" ", 1)); } - // FIXME temporarily made silent - //emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Who] %1").arg(serverDecode(params).join(" "))); + if(!networkConnection()->isAutoWhoInProgress(channel)) { + emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("[Who] %1").arg(serverDecode(params).join(" "))); + } } /* RPL_NAMREPLY */