Fixed build for macOS.

This commit is contained in:
23rd 2020-06-11 20:40:27 +03:00 committed by John Preston
parent dddd355f6c
commit 9faf15943a
5 changed files with 20 additions and 16 deletions

View file

@ -192,7 +192,6 @@ private:
const FileLocation &location) const; const FileLocation &location) const;
MTP::WeakInstance _mtp; MTP::WeakInstance _mtp;
int32 _mtpUserId = 0;
}; };

View file

@ -65,7 +65,7 @@ rpl::producer<UpdateType> Changes::Manager<DataType, UpdateType>::updates(
template <typename DataType, typename UpdateType> template <typename DataType, typename UpdateType>
auto Changes::Manager<DataType, UpdateType>::realtimeUpdates(Flag flag) const auto Changes::Manager<DataType, UpdateType>::realtimeUpdates(Flag flag) const
-> rpl::producer<UpdateType> { -> rpl::producer<UpdateType> {
return _realtimeStreams[CountBit(flag)].events(); return _realtimeStreams[details::CountBit(flag)].events();
} }
template <typename DataType, typename UpdateType> template <typename DataType, typename UpdateType>

View file

@ -19,6 +19,20 @@ class Entry;
namespace Data { namespace Data {
namespace details {
template <typename Flag>
inline constexpr int CountBit(Flag Last = Flag::LastUsedBit) {
auto i = 0;
while ((1ULL << i) != static_cast<uint64>(Last)) {
++i;
Assert(i != 64);
}
return (i + 1);
}
} // namespace details
struct NameUpdate { struct NameUpdate {
NameUpdate( NameUpdate(
not_null<PeerData*> peer, not_null<PeerData*> peer,
@ -215,16 +229,6 @@ public:
void sendNotifications(); void sendNotifications();
private: private:
template <typename Flag>
static constexpr int CountBit(Flag Last = Flag::LastUsedBit) {
auto i = 0;
while ((1ULL << i) != static_cast<uint64>(Last)) {
++i;
Assert(i != 64);
}
return (i + 1);
}
template <typename DataType, typename UpdateType> template <typename DataType, typename UpdateType>
class Manager final { class Manager final {
public: public:
@ -248,7 +252,7 @@ private:
void sendNotifications(); void sendNotifications();
private: private:
static constexpr auto kCount = CountBit<Flag>(); static constexpr auto kCount = details::CountBit<Flag>();
void sendRealtimeNotifications(not_null<DataType*> data, Flags flags); void sendRealtimeNotifications(not_null<DataType*> data, Flags flags);
@ -258,8 +262,6 @@ private:
}; };
static constexpr auto kHistoryCount = CountBit<HistoryUpdate::Flag>();
void scheduleNotifications(); void scheduleNotifications();
const not_null<Main::Session*> _session; const not_null<Main::Session*> _session;

View file

@ -41,6 +41,7 @@
#include "ui/widgets/input_fields.h" #include "ui/widgets/input_fields.h"
#include "facades.h" #include "facades.h"
#include "app.h" #include "app.h"
#include "window/window_controller.h"
NSImage *qt_mac_create_nsimage(const QPixmap &pm); NSImage *qt_mac_create_nsimage(const QPixmap &pm);
@ -585,7 +586,7 @@ void AppendEmojiPacks(
}, _peerChangedLifetime); }, _peerChangedLifetime);
_peer->session().changes().historyUpdates( _peer->session().changes().historyUpdates(
_peer->session().history(_peer), _peer->session().data().history(_peer),
Data::HistoryUpdate::Flag::UnreadView Data::HistoryUpdate::Flag::UnreadView
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
[self updateBadge]; [self updateBadge];

View file

@ -30,6 +30,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_window.h" #include "styles/style_window.h"
#include "styles/style_dialogs.h" #include "styles/style_dialogs.h"
#include <QTimer>
namespace Settings { namespace Settings {
namespace { namespace {