diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index baf02adfc2..0cc9d7fc0d 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -981,7 +981,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_manage_messages_ttl_after1" = "24 hours"; "lng_manage_messages_ttl_after2" = "7 days"; -"lng_ttl_edit_title" = "Auto-delete messages in this chat"; "lng_ttl_edit_about" = "Automatically delete new messages after a certain period of time for you and {user}."; "lng_ttl_edit_about_group" = "Automatically delete new messages sent in this chat after a certain period of time."; "lng_ttl_edit_about_channel" = "Automatically delete new messages sent in this channel after a certain period of time."; diff --git a/Telegram/SourceFiles/boxes/confirm_box.cpp b/Telegram/SourceFiles/boxes/confirm_box.cpp index b2174236e0..f2b12f4bd5 100644 --- a/Telegram/SourceFiles/boxes/confirm_box.cpp +++ b/Telegram/SourceFiles/boxes/confirm_box.cpp @@ -666,8 +666,10 @@ void DeleteMessagesBox::prepare() { if (_wipeHistoryJustClear && _wipeHistoryPeer && (_wipeHistoryPeer->isUser() - || _wipeHistoryPeer->isMegagroup() - || _wipeHistoryPeer->isChat())) { + || (_wipeHistoryPeer->isChat() + && _wipeHistoryPeer->asChat()->canDeleteMessages()) + || (_wipeHistoryPeer->isChannel() + && _wipeHistoryPeer->asChannel()->canDeleteMessages()))) { _wipeHistoryPeer->updateFull(); _autoDeleteSettings.create( this, diff --git a/Telegram/SourceFiles/history/history_service.cpp b/Telegram/SourceFiles/history/history_service.cpp index ea60aa0f7c..2261bac1e8 100644 --- a/Telegram/SourceFiles/history/history_service.cpp +++ b/Telegram/SourceFiles/history/history_service.cpp @@ -374,8 +374,8 @@ void HistoryService::setMessageByAction(const MTPmessageAction &action) { auto prepareSetMessagesTTL = [this](const MTPDmessageActionSetMessagesTTL &action) { auto result = PreparedText{}; const auto period = action.vperiod().v; - const auto duration = (period == 5) AssertIsDebug() - ? u"5 seconds"_q AssertIsDebug() + const auto duration = (period == 5) + ? u"5 seconds"_q : (period < 3 * 86400) ? tr::lng_ttl_about_duration1(tr::now) : tr::lng_ttl_about_duration2(tr::now); diff --git a/Telegram/SourceFiles/ui/boxes/auto_delete_settings.cpp b/Telegram/SourceFiles/ui/boxes/auto_delete_settings.cpp index aae2e19cbd..4ab3bca2fb 100644 --- a/Telegram/SourceFiles/ui/boxes/auto_delete_settings.cpp +++ b/Telegram/SourceFiles/ui/boxes/auto_delete_settings.cpp @@ -190,7 +190,6 @@ void AutoDeleteSettingsBox( rpl::producer about, Fn callback) { box->setTitle(tr::lng_manage_messages_ttl_title()); - box->setWidth(st::boxWideWidth); struct State { TimeId period = 0; @@ -202,25 +201,25 @@ void AutoDeleteSettingsBox( const auto options = std::vector{ tr::lng_manage_messages_ttl_never(tr::now), - u"5 seconds"_q, AssertIsDebug() + //u"5 seconds"_q, AssertIsDebug() tr::lng_manage_messages_ttl_after1(tr::now), tr::lng_manage_messages_ttl_after2(tr::now), }; const auto periodToIndex = [&](TimeId period) { return !period ? 0 - : (period == 5) AssertIsDebug() - ? 1 AssertIsDebug() + //: (period == 5) AssertIsDebug() + //? 1 AssertIsDebug() : (period < 3 * 86400) - ? 2 - : 3; + ? 1 + : 2; }; const auto indexToPeriod = [&](int index) { return !index ? 0 - : (index == 1) AssertIsDebug() - ? 5 AssertIsDebug() - : (index == 2) + //: (index == 1) AssertIsDebug() + //? 5 AssertIsDebug() + : (index == 1) ? 86400 : 7 * 86400; };