Fix replying to stories with voice messages.

This commit is contained in:
John Preston 2023-05-30 09:44:31 +04:00
parent f814e401b9
commit b8cf00a0b2
3 changed files with 12 additions and 10 deletions

View File

@ -35,15 +35,7 @@ constexpr auto kReadRequestTimeout = 3 * crl::time(1000);
MTPInputReplyTo ReplyToForMTP(
not_null<Session*> owner,
FullReplyTo replyTo) {
if (replyTo.msgId || replyTo.topicRootId) {
using Flag = MTPDinputReplyToMessage::Flag;
return MTP_inputReplyToMessage(
(replyTo.topicRootId
? MTP_flags(Flag::f_top_msg_id)
: MTP_flags(0)),
MTP_int(replyTo.msgId ? replyTo.msgId : replyTo.topicRootId),
MTP_int(replyTo.topicRootId));
} else if (replyTo.storyId) {
if (replyTo.storyId) {
if (const auto peer = owner->peerLoaded(replyTo.storyId.peer)) {
if (const auto user = peer->asUser()) {
return MTP_inputReplyToStory(
@ -51,6 +43,14 @@ MTPInputReplyTo ReplyToForMTP(
MTP_int(replyTo.storyId.story));
}
}
} else if (replyTo.msgId || replyTo.topicRootId) {
using Flag = MTPDinputReplyToMessage::Flag;
return MTP_inputReplyToMessage(
(replyTo.topicRootId
? MTP_flags(Flag::f_top_msg_id)
: MTP_flags(0)),
MTP_int(replyTo.msgId ? replyTo.msgId : replyTo.topicRootId),
MTP_int(replyTo.topicRootId));
}
return MTPInputReplyTo();
}

View File

@ -2274,7 +2274,7 @@ void ComposeControls::initVoiceRecordBar() {
return std::nullopt;
}();
if (error) {
_show->showBox(Ui::MakeInformBox(*error));
_show->showToast(*error);
return true;
} else if (_showSlowmodeError && _showSlowmodeError()) {
return true;

View File

@ -421,6 +421,8 @@ void Controller::show(
}
stories.loadAround(storyId);
list.user->updateFull();
if (_contentFaded) {
togglePaused(true);
}