ZaStoGram_desktop/Telegram/SourceFiles/data/data_unread_value.h
John Preston f1309a2456 Share replies and saved-sublist count calculations
Task: 2026/10/29/share-replies-and-saved-sublist-count-calculations
2026-10-29 21:42:58 +04:00

47 lines
1.2 KiB
C++

/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
namespace Dialogs {
struct UnreadState;
} // namespace Dialogs
namespace Main {
class Session;
} // namespace Main
namespace Data {
[[nodiscard]] Dialogs::UnreadState MainListMapUnreadState(
not_null<Main::Session*> session,
const Dialogs::UnreadState &state);
[[nodiscard]] rpl::producer<Dialogs::UnreadState> UnreadStateValue(
not_null<Main::Session*> session,
FilterId filterId);
[[nodiscard]] rpl::producer<bool> IncludeMutedCounterFoldersValue();
[[nodiscard]] std::optional<int> ComputeUnreadCountLocally(
MsgId afterId,
MsgId minReadTillId,
const std::vector<MsgId> &list,
std::optional<int> skippedBefore,
std::optional<int> skippedAfter,
std::optional<int> fullCount,
std::optional<int> currentUnreadCountAfter,
MsgId wasReadTillId);
[[nodiscard]] int ReconcileSkippedCounts(
std::optional<int> &skippedBefore,
std::optional<int> &skippedAfter,
bool toFront,
int wasSize,
int nowSize,
int fullCount);
} // namespace Data