X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fnickhighlightmatcher.cpp;h=23f0084b17fa236c563c39d602827a7ba46eb4be;hp=a9459237d0cc083362793cb96e7c343a2e5dc08d;hb=HEAD;hpb=83e64467da81f69bef190f7492f49b6b4e661885 diff --git a/src/common/nickhighlightmatcher.cpp b/src/common/nickhighlightmatcher.cpp index a9459237..8063632f 100644 --- a/src/common/nickhighlightmatcher.cpp +++ b/src/common/nickhighlightmatcher.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -24,8 +24,7 @@ #include #include -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) { @@ -41,8 +40,7 @@ bool NickHighlightMatcher::match(const QString &string, const NetworkId &netId, 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; } @@ -50,9 +48,7 @@ bool NickHighlightMatcher::match(const QString &string, const NetworkId &netId, 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) { @@ -60,9 +56,8 @@ void NickHighlightMatcher::determineExpressions(const NetworkId &netId, const QS } // 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; } @@ -78,9 +73,7 @@ void NickHighlightMatcher::determineExpressions(const NetworkId &netId, const QS } // 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;