X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtuimessageprocessor.cpp;h=0e0dca58d6e528f9d6b1ccfb3856463468f0a863;hp=40d9c2840141d2656730144887ca4675923e545f;hb=3cc8b9030841cc3084ec6707a01f3b44ee58b8b9;hpb=9f91e0dd3c4eb5c2e2dedfc8d36a068d433d51b1 diff --git a/src/qtui/qtuimessageprocessor.cpp b/src/qtui/qtuimessageprocessor.cpp index 40d9c284..0e0dca58 100644 --- a/src/qtui/qtuimessageprocessor.cpp +++ b/src/qtui/qtuimessageprocessor.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 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 * @@ -57,8 +57,7 @@ void QtUiMessageProcessor::reset() void QtUiMessageProcessor::process(Message &msg) { - if (!Client::isCoreFeatureEnabled(Quassel::Feature::CoreSideHighlights)) - checkForHighlight(msg); + checkForHighlight(msg); preProcess(msg); Client::messageModel()->insertMessage(msg); } @@ -69,8 +68,7 @@ void QtUiMessageProcessor::process(QList &msgs) QList::iterator msgIter = msgs.begin(); QList::iterator msgIterEnd = msgs.end(); while (msgIter != msgIterEnd) { - if (!Client::isCoreFeatureEnabled(Quassel::Feature::CoreSideHighlights)) - checkForHighlight(*msgIter); + checkForHighlight(*msgIter); preProcess(*msgIter); ++msgIter; } @@ -143,17 +141,12 @@ void QtUiMessageProcessor::checkForHighlight(Message &msg) 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;