mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Implement custom reactions in stories.
This commit is contained in:
@@ -870,6 +870,21 @@ void Stories::activateStealthMode(Fn<void()> done) {
|
||||
}).send();
|
||||
}
|
||||
|
||||
void Stories::sendReaction(FullStoryId id, Data::ReactionId reaction) {
|
||||
if (const auto maybeStory = lookup(id)) {
|
||||
const auto story = *maybeStory;
|
||||
story->setReactionId(reaction);
|
||||
|
||||
const auto api = &session().api();
|
||||
api->request(MTPstories_SendReaction(
|
||||
MTP_flags(0),
|
||||
story->peer()->asUser()->inputUser,
|
||||
MTP_int(id.story),
|
||||
ReactionToMTP(reaction)
|
||||
)).send();
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<HistoryItem> Stories::resolveItem(not_null<Story*> story) {
|
||||
auto &items = _items[story->peer()->id];
|
||||
auto i = items.find(story->id());
|
||||
|
Reference in New Issue
Block a user