Remove some options from Replies three-dot menu.

This commit is contained in:
John Preston 2020-09-15 09:58:24 +03:00
parent e9dffe78e3
commit 040f29abe6
2 changed files with 13 additions and 3 deletions

View file

@ -475,6 +475,9 @@ void PeerData::setPinnedMessageId(MsgId messageId) {
} }
bool PeerData::canExportChatHistory() const { bool PeerData::canExportChatHistory() const {
if (isRepliesChat()) {
return false;
}
if (const auto channel = asChannel()) { if (const auto channel = asChannel()) {
if (!channel->amIn() && channel->invitePeekExpires()) { if (!channel->amIn() && channel->invitePeekExpires()) {
return false; return false;
@ -844,7 +847,9 @@ int PeerData::slowmodeSecondsLeft() const {
bool PeerData::canSendPolls() const { bool PeerData::canSendPolls() const {
if (const auto user = asUser()) { if (const auto user = asUser()) {
return user->isBot() && !user->isSupport(); return user->isBot()
&& !user->isRepliesChat()
&& !user->isSupport();
} else if (const auto chat = asChat()) { } else if (const auto chat = asChat()) {
return chat->canSendPolls(); return chat->canSendPolls();
} else if (const auto channel = asChannel()) { } else if (const auto channel = asChannel()) {

View file

@ -253,7 +253,9 @@ Filler::Filler(
} }
bool Filler::showInfo() { bool Filler::showInfo() {
if (_source == PeerMenuSource::Profile || _peer->isSelf()) { if (_source == PeerMenuSource::Profile
|| _peer->isSelf()
|| _peer->isRepliesChat()) {
return false; return false;
} else if (_controller->activeChatCurrent().peer() != _peer) { } else if (_controller->activeChatCurrent().peer() != _peer) {
return true; return true;
@ -479,7 +481,9 @@ void Filler::addUserActions(not_null<UserData*> user) {
tr::lng_info_delete_contact(tr::now), tr::lng_info_delete_contact(tr::now),
[=] { PeerMenuDeleteContact(user); }); [=] { PeerMenuDeleteContact(user); });
} }
if (user->isBot() && !user->botInfo->cantJoinGroups) { if (user->isBot()
&& !user->isRepliesChat()
&& !user->botInfo->cantJoinGroups) {
using AddBotToGroup = AddBotToGroupBoxController; using AddBotToGroup = AddBotToGroupBoxController;
_addAction( _addAction(
tr::lng_profile_invite_to_group(tr::now), tr::lng_profile_invite_to_group(tr::now),
@ -500,6 +504,7 @@ void Filler::addUserActions(not_null<UserData*> user) {
ClearHistoryHandler(user)); ClearHistoryHandler(user));
if (!user->isInaccessible() if (!user->isInaccessible()
&& user != user->session().user() && user != user->session().user()
&& !user->isRepliesChat()
&& _source != PeerMenuSource::ChatsList) { && _source != PeerMenuSource::ChatsList) {
addBlockUser(user); addBlockUser(user);
} }