Strip format codes from message content when checking for highlights.
This fixes color-coded messages not triggering highlights, e.g.
messages from the qAnnounce bot in #quassel.
Closes GH-211.
(cherry picked from commit
f34bb7b60263683e8527b7b19cc5d1590390c4b1)
}
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;
}
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;