diff options
author | Tobias Markmann <tm@ayena.de> | 2015-01-20 15:17:52 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2015-02-09 22:11:44 (GMT) |
commit | 6b03bde42313bbc45c091930f0c4e6952924308b (patch) | |
tree | 2d4df7629005912231517d6683d3cf2d37e7a9c8 /Swift/Controllers/Chat/ChatController.cpp | |
parent | 6a4e622d9c406ea45bcc8c9740f666ad4a7e589f (diff) | |
download | swift-6b03bde42313bbc45c091930f0c4e6952924308b.zip swift-6b03bde42313bbc45c091930f0c4e6952924308b.tar.bz2 |
Fix sender text that is used for matching highlight rules
Old behavior:
MUC group messages are matched against the nickname as sender.
MUC 1-to-1 messages and classic 1-to-1 messages are matched against the
display name as sender.
New behavior:
MUC group messages are matched against the nickname as sender.
MUC 1-to-1 messages are matched against the nickname as sender.
Classic 1-to-1 messages are matched against the bare JID as sender.
Test-Information:
Tested on Mac OS X 10.9.5 that a chat rule matching a nickname string
and a rule matching a full JID are highlighted correctly.
Change-Id: Icaee2c946e34fceb6b1d40561674030740555de1
Diffstat (limited to 'Swift/Controllers/Chat/ChatController.cpp')
-rw-r--r-- | Swift/Controllers/Chat/ChatController.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Swift/Controllers/Chat/ChatController.cpp b/Swift/Controllers/Chat/ChatController.cpp index 10b7825..d28b29b 100644 --- a/Swift/Controllers/Chat/ChatController.cpp +++ b/Swift/Controllers/Chat/ChatController.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2014 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -430,6 +430,15 @@ void ChatController::handleWhiteboardWindowShow() { eventStream_->send(boost::make_shared<ShowWhiteboardUIEvent>(toJID_)); } +std::string ChatController::senderHighlightNameFromMessage(const JID& from) { + if (isInMUC_) { + return nickResolver_->jidToNick(from); + } + else { + return from.toBare().toString(); + } +} + std::string ChatController::senderDisplayNameFromMessage(const JID& from) { return nickResolver_->jidToNick(from); } |