chore: refactor markReadAfterAction

https://github.com/AyuGram/AyuGramDesktop/issues/328
This commit is contained in:
AlexeyZavar
2026-04-07 23:36:38 +03:00
parent 4b470a9205
commit 3f84f27354
10 changed files with 22 additions and 36 deletions
+6
View File
@@ -46,6 +46,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtGui/QGuiApplication>
#include <QtGui/QClipboard>
// AyuGram includes
#include "ayu/utils/telegram_helpers.h"
namespace Api {
namespace {
@@ -424,6 +428,7 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) {
const auto id = int32(button->buttonId);
const auto chosen = [=](std::vector<not_null<PeerData*>> result) {
using Flag = MTPmessages_SendBotRequestedPeer::Flag;
markReadAfterAction(item->history());
peer->session().api().request(MTPmessages_SendBotRequestedPeer(
MTP_flags(Flag::f_msg_id),
peer->input(),
@@ -573,6 +578,7 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) {
.suggestedUsername = suggestedUsername,
.done = [=](not_null<UserData*> createdBot) {
using Flag = MTPmessages_SendBotRequestedPeer::Flag;
markReadAfterAction(item->history());
peer->session().api().request(
MTPmessages_SendBotRequestedPeer(
MTP_flags(Flag::f_msg_id),