mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-14 19:56:29 +00:00
[AB-xxx] setting duration to zero if it was not provided, for infraction storage
This commit is contained in:
@@ -88,6 +88,9 @@ public class BanServiceBean implements BanService {
|
|||||||
AUserInAServer bannedUser = userInServerManagementService.loadOrCreateUser(guild.getIdLong(), user.getIdLong());
|
AUserInAServer bannedUser = userInServerManagementService.loadOrCreateUser(guild.getIdLong(), user.getIdLong());
|
||||||
AUserInAServer banningUser = userInServerManagementService.loadOrCreateUser(banningMember);
|
AUserInAServer banningUser = userInServerManagementService.loadOrCreateUser(banningMember);
|
||||||
Map<String, String> parameters = new HashMap<>();
|
Map<String, String> parameters = new HashMap<>();
|
||||||
|
if(deletionDuration == null) {
|
||||||
|
deletionDuration = Duration.ZERO;
|
||||||
|
}
|
||||||
parameters.put(INFRACTION_PARAMETER_DELETION_DURATION_KEY, deletionDuration.toString());
|
parameters.put(INFRACTION_PARAMETER_DELETION_DURATION_KEY, deletionDuration.toString());
|
||||||
return infractionService.createInfractionWithNotification(bannedUser, infractionPoints, BAN_INFRACTION_TYPE, reason, banningUser, parameters, banLogMessage)
|
return infractionService.createInfractionWithNotification(bannedUser, infractionPoints, BAN_INFRACTION_TYPE, reason, banningUser, parameters, banLogMessage)
|
||||||
.thenApply(Infraction::getId);
|
.thenApply(Infraction::getId);
|
||||||
|
|||||||
Reference in New Issue
Block a user