summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Maudsley <richard.maudsley@isode.com>2014-01-23 15:04:26 (GMT)
committerRichard Maudsley <richard.maudsley@isode.com>2014-01-23 15:04:26 (GMT)
commit82ca99c1a902dee62f591ddcbde0ecac7ef2c8a5 (patch)
tree780bb46429a90e31c2f752ed569a0cc69ddaabae /Swift/Controllers/Chat/ChatMessageParser.cpp
parenta7f73b3a741e558e65d5d9302f33fdedf12f05da (diff)
downloadswift-82ca99c1a902dee62f591ddcbde0ecac7ef2c8a5.zip
swift-82ca99c1a902dee62f591ddcbde0ecac7ef2c8a5.tar.bz2
Fix to MUC/Chat flag in Hightlight Rules.sandbox/rm/highlighteditor
Change-Id: I81589a4d032f26af6519c5505f04c4bf2c0d86c9
Diffstat (limited to 'Swift/Controllers/Chat/ChatMessageParser.cpp')
-rw-r--r--Swift/Controllers/Chat/ChatMessageParser.cpp9
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 &regex, rule.getKeywordRegex()) {
ChatWindow::ChatMessage newMessage;
foreach (boost::shared_ptr<ChatWindow::ChatMessagePart> part, parsedMessage.getParts()) {