2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +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

@@ -7,8 +7,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "data/data_peer.h"
#include <rpl/filter.h>
#include <rpl/map.h>
#include "data/data_user.h"
#include "data/data_chat.h"
#include "data/data_channel.h"
@@ -26,6 +24,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/image/image.h"
#include "ui/empty_userpic.h"
#include "ui/text_options.h"
#include "history/history.h"
#include "history/view/history_view_element.h"
#include "history/history_item.h"
namespace {
@@ -376,6 +377,17 @@ void PeerData::setPinnedMessageId(MsgId messageId) {
}
}
bool PeerData::canExportChatHistory() const {
for (const auto &block : _owner->history(id)->blocks) {
for (const auto &message : block->messages) {
if (!message->data()->serviceMsg()) {
return true;
}
}
}
return false;
}
bool PeerData::setAbout(const QString &newAbout) {
if (_about == newAbout) {
return false;