+ break;
+
+ case EventManager::IrcEventNotice:
+ defaultHandling = false;
+
+ if (checkParamCount(cmd, params, 2)) {
+ QStringList targets = net->serverDecode(params.at(0)).split(',', QString::SkipEmptyParts);
+ QStringList::const_iterator targetIter;
+ for (targetIter = targets.constBegin(); targetIter != targets.constEnd(); ++targetIter) {
+ QString target = *targetIter;
+
+ // special treatment for welcome messages like:
+ // :ChanServ!ChanServ@services. NOTICE egst :[#apache] Welcome, this is #apache. Please read the in-channel topic message. This channel is being logged by IRSeekBot. If you have any question please see http://blog.freenode.net/?p=68
+ if (!net->isChannelName(target)) {
+ QString decMsg = net->serverDecode(params.at(1));
+ QRegExp welcomeRegExp("^\\[([^\\]]+)\\] ");
+ if (welcomeRegExp.indexIn(decMsg) != -1) {
+ QString channelname = welcomeRegExp.cap(1);
+ decMsg = decMsg.mid(welcomeRegExp.matchedLength());
+ CoreIrcChannel *chan = static_cast<CoreIrcChannel *>(net->ircChannel(channelname)); // we only have CoreIrcChannels in the core, so this cast is safe
+ if (chan && !chan->receivedWelcomeMsg()) {
+ chan->setReceivedWelcomeMsg();
+ events << new MessageEvent(Message::Notice, net, decMsg, prefix, channelname, Message::None, e->timestamp());
+ continue;
+ }
+ }
+ }
+
+ if (prefix.isEmpty() || target == "AUTH") {
+ target = QString();
+ }
+ else {
+ if (!target.isEmpty() && net->prefixes().contains(target.at(0)))
+ target = target.mid(1);
+ if (!net->isChannelName(target))
+ target = nickFromMask(prefix);
+ }