diff options
Diffstat (limited to 'Swift/Controllers/Chat/ChatMessageParser.cpp')
| -rw-r--r-- | Swift/Controllers/Chat/ChatMessageParser.cpp | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/Swift/Controllers/Chat/ChatMessageParser.cpp b/Swift/Controllers/Chat/ChatMessageParser.cpp index a43ef0e..3af505b 100644 --- a/Swift/Controllers/Chat/ChatMessageParser.cpp +++ b/Swift/Controllers/Chat/ChatMessageParser.cpp @@ -20,8 +20,8 @@  namespace Swift { -	ChatMessageParser::ChatMessageParser(const std::map<std::string, std::string>& emoticons, HighlightRulesListPtr highlightRules) -	: emoticons_(emoticons), highlightRules_(highlightRules) +	ChatMessageParser::ChatMessageParser(const std::map<std::string, std::string>& emoticons, HighlightRulesListPtr highlightRules, bool mucMode) +	: emoticons_(emoticons), highlightRules_(highlightRules), mucMode_(mucMode)  	{  	} @@ -128,6 +128,11 @@ namespace Swift {  		for (size_t i = 0; i < highlightRules_->getSize(); ++i) {  			const HighlightRule& rule = highlightRules_->getRule(i); +			if (rule.getMatchMUC() && !mucMode_) { +				continue; /* this rule only applies to MUC's, and this is a CHAT */ +			} else if (rule.getMatchChat() && mucMode_) { +				continue; /* this rule only applies to CHAT's, and this is a MUC */ +			}  			foreach(const boost::regex ®ex, rule.getKeywordRegex()) {  				ChatWindow::ChatMessage newMessage;  				foreach (boost::shared_ptr<ChatWindow::ChatMessagePart> part, parsedMessage.getParts()) { | 
 Swift
 Swift