2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Display custom emoji reactions under messages.

This commit is contained in:
John Preston
2022-08-26 13:35:19 +04:00
parent 14f937cb02
commit ba83836922
17 changed files with 178 additions and 47 deletions

View File

@@ -592,8 +592,13 @@ bool WhoReadExists(not_null<HistoryItem*> item) {
return true;
}
bool WhoReactedExists(not_null<HistoryItem*> item) {
return item->canViewReactions() || WhoReadExists(item);
bool WhoReactedExists(
not_null<HistoryItem*> item,
WhoReactedList list) {
if (item->canViewReactions() || WhoReadExists(item)) {
return true;
}
return (list == WhoReactedList::One) && item->history()->peer->isUser();
}
rpl::producer<Ui::WhoReadContent> WhoReacted(

View File

@@ -24,8 +24,15 @@ struct ReactionId;
namespace Api {
enum class WhoReactedList {
All,
One,
};
[[nodiscard]] bool WhoReadExists(not_null<HistoryItem*> item);
[[nodiscard]] bool WhoReactedExists(not_null<HistoryItem*> item);
[[nodiscard]] bool WhoReactedExists(
not_null<HistoryItem*> item,
WhoReactedList list);
struct WhoReadList {
std::vector<PeerId> list;