diff options
Diffstat (limited to 'Swift/Controllers/SoundEventController.cpp')
-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,21 +1,22 @@ /* - * Copyright (c) 2010-2012 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swift/Controllers/SoundEventController.h> #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 { SoundEventController::SoundEventController(EventController* eventController, SoundPlayer* soundPlayer, SettingsProvider* settings, HighlightManager* highlightManager) { settings_ = settings; eventController_ = eventController; @@ -26,17 +27,16 @@ SoundEventController::SoundEventController(EventController* eventController, Sou settings_->onSettingChanged.connect(boost::bind(&SoundEventController::handleSettingChanged, this, _1)); 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) { if (playSounds_ && action.playSound()) { soundPlayer_->playSound(SoundPlayer::MessageReceived, action.getSoundFile()); } |