X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoresessioneventprocessor.cpp;h=3abae9027284bbe0dd26222cb7d661d92a24ac22;hp=bc7d1fbf893194aa65adf10b36234bd0b87de31c;hb=615c5621f63360ef11c9cc3519c0462d8b5ec85b;hpb=e49f87a6227dc6f82c17126a886cfc83ccf5e3ed diff --git a/src/core/coresessioneventprocessor.cpp b/src/core/coresessioneventprocessor.cpp index bc7d1fbf..3abae902 100644 --- a/src/core/coresessioneventprocessor.cpp +++ b/src/core/coresessioneventprocessor.cpp @@ -23,6 +23,7 @@ #include "corenetwork.h" #include "coresession.h" #include "ircevent.h" +#include "ircuser.h" CoreSessionEventProcessor::CoreSessionEventProcessor(CoreSession *session) : QObject(session), @@ -235,6 +236,92 @@ void CoreSessionEventProcessor::processIrcEvent306(IrcEvent *e) { me->setAway(true); } +/* RPL_WHOISSERVICE - " is registered nick" */ +void CoreSessionEventProcessor::processIrcEvent307(IrcEvent *e) { + if(!checkParamCount(e, 1)) + return; + + IrcUser *ircuser = e->network()->ircUser(e->params().at(0)); + if(ircuser) + ircuser->setWhoisServiceReply(e->params().join(" ")); +} + +/* RPL_SUSERHOST - " is available for help." */ +void CoreSessionEventProcessor::processIrcEvent310(IrcEvent *e) { + if(!checkParamCount(e, 1)) + return; + + IrcUser *ircuser = e->network()->ircUser(e->params().at(0)); + if(ircuser) + ircuser->setSuserHost(e->params().join(" ")); +} + +/* RPL_WHOISUSER - " * :" */ +void CoreSessionEventProcessor::processIrcEvent311(IrcEvent *e) { + if(!checkParamCount(e, 3)) + return; + + IrcUser *ircuser = e->network()->ircUser(e->params().at(0)); + if(ircuser) { + ircuser->setUser(e->params().at(1)); + ircuser->setHost(e->params().at(2)); + ircuser->setRealName(e->params().last()); + } +} + +/* RPL_WHOISSERVER - " :" */ +void CoreSessionEventProcessor::processIrcEvent312(IrcEvent *e) { + if(!checkParamCount(e, 2)) + return; + + IrcUser *ircuser = e->network()->ircUser(e->params().at(0)); + if(ircuser) + ircuser->setServer(e->params().at(1)); +} + +/* RPL_WHOISOPERATOR - " :is an IRC operator" */ +void CoreSessionEventProcessor::processIrcEvent313(IrcEvent *e) { + if(!checkParamCount(e, 1)) + return; + + IrcUser *ircuser = e->network()->ircUser(e->params().at(0)); + if(ircuser) + ircuser->setIrcOperator(e->params().last()); +} + +/* RPL_ENDOFWHO: " :End of WHO list" */ +void CoreSessionEventProcessor::processIrcEvent315(IrcEvent *e) { + if(!checkParamCount(e, 1)) + return; + + if(coreNetwork(e)->setAutoWhoDone(e->params()[0])) + e->setFlag(EventManager::Silent); +} + +/* RPL_WHOISIDLE - " :seconds idle" + (real life: " :seconds idle, signon time) */ +void CoreSessionEventProcessor::processIrcEvent317(IrcEvent *e) { + if(!checkParamCount(e, 2)) + return; + + QDateTime loginTime; + + int idleSecs = e->params()[1].toInt(); + if(e->params().count() > 3) { // if we have more then 3 params we have the above mentioned "real life" situation + int logintime = e->params()[2].toInt(); + loginTime = QDateTime::fromTime_t(logintime); + } + + IrcUser *ircuser = e->network()->ircUser(e->params()[0]); + if(ircuser) { + ircuser->setIdleTime(e->timestamp().addSecs(-idleSecs)); + if(loginTime.isValid()) + ircuser->setLoginTime(loginTime); + } +} + + + /* template void CoreSessionEventProcessor::processIrcEvent(IrcEvent *e) { if(!checkParamCount(e, 1))