X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcoresessioneventprocessor.cpp;h=7c414ba1563a3356917349ca9b6e9cf5ffe08962;hb=78decd5f8d1a149fc0e62e01bd6b2886e0feadfe;hp=e4621bf4bf81983dd62cf55771bc5fcdd3579cb5;hpb=eabcc4905f991bb372cb2fb125b766802366701a;p=quassel.git diff --git a/src/core/coresessioneventprocessor.cpp b/src/core/coresessioneventprocessor.cpp index e4621bf4..7c414ba1 100644 --- a/src/core/coresessioneventprocessor.cpp +++ b/src/core/coresessioneventprocessor.cpp @@ -415,6 +415,8 @@ void CoreSessionEventProcessor::processIrcEventJoin(IrcEvent *e) if (net->isMe(ircuser)) { net->setChannelJoined(channel); + // Mark the message as Self + e->setFlag(EventManager::Self); // FIXME use event net->putRawLine(net->serverEncode("MODE " + channel)); // we want to know the modes of the channel we just joined, so we ask politely } @@ -540,12 +542,33 @@ void CoreSessionEventProcessor::processIrcEventMode(IrcEvent *e) ircUser->removeUserModes(removeModes); if (e->network()->isMe(ircUser)) { + // Mark the message as Self + e->setFlag(EventManager::Self); coreNetwork(e)->updatePersistentModes(addModes, removeModes); } } } +void CoreSessionEventProcessor::processIrcEventNick(IrcEvent *e) +{ + if (checkParamCount(e, 1)) { + IrcUser *ircuser = e->network()->updateNickFromMask(e->prefix()); + if (!ircuser) { + qWarning() << Q_FUNC_INFO << "Unknown IrcUser!"; + return; + } + + if (e->network()->isMe(ircuser)) { + // Mark the message as Self + e->setFlag(EventManager::Self); + } + + // Actual processing is handled in lateProcessIrcEventNick(), this just sets the event flag + } +} + + void CoreSessionEventProcessor::lateProcessIrcEventNick(IrcEvent *e) { if (checkParamCount(e, 1)) { @@ -566,6 +589,25 @@ void CoreSessionEventProcessor::lateProcessIrcEventNick(IrcEvent *e) } +void CoreSessionEventProcessor::processIrcEventPart(IrcEvent *e) +{ + if (checkParamCount(e, 1)) { + IrcUser *ircuser = e->network()->updateNickFromMask(e->prefix()); + if (!ircuser) { + qWarning() << Q_FUNC_INFO<< "Unknown IrcUser!"; + return; + } + + if (e->network()->isMe(ircuser)) { + // Mark the message as Self + e->setFlag(EventManager::Self); + } + + // Actual processing is handled in lateProcessIrcEventNick(), this just sets the event flag + } +} + + void CoreSessionEventProcessor::lateProcessIrcEventPart(IrcEvent *e) { if (checkParamCount(e, 1)) { @@ -576,8 +618,9 @@ void CoreSessionEventProcessor::lateProcessIrcEventPart(IrcEvent *e) } QString channel = e->params().at(0); ircuser->partChannel(channel); - if (e->network()->isMe(ircuser)) + if (e->network()->isMe(ircuser)) { qobject_cast(e->network())->setChannelParted(channel); + } } } @@ -610,6 +653,11 @@ void CoreSessionEventProcessor::processIrcEventQuit(IrcEvent *e) if (!ircuser) return; + if (e->network()->isMe(ircuser)) { + // Mark the message as Self + e->setFlag(EventManager::Self); + } + QString msg; if (e->params().count() > 0) msg = e->params()[0]; @@ -655,7 +703,13 @@ void CoreSessionEventProcessor::lateProcessIrcEventQuit(IrcEvent *e) void CoreSessionEventProcessor::processIrcEventTopic(IrcEvent *e) { if (checkParamCount(e, 2)) { - e->network()->updateNickFromMask(e->prefix()); + IrcUser *ircuser = e->network()->updateNickFromMask(e->prefix()); + + if (e->network()->isMe(ircuser)) { + // Mark the message as Self + e->setFlag(EventManager::Self); + } + IrcChannel *channel = e->network()->ircChannel(e->params().at(0)); if (channel) channel->setTopic(e->params().at(1));