/***************************************************************************
- * Copyright (C) 2005-2018 by the Quassel Project *
+ * Copyright (C) 2005-2020 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include <QString>
#include <QStringList>
-bool NickHighlightMatcher::match(const QString &string, const NetworkId &netId,
- const QString ¤tNick, const QStringList &identityNicks) const
+bool NickHighlightMatcher::match(const QString& string, const NetworkId& netId, const QString& currentNick, const QStringList& identityNicks) const
{
// Never match for no nicknames
if (_highlightMode == HighlightNickType::NoNick) {
determineExpressions(netId, currentNick, identityNicks);
// Check for a match
- if (_nickMatchCache[netId].matcher.isValid()
- && _nickMatchCache[netId].matcher.match(string)) {
+ if (_nickMatchCache[netId].matcher.isValid() && _nickMatchCache[netId].matcher.match(string)) {
// Nick matcher is valid and match found
return true;
}
return false;
}
-
-void NickHighlightMatcher::determineExpressions(const NetworkId &netId, const QString ¤tNick,
- const QStringList &identityNicks) const
+void NickHighlightMatcher::determineExpressions(const NetworkId& netId, const QString& currentNick, const QStringList& identityNicks) const
{
// Don't do anything for no nicknames
if (_highlightMode == HighlightNickType::NoNick) {
}
// Only update if needed (check nickname config, current nick, identity nicks for change)
- if (_nickMatchCache.contains(netId)
- && _nickMatchCache[netId].nickCurrent == currentNick
- && _nickMatchCache[netId].identityNicks == identityNicks) {
+ if (_nickMatchCache.contains(netId) && _nickMatchCache[netId].nickCurrent == currentNick
+ && _nickMatchCache[netId].identityNicks == identityNicks) {
return;
}
}
// Set up phrase matcher, joining with newlines
- _nickMatchCache[netId].matcher =
- ExpressionMatch(nickList.join("\n"), ExpressionMatch::MatchMode::MatchMultiPhrase,
- _isCaseSensitive);
+ _nickMatchCache[netId].matcher = ExpressionMatch(nickList.join("\n"), ExpressionMatch::MatchMode::MatchMultiPhrase, _isCaseSensitive);
_nickMatchCache[netId].nickCurrent = currentNick;
_nickMatchCache[netId].identityNicks = identityNicks;