mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Added settings link for global TTL to TTL box.
This commit is contained in:
parent
81c48e1b09
commit
8bcb30e84d
3 changed files with 19 additions and 3 deletions
|
@ -41,6 +41,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "window/themes/window_theme_editor_box.h" // GenerateSlug.
|
||||
#include "payments/payments_checkout_process.h"
|
||||
#include "settings/settings_common.h"
|
||||
#include "settings/settings_global_ttl.h"
|
||||
#include "settings/settings_folders.h"
|
||||
#include "settings/settings_main.h"
|
||||
#include "settings/settings_privacy_security.h"
|
||||
|
@ -485,6 +486,8 @@ bool ResolveSettings(
|
|||
return ::Settings::Chat::Id();
|
||||
} else if (section == u"change_number"_q) {
|
||||
return ::Settings::ChangePhone::Id();
|
||||
} else if (section == u"auto_delete"_q) {
|
||||
return ::Settings::GlobalTTLId();
|
||||
}
|
||||
return ::Settings::Main::Id();
|
||||
}();
|
||||
|
@ -843,7 +846,7 @@ const std::vector<LocalUrlHandler> &LocalUrlHandlers() {
|
|||
ResolvePrivatePost
|
||||
},
|
||||
{
|
||||
u"^settings(/language|/devices|/folders|/privacy|/themes|/change_number)?$"_q,
|
||||
u"^settings(/language|/devices|/folders|/privacy|/themes|/change_number|/auto_delete)?$"_q,
|
||||
ResolveSettings
|
||||
},
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace TTLMenu {
|
|||
struct Args {
|
||||
std::shared_ptr<Ui::Show> show;
|
||||
TimeId startTtl;
|
||||
rpl::producer<QString> about;
|
||||
rpl::producer<TextWithEntities> about;
|
||||
Fn<void(TimeId)> callback;
|
||||
bool hideDisable = false;
|
||||
};
|
||||
|
|
|
@ -94,11 +94,24 @@ Args TTLValidator::createArgs() const {
|
|||
}).send();
|
||||
show->hideLayer();
|
||||
};
|
||||
auto about = peer->isUser()
|
||||
auto about1 = peer->isUser()
|
||||
? tr::lng_ttl_edit_about(lt_user, rpl::single(peer->shortName()))
|
||||
: peer->isBroadcast()
|
||||
? tr::lng_ttl_edit_about_channel()
|
||||
: tr::lng_ttl_edit_about_group();
|
||||
auto about2 = tr::lng_ttl_edit_about2(
|
||||
lt_link,
|
||||
tr::lng_ttl_edit_about2_link(
|
||||
) | rpl::map([=](const QString &s) {
|
||||
return Ui::Text::Link(s, "tg://settings/auto_delete");
|
||||
}),
|
||||
Ui::Text::WithEntities);
|
||||
auto about = rpl::combine(
|
||||
std::move(about1),
|
||||
std::move(about2)
|
||||
) | rpl::map([](const QString &s1, TextWithEntities &&s2) {
|
||||
return TextWithEntities{ s1 }.append(u"\n\n"_q).append(std::move(s2));
|
||||
});
|
||||
const auto ttl = peer->messagesTTL();
|
||||
return { std::move(show), ttl, std::move(about), std::move(callback) };
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue