Added date of end of ban from group to admin log.

This commit is contained in:
23rd
2026-01-06 17:49:29 +03:00
parent 4ffddae162
commit 5eeb9e561d
2 changed files with 15 additions and 1 deletions
+1
View File
@@ -6159,6 +6159,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_admin_log_stopped_poll" = "{from} stopped poll:";
"lng_admin_log_invited" = "invited {user}";
"lng_admin_log_banned" = "banned {user}";
"lng_admin_log_banned_until" = "banned {user} {until}";
"lng_admin_log_unbanned" = "unbanned {user}";
"lng_admin_log_restricted" = "changed restrictions for {user} {until}";
"lng_admin_log_promoted" = "changed privileges for {user}";
@@ -354,10 +354,23 @@ TextWithEntities GeneratePermissionsChangeText(
const auto prevFlags = prevRights.flags;
const auto indefinitely = ChannelData::IsRestrictedForever(newUntil);
if (newFlags & Flag::ViewMessages) {
return tr::lng_admin_log_banned(
if (indefinitely) {
return tr::lng_admin_log_banned(
tr::now,
lt_user,
user,
tr::marked);
}
return tr::lng_admin_log_banned_until(
tr::now,
lt_user,
user,
lt_until,
tr::lng_admin_log_restricted_until(
tr::now,
lt_date,
{ langDateTime(base::unixtime::parse(newUntil)) },
tr::marked),
tr::marked);
} else if (newFlags == 0
&& (prevFlags & Flag::ViewMessages)