Disable external replies for non-forwardable.

This commit is contained in:
John Preston 2023-10-31 10:50:17 +04:00
parent b793c06759
commit 1341907cfd
3 changed files with 12 additions and 26 deletions

View File

@ -2391,15 +2391,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
: (Data::CanSendAnything(peer)
&& (!peer->isChannel() || peer->asChannel()->amIn()));
}();
const auto canReply = canSendReply || [&] {
const auto peer = item->history()->peer;
if (const auto chat = peer->asChat()) {
return !chat->isForbidden();
} else if (const auto channel = peer->asChannel()) {
return !channel->isForbidden();
}
return true;
}();
const auto canReply = canSendReply || item->allowsForward();
if (canReply) {
const auto itemId = item->fullId();
const auto quote = selectedQuote(item);

View File

@ -650,14 +650,16 @@ void DraftOptionsBox(
const auto setupReplyActions = [=] {
AddFilledSkip(bottom);
Settings::AddButton(
bottom,
tr::lng_reply_in_another_chat(),
st::settingsButton,
{ &st::menuIconReplace }
)->setClickedCallback([=] {
ShowReplyToChatBox(show, resolveReply(), clearOldDraft);
});
if (replyItem->allowsForward()) {
Settings::AddButton(
bottom,
tr::lng_reply_in_another_chat(),
st::settingsButton,
{ &st::menuIconReplace }
)->setClickedCallback([=] {
ShowReplyToChatBox(show, resolveReply(), clearOldDraft);
});
}
Settings::AddButton(
bottom,

View File

@ -592,15 +592,7 @@ bool AddReplyToMessageAction(
const auto canSendReply = topic
? Data::CanSendAnything(topic)
: Data::CanSendAnything(peer);
const auto canReply = canSendReply || [&] {
const auto peer = item->history()->peer;
if (const auto chat = peer->asChat()) {
return !chat->isForbidden();
} else if (const auto channel = peer->asChannel()) {
return !channel->isForbidden();
}
return true;
}();
const auto canReply = canSendReply || item->allowsForward();
if (!canReply) {
return false;
}