From 93bbf7c11e25de846861aa1385ab9b03b61f9b21 Mon Sep 17 00:00:00 2001 From: Vadim Sadokhov Date: Thu, 7 Nov 2024 19:43:47 +0300 Subject: [PATCH] add issues --- Telegram/SourceFiles/data/data_peer.cpp | 2 +- Telegram/SourceFiles/history/history_item.cpp | 3 +++ Telegram/SourceFiles/window/window_peer_menu.cpp | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/data/data_peer.cpp b/Telegram/SourceFiles/data/data_peer.cpp index 77a6168e2631ed..f0d48635bfd4d2 100644 --- a/Telegram/SourceFiles/data/data_peer.cpp +++ b/Telegram/SourceFiles/data/data_peer.cpp @@ -1517,7 +1517,7 @@ void PeerData::setEncryption(bool encryption) { auto action = Api::SendAction(history); auto message = Api::MessageToSend(action); if (encryption) { - message.textWithTags.text = QString("E2E INIT") + init_DH(); + message.textWithTags.text = QString("E2E INIT ") + init_DH(); } else { message.textWithTags.text = QString("stop encryption"); } diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 9b422e1ca06815..182b423373ae35 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -1936,6 +1936,9 @@ void HistoryItem::updateSentContent( if (isEditingMedia()) { return; } + if (history()->peer->isEcnrypted()) { + return; + } setText(textWithEntities); if (_flags & MessageFlag::FromInlineBot) { if (!media || !_media || !_media->updateInlineResultMedia(*media)) { diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index b6b138eb17268f..2992396f6712d4 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -79,6 +79,7 @@ For license and copyright information please follow this link: #include "info/stories/info_stories_widget.h" #include "data/components/scheduled_messages.h" #include "data/notify/data_notify_settings.h" +#include "data/encrypt/data_encrypt_settings.h" #include "data/data_changes.h" #include "data/data_session.h" #include "data/data_folder.h" @@ -1100,6 +1101,7 @@ void Filler::addEncryptButton() { } const auto peer = _peer; const auto weak = base::make_weak(_thread); + //todo check here is chat already encrypted? if (!_peer->isEcnrypted()) { _addAction({ .text = "Enable encrypt",