1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-13 00:28:10 -05:00

Display mute penalties on profile

Expire mute penalties on unmute
This commit is contained in:
Amos
2022-10-21 21:36:10 +01:00
committed by RaidMax
parent fe08463e2c
commit 34da216f95
6 changed files with 50 additions and 19 deletions

View File

@ -162,7 +162,12 @@ namespace WebfrontCore.Controllers
});
}
clientDto.ActivePenalty = activePenalties.OrderByDescending(_penalty => _penalty.Type).FirstOrDefault();
clientDto.ActivePenalty = activePenalties.MaxBy(penalty => penalty.Type switch
{
EFPenalty.PenaltyType.TempMute => 0,
EFPenalty.PenaltyType.Mute => 1,
_ => (int)penalty.Type
});
clientDto.Meta.AddRange(Authorized ? meta : meta.Where(m => !m.IsSensitive));
var strippedName = clientDto.Name.StripColors();