diff options
author | Tobias Markmann <tm@ayena.de> | 2017-03-01 14:21:53 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2017-03-02 13:01:51 (GMT) |
commit | 901ca8337c983f098394c7d4889f74aad452b1d0 (patch) | |
tree | 1da0a861f511a05bdd621cb490132991211e10f6 /Swift/Controllers/Chat/MUCController.cpp | |
parent | 1eac9453d347dea9a1d6490ff6a538291f5d3999 (diff) | |
download | swift-901ca8337c983f098394c7d4889f74aad452b1d0.zip swift-901ca8337c983f098394c7d4889f74aad452b1d0.tar.bz2 |
Fix keyword highlights not issuing system notifications
Adjusted the MUCController tests accordingly, as self-mentions
in group chats have been case insensitive and are now
case sensitive.
Test-Information:
Tested on macOS 10.12.3 with Qt 5.7.1, that with a highlight
rule for the ‘Swift’ keyword, a system notification is generated
when the app is inactive.
Change-Id: I325b682c5afa81e05eec8cf3a8a15b2ff0303e5c
Diffstat (limited to 'Swift/Controllers/Chat/MUCController.cpp')
-rw-r--r-- | Swift/Controllers/Chat/MUCController.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Swift/Controllers/Chat/MUCController.cpp b/Swift/Controllers/Chat/MUCController.cpp index c476cf3..8fa98f6 100644 --- a/Swift/Controllers/Chat/MUCController.cpp +++ b/Swift/Controllers/Chat/MUCController.cpp @@ -565,62 +565,62 @@ void MUCController::preHandleIncomingMessage(std::shared_ptr<MessageEvent> messa displaySubjectIfChanged(message->getSubject()); } isInitialJoin_ = false; chatWindow_->setSubject(message->getSubject()); doneGettingHistory_ = true; subject_ = message->getSubject(); } if (!doneGettingHistory_ && !message->getPayload<Delay>()) { doneGettingHistory_ = true; } if (!doneGettingHistory_) { checkDuplicates(message); messageEvent->conclude(); } } void MUCController::addMessageHandleIncomingMessage(const JID& from, const ChatWindow::ChatMessage& message, bool senderIsSelf, std::shared_ptr<SecurityLabel> label, const boost::posix_time::ptime& time) { if (from.isBare()) { chatWindow_->addSystemMessage(message, ChatWindow::DefaultDirection); } else { ChatControllerBase::addMessageHandleIncomingMessage(from, message, senderIsSelf, label, time); } } void MUCController::postHandleIncomingMessage(std::shared_ptr<MessageEvent> messageEvent, const ChatWindow::ChatMessage& chatMessage) { std::shared_ptr<Message> message = messageEvent->getStanza(); if (joined_ && messageEvent->getStanza()->getFrom().getResource() != nick_ && !message->getPayload<Delay>()) { - if (messageTargetsMe(message) || isImpromptu_) { - highlighter_->handleSystemNotifications(chatMessage, messageEvent); + highlighter_->handleSystemNotifications(chatMessage, messageEvent); + if (!messageEvent->getNotifications().empty()) { eventController_->handleIncomingEvent(messageEvent); } if (!messageEvent->getConcluded()) { highlighter_->handleSoundNotifications(chatMessage); } } } void MUCController::handleOccupantRoleChanged(const std::string& nick, const MUCOccupant& occupant, const MUCOccupant::Role& oldRole) { clearPresenceQueue(); receivedActivity(); JID jid(nickToJID(nick)); roster_->removeContactFromGroup(jid, roleToGroupName(oldRole)); JID realJID; if (occupant.getRealJID()) { realJID = occupant.getRealJID().get(); } std::string group(roleToGroupName(occupant.getRole())); roster_->addContact(jid, realJID, nick, group, avatarManager_->getAvatarPath(jid)); roster_->getGroup(group)->setManualSort(roleToSortName(occupant.getRole())); roster_->applyOnItems(SetMUC(jid, occupant.getRole(), occupant.getAffiliation())); chatWindow_->addSystemMessage(chatMessageParser_->parseMessageBody(str(format(QT_TRANSLATE_NOOP("", "%1% is now a %2%")) % nick % roleToFriendlyName(occupant.getRole()))), ChatWindow::DefaultDirection); if (nick == nick_) { setAvailableRoomActions(occupant.getAffiliation(), occupant.getRole()); } } void MUCController::handleOccupantAffiliationChanged(const std::string& nick, const MUCOccupant::Affiliation& affiliation, const MUCOccupant::Affiliation& /*oldAffiliation*/) { if (nick == nick_) { |