/***************************************************************************
- * Copyright (C) 2005-2012 by the Quassel Project *
+ * Copyright (C) 2005-2018 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include "messagemodel.h"
#include "network.h"
-const int progressUpdateDelay = 100; // ms between progress signal updates
-
QtUiMessageProcessor::QtUiMessageProcessor(QObject *parent)
: AbstractMessageProcessor(parent),
_processing(false),
while (msgIter != msgIterEnd) {
checkForHighlight(*msgIter);
preProcess(*msgIter);
- msgIter++;
+ ++msgIter;
}
Client::messageModel()->insertMessages(msgs);
return;
}
foreach(QString nickname, nickList) {
QRegExp nickRegExp("(^|\\W)" + QRegExp::escape(nickname) + "(\\W|$)", _nicksCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
- if (nickRegExp.indexIn(msg.contents()) >= 0) {
+ if (nickRegExp.indexIn(stripFormatCodes(msg.contents())) >= 0) {
msg.setFlags(msg.flags() | Message::Highlight);
return;
}
if (!rule.isEnabled)
continue;
- if (rule.chanName.size() > 0 && rule.chanName.compare(".*") != 0) {
- if (rule.chanName.startsWith("!")) {
- QRegExp rx(rule.chanName.mid(1), Qt::CaseInsensitive);
- if (rx.exactMatch(msg.bufferInfo().bufferName()))
- continue;
- }
- else {
- QRegExp rx(rule.chanName, Qt::CaseInsensitive);
- if (!rx.exactMatch(msg.bufferInfo().bufferName()))
- continue;
- }
+ if (!rule.chanName.isEmpty()
+ && !scopeMatch(msg.bufferInfo().bufferName(), rule.chanName,
+ rule.isRegExp, rule.caseSensitive)) {
+ // A channel name rule is specified and does NOT match the current buffer name, skip
+ // this rule
+ continue;
}
QRegExp rx;
else {
rx = QRegExp("(^|\\W)" + QRegExp::escape(rule.name) + "(\\W|$)", rule.caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
}
- bool match = (rx.indexIn(msg.contents()) >= 0);
+ bool match = (rx.indexIn(stripFormatCodes(msg.contents())) >= 0);
if (match) {
msg.setFlags(msg.flags() | Message::Highlight);
return;
rule["CS"].toBool() ? Qt::CaseSensitive : Qt::CaseInsensitive,
rule["RegEx"].toBool(),
rule["Channel"].toString());
- iter++;
+ ++iter;
}
}