mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +02:00
Added support of admin log filter for extended subscriptions.
This commit is contained in:
parent
e44aca06cb
commit
0241129948
4 changed files with 13 additions and 4 deletions
Telegram
Resources/langs
SourceFiles/history/admin_log
|
@ -4407,6 +4407,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
"lng_admin_log_filter_invite_links" = "Invite links";
|
||||
"lng_admin_log_filter_members_removed" = "Leaving members";
|
||||
"lng_admin_log_filter_topics" = "Topics";
|
||||
"lng_admin_log_filter_sub_extend" = "Subscription Renewals";
|
||||
"lng_admin_log_filter_all_admins" = "All users and admins";
|
||||
"lng_admin_log_filter_actions_admins_subtitle" = "Filter actions by admins";
|
||||
"lng_admin_log_filter_actions_admins_section" = "Show Actions by All Admins";
|
||||
|
|
|
@ -50,6 +50,10 @@ EditFlagsDescriptor<FilterValue::Flags> FilterValueLabels(bool isChannel) {
|
|||
? tr::lng_admin_log_filter_voice_chats
|
||||
: tr::lng_admin_log_filter_voice_chats_channel)(tr::now),
|
||||
},
|
||||
{
|
||||
Flag::SubExtend,
|
||||
tr::lng_admin_log_filter_sub_extend(tr::now),
|
||||
},
|
||||
};
|
||||
if (!isChannel) {
|
||||
settings.push_back({
|
||||
|
|
|
@ -28,8 +28,9 @@ struct FilterValue final {
|
|||
GroupCall = (1U << 14),
|
||||
Invites = (1U << 15),
|
||||
Topics = (1U << 16),
|
||||
SubExtend = (1U << 17),
|
||||
|
||||
MAX_FIELD = (1U << 16),
|
||||
MAX_FIELD = (1U << 17),
|
||||
};
|
||||
using Flags = base::flags<Flag>;
|
||||
friend inline constexpr bool is_flag_type(Flag) { return true; };
|
||||
|
|
|
@ -572,11 +572,13 @@ void InnerWidget::showFilter(Fn<void(FilterValue &&filter)> callback) {
|
|||
const auto users = ranges::views::all(
|
||||
peers
|
||||
) | ranges::views::transform([](not_null<PeerData*> p) {
|
||||
return not_null{ p->asUser() };
|
||||
return not_null{ p->asUser() };
|
||||
}) | ranges::to_vector;
|
||||
callback(FilterValue{
|
||||
.flags = collectFlags(),
|
||||
.admins = users,
|
||||
.admins = (admins.size() == users.size())
|
||||
? std::nullopt
|
||||
: std::optional(users),
|
||||
});
|
||||
});
|
||||
box->addButton(tr::lng_cancel(), [box] { box->closeBox(); });
|
||||
|
@ -835,7 +837,8 @@ void InnerWidget::preloadMore(Direction direction) {
|
|||
| ((f & LocalFlag::Delete) ? Flag::f_delete : empty)
|
||||
| ((f & LocalFlag::GroupCall) ? Flag::f_group_call : empty)
|
||||
| ((f & LocalFlag::Invites) ? Flag::f_invites : empty)
|
||||
| ((f & LocalFlag::Topics) ? Flag::f_forums : empty);
|
||||
| ((f & LocalFlag::Topics) ? Flag::f_forums : empty)
|
||||
| ((f & LocalFlag::SubExtend) ? Flag::f_sub_extend : empty);
|
||||
}();
|
||||
if (_filter.flags != 0) {
|
||||
flags |= MTPchannels_GetAdminLog::Flag::f_events_filter;
|
||||
|
|
Loading…
Add table
Reference in a new issue