show trigger regex for profanity determent plugin

This commit is contained in:
RaidMax
2019-08-08 15:30:06 -05:00
parent b8a310bb07
commit 3051d44b0d
4 changed files with 40 additions and 19 deletions

View File

@ -592,5 +592,22 @@ namespace SharedLibraryCore.Services
}
}
#endregion
/// <summary>
/// retrieves the number of time the given client id has been reported
/// </summary>
/// <param name="clientId">client id to search for report counts of</param>
/// <returns></returns>
public async Task<int> GetClientReportCount(int clientId)
{
using (var ctx = new DatabaseContext(true))
{
return await ctx.Penalties
.Where(_penalty => _penalty.Active)
.Where(_penalty => _penalty.OffenderId == clientId)
.Where(_penalty => _penalty.Type == EFPenalty.PenaltyType.Report)
.CountAsync();
}
}
}
}

View File

@ -26,7 +26,7 @@ namespace SharedLibraryCore.Services
Expires = newEntity.Expires,
Offense = newEntity.Offense,
When = DateTime.UtcNow,
AutomatedOffense = newEntity.AutomatedOffense,
AutomatedOffense = newEntity.AutomatedOffense ?? newEntity.Punisher.AdministeredPenalties?.FirstOrDefault()?.AutomatedOffense,
IsEvadedOffense = newEntity.IsEvadedOffense
};