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

Add reactions to replies / comments / pinned section.

This commit is contained in:
John Preston
2021-12-29 16:06:08 +03:00
parent 71d52d26c3
commit 58c9494c03
15 changed files with 144 additions and 32 deletions

View File

@@ -12,6 +12,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_chat.h"
#include "data/data_user.h"
#include "data/data_changes.h"
#include "data/data_session.h"
#include "data/data_message_reactions.h"
#include "main/main_session.h"
#include "ui/image/image_prepare.h"
#include "base/unixtime.h"
@@ -495,4 +497,18 @@ rpl::producer<QImage> PeerUserpicImageValue(
};
}
rpl::producer<std::vector<Data::Reaction>> PeerAllowedReactionsValue(
not_null<PeerData*> peer) {
return rpl::combine(
rpl::single(
rpl::empty_value()
) | rpl::then(peer->owner().reactions().updates()),
peer->session().changes().peerFlagsValue(
peer,
Data::PeerUpdate::Flag::Reactions)
) | rpl::map([=] {
return peer->owner().reactions().list(peer);
});
}
} // namespace Data