mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Remove messages ttl edit from Manage Channel.
This commit is contained in:
parent
5f030bc0c8
commit
d67a5dc510
1 changed files with 1 additions and 43 deletions
|
@ -29,7 +29,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "data/data_changes.h"
|
#include "data/data_changes.h"
|
||||||
#include "history/admin_log/history_admin_log_section.h"
|
#include "history/admin_log/history_admin_log_section.h"
|
||||||
#include "history/view/controls/history_view_ttl_button.h"
|
|
||||||
#include "info/profile/info_profile_values.h"
|
#include "info/profile/info_profile_values.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "mainwidget.h"
|
#include "mainwidget.h"
|
||||||
|
@ -337,7 +336,6 @@ private:
|
||||||
//void fillInviteLinkButton();
|
//void fillInviteLinkButton();
|
||||||
void fillSignaturesButton();
|
void fillSignaturesButton();
|
||||||
void fillHistoryVisibilityButton();
|
void fillHistoryVisibilityButton();
|
||||||
void fillSetMessagesTTLButton();
|
|
||||||
void fillManageSection();
|
void fillManageSection();
|
||||||
|
|
||||||
void submitTitle();
|
void submitTitle();
|
||||||
|
@ -883,35 +881,6 @@ void Controller::fillHistoryVisibilityButton() {
|
||||||
refreshHistoryVisibility();
|
refreshHistoryVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::fillSetMessagesTTLButton() {
|
|
||||||
Expects(_controls.buttonsLayout != nullptr);
|
|
||||||
|
|
||||||
auto label = _peer->session().changes().peerFlagsValue(
|
|
||||||
_peer,
|
|
||||||
Data::PeerUpdate::Flag::MessagesTTL
|
|
||||||
) | rpl::map([=] {
|
|
||||||
const auto period = _peer->messagesTTL();
|
|
||||||
return !period
|
|
||||||
? tr::lng_manage_messages_ttl_never()
|
|
||||||
: (period == 5) // for debugging
|
|
||||||
? rpl::single<QString>("5 seconds") // for debugging
|
|
||||||
: (period < 3 * 86400)
|
|
||||||
? tr::lng_manage_messages_ttl_after1()
|
|
||||||
: tr::lng_manage_messages_ttl_after2();
|
|
||||||
}) | rpl::flatten_latest();
|
|
||||||
|
|
||||||
const auto buttonCallback = [=] {
|
|
||||||
Ui::show(
|
|
||||||
Box(HistoryView::Controls::AutoDeleteSettingsBox, _peer),
|
|
||||||
Ui::LayerOption::KeepOther);
|
|
||||||
};
|
|
||||||
AddButtonWithText(
|
|
||||||
_controls.buttonsLayout,
|
|
||||||
tr::lng_manage_messages_ttl_title(),
|
|
||||||
std::move(label),
|
|
||||||
buttonCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Controller::fillManageSection() {
|
void Controller::fillManageSection() {
|
||||||
Expects(_controls.buttonsLayout != nullptr);
|
Expects(_controls.buttonsLayout != nullptr);
|
||||||
|
|
||||||
|
@ -935,13 +904,6 @@ void Controller::fillManageSection() {
|
||||||
? channel->canEditPreHistoryHidden()
|
? channel->canEditPreHistoryHidden()
|
||||||
: chat->canEditPreHistoryHidden();
|
: chat->canEditPreHistoryHidden();
|
||||||
}();
|
}();
|
||||||
const auto canSetMessagesTTL = [&] {
|
|
||||||
// Leave this entry point only for channels for now.
|
|
||||||
// Groups and users have their entry point in 'Clear History' box.
|
|
||||||
return isChannel
|
|
||||||
&& !channel->isMegagroup()
|
|
||||||
&& channel->canDeleteMessages();
|
|
||||||
}();
|
|
||||||
|
|
||||||
const auto canEditPermissions = [&] {
|
const auto canEditPermissions = [&] {
|
||||||
return isChannel
|
return isChannel
|
||||||
|
@ -1007,9 +969,6 @@ void Controller::fillManageSection() {
|
||||||
if (canEditPreHistoryHidden) {
|
if (canEditPreHistoryHidden) {
|
||||||
fillHistoryVisibilityButton();
|
fillHistoryVisibilityButton();
|
||||||
}
|
}
|
||||||
if (canSetMessagesTTL) {
|
|
||||||
fillSetMessagesTTLButton();
|
|
||||||
}
|
|
||||||
if (canEditSignatures) {
|
if (canEditSignatures) {
|
||||||
fillSignaturesButton();
|
fillSignaturesButton();
|
||||||
}
|
}
|
||||||
|
@ -1017,8 +976,7 @@ void Controller::fillManageSection() {
|
||||||
|| canEditSignatures
|
|| canEditSignatures
|
||||||
//|| canEditInviteLinks
|
//|| canEditInviteLinks
|
||||||
|| canViewOrEditLinkedChat
|
|| canViewOrEditLinkedChat
|
||||||
|| canEditUsername
|
|| canEditUsername) {
|
||||||
|| canSetMessagesTTL) {
|
|
||||||
AddSkip(
|
AddSkip(
|
||||||
_controls.buttonsLayout,
|
_controls.buttonsLayout,
|
||||||
st::editPeerTopButtonsLayoutSkip,
|
st::editPeerTopButtonsLayoutSkip,
|
||||||
|
|
Loading…
Add table
Reference in a new issue