Mute Banner for Profile & Prevent Self-Target & Correctly Expire Early Unmutes (#272)
* Fix self-targeting Remove creation of penalty on mute expiration * Display mute penalties on profile Expire mute penalties on unmute * Resolves issues in code review Added comment in ClientController.cs Fixed order of operations in MuteManager.cs Fixed condition in MuteManager.cs * Fix self-targeting Remove creation of penalty on mute expiration * Display mute penalties on profile Expire mute penalties on unmute * Resolves issues in code review Added comment in ClientController.cs Fixed order of operations in MuteManager.cs Fixed condition in MuteManager.cs * Changed localisation value to be more generic Fix null reference warning (it should never be null) (34da216)
This commit is contained in:
@ -162,7 +162,13 @@ namespace WebfrontCore.Controllers
|
||||
});
|
||||
}
|
||||
|
||||
clientDto.ActivePenalty = activePenalties.OrderByDescending(_penalty => _penalty.Type).FirstOrDefault();
|
||||
// Reducing the enum value for Temp/Mute so bans appear in client banner first
|
||||
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();
|
||||
|
Reference in New Issue
Block a user