diff options
author | Tobias Markmann <tm@ayena.de> | 2015-09-15 12:29:00 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2015-09-22 15:58:27 (GMT) |
commit | 9bfa3150fe9fac684a08e584a23249f918c188d9 (patch) | |
tree | fc7730a9f5e767d7f2c2db3af42a57d26416469d /Swift/Controllers | |
parent | c310a15daeb18a441a30cbd7fbdc14a2eea957f9 (diff) | |
download | swift-9bfa3150fe9fac684a08e584a23249f918c188d9.zip swift-9bfa3150fe9fac684a08e584a23249f918c188d9.tar.bz2 |
Play message incoming sound on incoming file-transfers
The moving of our sound playing to our message highlighting code
resulted in non-message events not having sound notifications played
anymore. This commit fixes this issue for incoming file-transfers,
by playing the default message received sound as long as sounds are
not globally disabled in Swift.
Test-Information:
Tested on OS X 10.9.5 with Qt 5.4.2, by exchanging files and
messages between two Swift instances.
Change-Id: Ie09473efeef8366b76f6f7b59cc941fe6a0ad8f0
Diffstat (limited to 'Swift/Controllers')
-rw-r--r-- | Swift/Controllers/SoundEventController.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Swift/Controllers/SoundEventController.cpp b/Swift/Controllers/SoundEventController.cpp index 13c590e..43c8ed0 100644 --- a/Swift/Controllers/SoundEventController.cpp +++ b/Swift/Controllers/SoundEventController.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2012 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -8,11 +8,12 @@ #include <boost/bind.hpp> -#include <Swift/Controllers/XMPPEvents/EventController.h> +#include <Swift/Controllers/HighlightManager.h> +#include <Swift/Controllers/SettingConstants.h> #include <Swift/Controllers/SoundPlayer.h> #include <Swift/Controllers/UIEvents/UIEventStream.h> -#include <Swift/Controllers/SettingConstants.h> -#include <Swift/Controllers/HighlightManager.h> +#include <Swift/Controllers/XMPPEvents/EventController.h> +#include <Swift/Controllers/XMPPEvents/IncomingFileTransferEvent.h> namespace Swift { @@ -29,11 +30,10 @@ SoundEventController::SoundEventController(EventController* eventController, Sou playSounds_ = settings->getSetting(SettingConstants::PLAY_SOUNDS); } -void SoundEventController::handleEventQueueEventAdded(boost::shared_ptr<StanzaEvent> /*event*/) { - // message received sound is now played via highlighting - //if (playSounds_ && !event->getConcluded()) { - // soundPlayer_->playSound(SoundPlayer::MessageReceived); - //} +void SoundEventController::handleEventQueueEventAdded(boost::shared_ptr<StanzaEvent> event) { + if (playSounds_ && boost::dynamic_pointer_cast<IncomingFileTransferEvent>(event)) { + soundPlayer_->playSound(SoundPlayer::MessageReceived, ""); + } } void SoundEventController::handleHighlight(const HighlightAction& action) { |