2021-09-07 15:44:01 +00:00
|
|
|
/*
|
|
|
|
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
|
|
|
|
|
|
|
|
class HistoryItem;
|
|
|
|
|
2021-09-08 21:10:49 +00:00
|
|
|
namespace style {
|
|
|
|
struct WhoRead;
|
|
|
|
} // namespace style
|
|
|
|
|
2021-09-07 15:44:01 +00:00
|
|
|
namespace Ui {
|
|
|
|
struct WhoReadContent;
|
2022-01-18 17:46:10 +00:00
|
|
|
enum class WhoReadType;
|
2021-09-07 15:44:01 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2022-08-16 11:28:17 +00:00
|
|
|
namespace Data {
|
|
|
|
struct ReactionId;
|
|
|
|
} // namespace Data
|
|
|
|
|
2021-09-07 15:44:01 +00:00
|
|
|
namespace Api {
|
|
|
|
|
2022-08-26 09:35:19 +00:00
|
|
|
enum class WhoReactedList {
|
|
|
|
All,
|
|
|
|
One,
|
|
|
|
};
|
|
|
|
|
2021-09-07 15:44:01 +00:00
|
|
|
[[nodiscard]] bool WhoReadExists(not_null<HistoryItem*> item);
|
2022-08-26 09:35:19 +00:00
|
|
|
[[nodiscard]] bool WhoReactedExists(
|
|
|
|
not_null<HistoryItem*> item,
|
|
|
|
WhoReactedList list);
|
2021-09-07 15:44:01 +00:00
|
|
|
|
2023-03-03 13:15:02 +00:00
|
|
|
struct WhoReadPeer {
|
|
|
|
PeerId peer = 0;
|
|
|
|
TimeId date = 0;
|
2023-03-08 10:06:08 +00:00
|
|
|
bool dateReacted = false;
|
2023-03-03 13:15:02 +00:00
|
|
|
|
|
|
|
friend inline bool operator==(
|
|
|
|
const WhoReadPeer &a,
|
|
|
|
const WhoReadPeer &b) noexcept = default;
|
|
|
|
};
|
|
|
|
|
2022-01-18 17:46:10 +00:00
|
|
|
struct WhoReadList {
|
2023-03-03 13:15:02 +00:00
|
|
|
std::vector<WhoReadPeer> list;
|
2022-01-18 17:46:10 +00:00
|
|
|
Ui::WhoReadType type = {};
|
|
|
|
};
|
|
|
|
|
2021-09-07 15:44:01 +00:00
|
|
|
// The context must be destroyed before the session holding this item.
|
2021-12-24 13:51:53 +00:00
|
|
|
[[nodiscard]] rpl::producer<Ui::WhoReadContent> WhoReacted(
|
2021-09-07 15:44:01 +00:00
|
|
|
not_null<HistoryItem*> item,
|
2022-01-18 17:46:10 +00:00
|
|
|
not_null<QWidget*> context, // Cache results for this lifetime.
|
|
|
|
const style::WhoRead &st,
|
|
|
|
std::shared_ptr<WhoReadList> whoReadIds = nullptr);
|
2022-01-14 15:42:24 +00:00
|
|
|
[[nodiscard]] rpl::producer<Ui::WhoReadContent> WhoReacted(
|
|
|
|
not_null<HistoryItem*> item,
|
2022-08-16 11:28:17 +00:00
|
|
|
const Data::ReactionId &reaction,
|
2022-01-18 17:46:10 +00:00
|
|
|
not_null<QWidget*> context, // Cache results for this lifetime.
|
|
|
|
const style::WhoRead &st);
|
2021-09-07 15:44:01 +00:00
|
|
|
|
|
|
|
} // namespace Api
|