Resolves issue where muted player would be unmuted when flag penalty was removed (#303)
* resolves issue where muted player would be unmuted when flag penalty was removed * Revert accidental code format
This commit is contained in:
@ -215,7 +215,8 @@ namespace SharedLibraryCore.Services
|
||||
return await activePenaltiesIds.Select(ids => ids.Penalty).ToListAsync();
|
||||
}
|
||||
|
||||
public virtual async Task RemoveActivePenalties(int aliasLinkId, long networkId, Reference.Game game, int? ipAddress = null)
|
||||
public virtual async Task RemoveActivePenalties(int aliasLinkId, long networkId, Reference.Game game, int? ipAddress = null,
|
||||
EFPenalty.PenaltyType[] penaltyTypes = null)
|
||||
{
|
||||
await using var context = _contextFactory.CreateContext();
|
||||
var now = DateTime.UtcNow;
|
||||
@ -226,6 +227,7 @@ namespace SharedLibraryCore.Services
|
||||
{
|
||||
var ids = activePenalties.Select(penalty => penalty.PenaltyId);
|
||||
await context.Penalties.Where(penalty => ids.Contains(penalty.PenaltyId))
|
||||
.Where(pen => penaltyTypes == null || penaltyTypes.Contains(pen.Type))
|
||||
.ForEachAsync(penalty =>
|
||||
{
|
||||
penalty.Active = false;
|
||||
|
Reference in New Issue
Block a user