From 9faf15943aadb8855296e4660436ea11499fa569 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 11 Jun 2020 20:40:27 +0300 Subject: [PATCH] Fixed build for macOS. --- Telegram/SourceFiles/core/update_checker.cpp | 1 - Telegram/SourceFiles/data/data_changes.cpp | 2 +- Telegram/SourceFiles/data/data_changes.h | 28 ++++++++++--------- .../SourceFiles/platform/mac/mac_touchbar.mm | 3 +- .../settings/settings_notifications.cpp | 2 ++ 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Telegram/SourceFiles/core/update_checker.cpp b/Telegram/SourceFiles/core/update_checker.cpp index 6712c83ed8..5c90323190 100644 --- a/Telegram/SourceFiles/core/update_checker.cpp +++ b/Telegram/SourceFiles/core/update_checker.cpp @@ -192,7 +192,6 @@ private: const FileLocation &location) const; MTP::WeakInstance _mtp; - int32 _mtpUserId = 0; }; diff --git a/Telegram/SourceFiles/data/data_changes.cpp b/Telegram/SourceFiles/data/data_changes.cpp index fdc2ca5f03..a4a3320a97 100644 --- a/Telegram/SourceFiles/data/data_changes.cpp +++ b/Telegram/SourceFiles/data/data_changes.cpp @@ -65,7 +65,7 @@ rpl::producer Changes::Manager::updates( template auto Changes::Manager::realtimeUpdates(Flag flag) const -> rpl::producer { - return _realtimeStreams[CountBit(flag)].events(); + return _realtimeStreams[details::CountBit(flag)].events(); } template diff --git a/Telegram/SourceFiles/data/data_changes.h b/Telegram/SourceFiles/data/data_changes.h index cb2d435f4b..fd38841c20 100644 --- a/Telegram/SourceFiles/data/data_changes.h +++ b/Telegram/SourceFiles/data/data_changes.h @@ -19,6 +19,20 @@ class Entry; namespace Data { +namespace details { + +template +inline constexpr int CountBit(Flag Last = Flag::LastUsedBit) { + auto i = 0; + while ((1ULL << i) != static_cast(Last)) { + ++i; + Assert(i != 64); + } + return (i + 1); +} + +} // namespace details + struct NameUpdate { NameUpdate( not_null peer, @@ -215,16 +229,6 @@ public: void sendNotifications(); private: - template - static constexpr int CountBit(Flag Last = Flag::LastUsedBit) { - auto i = 0; - while ((1ULL << i) != static_cast(Last)) { - ++i; - Assert(i != 64); - } - return (i + 1); - } - template class Manager final { public: @@ -248,7 +252,7 @@ private: void sendNotifications(); private: - static constexpr auto kCount = CountBit(); + static constexpr auto kCount = details::CountBit(); void sendRealtimeNotifications(not_null data, Flags flags); @@ -258,8 +262,6 @@ private: }; - static constexpr auto kHistoryCount = CountBit(); - void scheduleNotifications(); const not_null _session; diff --git a/Telegram/SourceFiles/platform/mac/mac_touchbar.mm b/Telegram/SourceFiles/platform/mac/mac_touchbar.mm index 32912d5384..feeec8ce89 100644 --- a/Telegram/SourceFiles/platform/mac/mac_touchbar.mm +++ b/Telegram/SourceFiles/platform/mac/mac_touchbar.mm @@ -41,6 +41,7 @@ #include "ui/widgets/input_fields.h" #include "facades.h" #include "app.h" +#include "window/window_controller.h" NSImage *qt_mac_create_nsimage(const QPixmap &pm); @@ -585,7 +586,7 @@ void AppendEmojiPacks( }, _peerChangedLifetime); _peer->session().changes().historyUpdates( - _peer->session().history(_peer), + _peer->session().data().history(_peer), Data::HistoryUpdate::Flag::UnreadView ) | rpl::start_with_next([=] { [self updateBadge]; diff --git a/Telegram/SourceFiles/settings/settings_notifications.cpp b/Telegram/SourceFiles/settings/settings_notifications.cpp index 71ec0eabde..01596d152f 100644 --- a/Telegram/SourceFiles/settings/settings_notifications.cpp +++ b/Telegram/SourceFiles/settings/settings_notifications.cpp @@ -30,6 +30,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "styles/style_window.h" #include "styles/style_dialogs.h" +#include + namespace Settings { namespace {