mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed sending of PlayGame user action.
This commit is contained in:
parent
9445ce4b09
commit
f68e4d9d59
2 changed files with 21 additions and 22 deletions
|
@ -48,7 +48,6 @@ void SendBotCallbackData(
|
||||||
}
|
}
|
||||||
|
|
||||||
using ButtonType = HistoryMessageMarkupButton::Type;
|
using ButtonType = HistoryMessageMarkupButton::Type;
|
||||||
const auto gameProgressType = Api::SendProgressType::PlayGame;
|
|
||||||
const auto isGame = (button->type == ButtonType::Game);
|
const auto isGame = (button->type == ButtonType::Game);
|
||||||
|
|
||||||
auto flags = MTPmessages_GetBotCallbackAnswer::Flags(0);
|
auto flags = MTPmessages_GetBotCallbackAnswer::Flags(0);
|
||||||
|
@ -87,12 +86,9 @@ void SendBotCallbackData(
|
||||||
link,
|
link,
|
||||||
item->fullId());
|
item->fullId());
|
||||||
BotGameUrlClickHandler(bot, scoreLink).onClick({});
|
BotGameUrlClickHandler(bot, scoreLink).onClick({});
|
||||||
|
session->sendProgressManager().update(
|
||||||
if (history->mySendActionUpdated(gameProgressType, true)) {
|
history,
|
||||||
session->sendProgressManager().update(
|
Api::SendProgressType::PlayGame);
|
||||||
history,
|
|
||||||
gameProgressType);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}).fail([=](const RPCError &error, auto id) {
|
}).fail([=](const RPCError &error, auto id) {
|
||||||
|
|
|
@ -62,21 +62,24 @@ void SendProgressManager::send(
|
||||||
SendProgressType type,
|
SendProgressType type,
|
||||||
int32 progress) {
|
int32 progress) {
|
||||||
using Type = SendProgressType;
|
using Type = SendProgressType;
|
||||||
MTPsendMessageAction action;
|
const auto action = [&]() -> MTPsendMessageAction {
|
||||||
switch (type) {
|
const auto p = MTP_int(progress);
|
||||||
case Type::Typing: action = MTP_sendMessageTypingAction(); break;
|
switch (type) {
|
||||||
case Type::RecordVideo: action = MTP_sendMessageRecordVideoAction(); break;
|
case Type::Typing: return MTP_sendMessageTypingAction();
|
||||||
case Type::UploadVideo: action = MTP_sendMessageUploadVideoAction(MTP_int(progress)); break;
|
case Type::RecordVideo: return MTP_sendMessageRecordVideoAction();
|
||||||
case Type::RecordVoice: action = MTP_sendMessageRecordAudioAction(); break;
|
case Type::UploadVideo: return MTP_sendMessageUploadVideoAction(p);
|
||||||
case Type::UploadVoice: action = MTP_sendMessageUploadAudioAction(MTP_int(progress)); break;
|
case Type::RecordVoice: return MTP_sendMessageRecordAudioAction();
|
||||||
case Type::RecordRound: action = MTP_sendMessageRecordRoundAction(); break;
|
case Type::UploadVoice: return MTP_sendMessageUploadAudioAction(p);
|
||||||
case Type::UploadRound: action = MTP_sendMessageUploadRoundAction(MTP_int(progress)); break;
|
case Type::RecordRound: return MTP_sendMessageRecordRoundAction();
|
||||||
case Type::UploadPhoto: action = MTP_sendMessageUploadPhotoAction(MTP_int(progress)); break;
|
case Type::UploadRound: return MTP_sendMessageUploadRoundAction(p);
|
||||||
case Type::UploadFile: action = MTP_sendMessageUploadDocumentAction(MTP_int(progress)); break;
|
case Type::UploadPhoto: return MTP_sendMessageUploadPhotoAction(p);
|
||||||
case Type::ChooseLocation: action = MTP_sendMessageGeoLocationAction(); break;
|
case Type::UploadFile: return MTP_sendMessageUploadDocumentAction(p);
|
||||||
case Type::ChooseContact: action = MTP_sendMessageChooseContactAction(); break;
|
case Type::ChooseLocation: return MTP_sendMessageGeoLocationAction();
|
||||||
case Type::PlayGame: action = MTP_sendMessageGamePlayAction(); break;
|
case Type::ChooseContact: return MTP_sendMessageChooseContactAction();
|
||||||
}
|
case Type::PlayGame: return MTP_sendMessageGamePlayAction();
|
||||||
|
default: return MTP_sendMessageTypingAction();
|
||||||
|
}
|
||||||
|
}();
|
||||||
const auto requestId = _session->api().request(MTPmessages_SetTyping(
|
const auto requestId = _session->api().request(MTPmessages_SetTyping(
|
||||||
history->peer->input,
|
history->peer->input,
|
||||||
action
|
action
|
||||||
|
|
Loading…
Add table
Reference in a new issue