diff --git a/Telegram/SourceFiles/boxes/ringtones_box.cpp b/Telegram/SourceFiles/boxes/ringtones_box.cpp index ab220fb29..74e8f510b 100644 --- a/Telegram/SourceFiles/boxes/ringtones_box.cpp +++ b/Telegram/SourceFiles/boxes/ringtones_box.cpp @@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "lang/lang_keys.h" #include "main/main_session.h" #include "media/audio/media_audio.h" +#include "platform/platform_notifications_manager.h" #include "settings/settings_common.h" #include "ui/boxes/confirm_box.h" #include "ui/text/format_values.h" diff --git a/Telegram/SourceFiles/core/core_settings.cpp b/Telegram/SourceFiles/core/core_settings.cpp index 8039fc124..5d780570d 100644 --- a/Telegram/SourceFiles/core/core_settings.cpp +++ b/Telegram/SourceFiles/core/core_settings.cpp @@ -7,19 +7,17 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "core/core_settings.h" -#include "boxes/send_files_box.h" -#include "history/view/history_view_quick_action.h" -#include "ui/widgets/fields/input_field.h" -#include "storage/serialize_common.h" -#include "window/section_widget.h" #include "base/platform/base_platform_info.h" -#include "webrtc/webrtc_create_adm.h" -#include "media/player/media_player_instance.h" -#include "media/media_common.h" -#include "ui/gl/gl_detection.h" -#include "lang/lang_keys.h" #include "calls/group/calls_group_common.h" +#include "history/view/history_view_quick_action.h" +#include "lang/lang_keys.h" +#include "platform/platform_notifications_manager.h" #include "spellcheck/spellcheck_types.h" +#include "storage/serialize_common.h" +#include "ui/gl/gl_detection.h" +#include "ui/widgets/fields/input_field.h" +#include "webrtc/webrtc_create_adm.h" +#include "window/section_widget.h" namespace Core { namespace { @@ -1307,6 +1305,17 @@ auto Settings::DeserializePlaybackSpeed(qint32 speed) -> PlaybackSpeed { return validate(std::clamp(speed / 100., kSpeedMin, kSpeedMax)); } +bool Settings::nativeNotifications() const { + return _nativeNotifications.value_or( + Platform::Notifications::ByDefault()); +} + +void Settings::setNativeNotifications(bool value) { + _nativeNotifications = (value == Platform::Notifications::ByDefault()) + ? std::nullopt + : std::make_optional(value); +} + void Settings::setTranslateButtonEnabled(bool value) { _translateButtonEnabled = value; } diff --git a/Telegram/SourceFiles/core/core_settings.h b/Telegram/SourceFiles/core/core_settings.h index 31b0880b1..0f7082293 100644 --- a/Telegram/SourceFiles/core/core_settings.h +++ b/Telegram/SourceFiles/core/core_settings.h @@ -11,7 +11,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "media/media_common.h" #include "window/themes/window_themes_embedded.h" #include "ui/chat/attach/attach_send_files_way.h" -#include "platform/platform_notifications_manager.h" #include "base/flags.h" #include "emoji.h" @@ -221,14 +220,10 @@ public: void setNotifyView(NotifyView value) { _notifyView = value; } - [[nodiscard]] bool nativeNotifications() const { - return _nativeNotifications.value_or(Platform::Notifications::ByDefault()); - } - void setNativeNotifications(bool value) { - _nativeNotifications = (value == Platform::Notifications::ByDefault()) - ? std::nullopt - : std::make_optional(value); - } + + [[nodiscard]] bool nativeNotifications() const; + void setNativeNotifications(bool value); + [[nodiscard]] int notificationsCount() const { return _notificationsCount; } diff --git a/Telegram/SourceFiles/data/data_peer.cpp b/Telegram/SourceFiles/data/data_peer.cpp index 4c03f5d4d..caeb39aed 100644 --- a/Telegram/SourceFiles/data/data_peer.cpp +++ b/Telegram/SourceFiles/data/data_peer.cpp @@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_chat_participant_status.h" #include "data/data_channel.h" #include "data/data_changes.h" +#include "data/data_message_reaction_id.h" #include "data/data_photo.h" #include "data/data_folder.h" #include "data/data_forum.h" diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index c9391f3fa..ef3cf5172 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -67,6 +67,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_web_page.h" #include "chat_helpers/stickers_gift_box_pack.h" #include "payments/payments_checkout_process.h" // CheckoutProcess::Start. +#include "platform/platform_notifications_manager.h" #include "spellcheck/spellcheck_highlight_syntax.h" #include "styles/style_dialogs.h" diff --git a/Telegram/SourceFiles/history/history_item_helpers.cpp b/Telegram/SourceFiles/history/history_item_helpers.cpp index 7ed2db5cf..15b5d5ad8 100644 --- a/Telegram/SourceFiles/history/history_item_helpers.cpp +++ b/Telegram/SourceFiles/history/history_item_helpers.cpp @@ -29,6 +29,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "main/main_domain.h" #include "main/main_session.h" #include "main/main_session_settings.h" +#include "platform/platform_notifications_manager.h" #include "window/window_controller.h" #include "window/window_session_controller.h" #include "apiwrap.h" diff --git a/Telegram/SourceFiles/tray.cpp b/Telegram/SourceFiles/tray.cpp index 093122508..235bf0601 100644 --- a/Telegram/SourceFiles/tray.cpp +++ b/Telegram/SourceFiles/tray.cpp @@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "core/application.h" #include "core/core_settings.h" +#include "platform/platform_notifications_manager.h" #include "platform/platform_specific.h" #include "lang/lang_keys.h" diff --git a/Telegram/SourceFiles/window/themes/window_themes_embedded.h b/Telegram/SourceFiles/window/themes/window_themes_embedded.h index ea66c9590..cbef706e0 100644 --- a/Telegram/SourceFiles/window/themes/window_themes_embedded.h +++ b/Telegram/SourceFiles/window/themes/window_themes_embedded.h @@ -7,7 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once - namespace style { struct colorizer; } // namespace style