- return match(msg.contents(), msg.sender(), msg.type(), msg.flags(), msg.bufferInfo().bufferName(), currentNick, identityNicks);
+ return (_id != other._id || _contents != other._contents || _isRegEx != other._isRegEx || _isCaseSensitive != other._isCaseSensitive
+ || _isEnabled != other._isEnabled || _isInverse != other._isInverse || _sender != other._sender || _chanName != other._chanName);
+ // Don't compare ExpressionMatch objects as they are created as needed from the above
+}
+
+void HighlightRuleManager::HighlightRule::determineExpressions() const
+{
+ // Don't update if not needed
+ if (!_cacheInvalid) {
+ return;
+ }
+
+ // Set up matching rules
+ // Message is either phrase or regex
+ ExpressionMatch::MatchMode contentsMode = _isRegEx ? ExpressionMatch::MatchMode::MatchRegEx : ExpressionMatch::MatchMode::MatchPhrase;
+ // Sender and channel are either multiple wildcard entries or regex
+ ExpressionMatch::MatchMode scopeMode = _isRegEx ? ExpressionMatch::MatchMode::MatchRegEx : ExpressionMatch::MatchMode::MatchMultiWildcard;
+
+ _contentsMatch = ExpressionMatch(_contents, contentsMode, _isCaseSensitive);
+ _senderMatch = ExpressionMatch(_sender, scopeMode, _isCaseSensitive);
+ _chanNameMatch = ExpressionMatch(_chanName, scopeMode, _isCaseSensitive);
+
+ _cacheInvalid = false;