2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Removed "Export history" from context menu for empty chats.

This commit is contained in:
23rd
2019-03-21 21:14:48 +03:00
committed by John Preston
parent 5d04842a80
commit 2aecd1035e
3 changed files with 33 additions and 13 deletions

View File

@@ -336,9 +336,11 @@ void Filler::addUserActions(not_null<UserData*> user) {
lang(lng_profile_invite_to_group),
[user] { AddBotToGroupBoxController::Start(user); });
}
_addAction(
lang(lng_profile_export_chat),
[=] { PeerMenuExportChat(user); });
if (user->canExportChatHistory()) {
_addAction(
lang(lng_profile_export_chat),
[=] { PeerMenuExportChat(user); });
}
}
_addAction(
lang(lng_profile_delete_conversation),
@@ -369,9 +371,11 @@ void Filler::addChatActions(not_null<ChatData*> chat) {
lang(lng_polls_create),
[=] { PeerMenuCreatePoll(chat); });
}
_addAction(
lang(lng_profile_export_chat),
[=] { PeerMenuExportChat(chat); });
if (chat->canExportChatHistory()) {
_addAction(
lang(lng_profile_export_chat),
[=] { PeerMenuExportChat(chat); });
}
}
_addAction(
lang(lng_profile_clear_and_exit),
@@ -411,11 +415,13 @@ void Filler::addChannelActions(not_null<ChannelData*> channel) {
lang(lng_polls_create),
[=] { PeerMenuCreatePoll(channel); });
}
_addAction(
lang(isGroup
? lng_profile_export_chat
: lng_profile_export_channel),
[=] { PeerMenuExportChat(channel); });
if (channel->canExportChatHistory()) {
_addAction(
lang(isGroup
? lng_profile_export_chat
: lng_profile_export_channel),
[=] { PeerMenuExportChat(channel); });
}
}
if (channel->amIn()) {
if (isGroup && !channel->isPublic()) {