Disable external replies for non-forwardable.
This commit is contained in:
parent
b793c06759
commit
1341907cfd
|
@ -2391,15 +2391,7 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) {
|
||||||
: (Data::CanSendAnything(peer)
|
: (Data::CanSendAnything(peer)
|
||||||
&& (!peer->isChannel() || peer->asChannel()->amIn()));
|
&& (!peer->isChannel() || peer->asChannel()->amIn()));
|
||||||
}();
|
}();
|
||||||
const auto canReply = canSendReply || [&] {
|
const auto canReply = canSendReply || item->allowsForward();
|
||||||
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;
|
|
||||||
}();
|
|
||||||
if (canReply) {
|
if (canReply) {
|
||||||
const auto itemId = item->fullId();
|
const auto itemId = item->fullId();
|
||||||
const auto quote = selectedQuote(item);
|
const auto quote = selectedQuote(item);
|
||||||
|
|
|
@ -650,14 +650,16 @@ void DraftOptionsBox(
|
||||||
const auto setupReplyActions = [=] {
|
const auto setupReplyActions = [=] {
|
||||||
AddFilledSkip(bottom);
|
AddFilledSkip(bottom);
|
||||||
|
|
||||||
Settings::AddButton(
|
if (replyItem->allowsForward()) {
|
||||||
bottom,
|
Settings::AddButton(
|
||||||
tr::lng_reply_in_another_chat(),
|
bottom,
|
||||||
st::settingsButton,
|
tr::lng_reply_in_another_chat(),
|
||||||
{ &st::menuIconReplace }
|
st::settingsButton,
|
||||||
)->setClickedCallback([=] {
|
{ &st::menuIconReplace }
|
||||||
ShowReplyToChatBox(show, resolveReply(), clearOldDraft);
|
)->setClickedCallback([=] {
|
||||||
});
|
ShowReplyToChatBox(show, resolveReply(), clearOldDraft);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Settings::AddButton(
|
Settings::AddButton(
|
||||||
bottom,
|
bottom,
|
||||||
|
|
|
@ -592,15 +592,7 @@ bool AddReplyToMessageAction(
|
||||||
const auto canSendReply = topic
|
const auto canSendReply = topic
|
||||||
? Data::CanSendAnything(topic)
|
? Data::CanSendAnything(topic)
|
||||||
: Data::CanSendAnything(peer);
|
: Data::CanSendAnything(peer);
|
||||||
const auto canReply = canSendReply || [&] {
|
const auto canReply = canSendReply || item->allowsForward();
|
||||||
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;
|
|
||||||
}();
|
|
||||||
if (!canReply) {
|
if (!canReply) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue