From 9ee3e699248b4dcaae0ac15829d5004e5e23c66e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 8 Apr 2015 18:48:24 -0500 Subject: honor the AccountsService 'other vibrations' setting. --- src/snap.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/snap.cpp') diff --git a/src/snap.cpp b/src/snap.cpp index ae0a62a..3867e90 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -104,10 +104,12 @@ public: } // create the haptic feedback... - const auto haptic_mode = m_settings->alarm_haptic.get(); std::shared_ptr haptic; - if (haptic_mode == "pulse") - haptic = std::make_shared(uin::Haptic::MODE_PULSE); + if (should_vibrate()) { + const auto haptic_mode = m_settings->alarm_haptic.get(); + if (haptic_mode == "pulse") + haptic = std::make_shared(uin::Haptic::MODE_PULSE); + } // show a notification... const auto minutes = std::chrono::minutes(m_settings->alarm_duration.get()); @@ -181,6 +183,12 @@ private: && (accounts_service_sound_get_silent_mode(m_accounts_service_sound_proxy)); } + bool should_vibrate() const + { + return (m_accounts_service_sound_proxy != nullptr) + && (accounts_service_sound_get_other_vibrate(m_accounts_service_sound_proxy)); + } + std::string get_alarm_uri(const Alarm& alarm, const std::shared_ptr& settings) const { -- cgit v1.2.3