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

View File

@ -19,6 +19,20 @@ class Entry;
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 {
NameUpdate(
not_null<PeerData*> peer,
@ -215,16 +229,6 @@ public:
void sendNotifications();
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>
class Manager final {
public:
@ -248,7 +252,7 @@ private:
void sendNotifications();
private:
static constexpr auto kCount = CountBit<Flag>();
static constexpr auto kCount = details::CountBit<Flag>();
void sendRealtimeNotifications(not_null<DataType*> data, Flags flags);
@ -258,8 +262,6 @@ private:
};
static constexpr auto kHistoryCount = CountBit<HistoryUpdate::Flag>();
void scheduleNotifications();
const not_null<Main::Session*> _session;

View File

@ -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];

View File

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