2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Instantly mark as read visible new reactions.

This commit is contained in:
John Preston
2022-01-28 14:24:07 +03:00
parent f6bfe2c9a8
commit e509da8fd8
5 changed files with 46 additions and 8 deletions

View File

@@ -32,7 +32,7 @@ inline constexpr int CountBit(Flag Last = Flag::LastUsedBit) {
++i;
Assert(i != 64);
}
return (i + 1);
return i;
}
} // namespace details
@@ -151,8 +151,9 @@ struct MessageUpdate {
BotCallbackSent = (1U << 6),
NewMaybeAdded = (1U << 7),
RepliesUnreadCount = (1U << 8),
NewUnreadReaction = (1U << 9),
LastUsedBit = (1U << 8),
LastUsedBit = (1U << 9),
};
using Flags = base::flags<Flag>;
friend inline constexpr auto is_flag_type(Flag) { return true; }
@@ -271,9 +272,11 @@ private:
void sendNotifications();
private:
static constexpr auto kCount = details::CountBit<Flag>();
static constexpr auto kCount = details::CountBit<Flag>() + 1;
void sendRealtimeNotifications(not_null<DataType*> data, Flags flags);
void sendRealtimeNotifications(
not_null<DataType*> data,
Flags flags);
std::array<rpl::event_stream<UpdateType>, kCount> _realtimeStreams;
base::flat_map<not_null<DataType*>, Flags> _updates;