[AB-167] adding warning created events and infraction counter

adding disabling of post targets
adding some logging for message sending failure consumer
This commit is contained in:
Sheldan
2021-10-25 00:04:08 +02:00
parent 8909e8ebe5
commit 0514d355c7
69 changed files with 1197 additions and 158 deletions

View File

@@ -286,8 +286,7 @@ public class ModMailThreadServiceBean implements ModMailThreadService {
.channel(channel)
.build();
MessageToSend messageToSend = templateService.renderEmbedTemplate("modmail_notification_message", modMailNotificationModel, channel.getGuild().getIdLong());
List<CompletableFuture<Message>> modmailping = postTargetService.sendEmbedInPostTarget(messageToSend, ModMailPostTargets.MOD_MAIL_PING, serverId);
return CompletableFuture.allOf(modmailping.toArray(new CompletableFuture[0]));
return FutureUtils.toSingleFutureGeneric(postTargetService.sendEmbedInPostTarget(messageToSend, ModMailPostTargets.MOD_MAIL_PING, serverId));
}
/**
@@ -660,7 +659,9 @@ public class ModMailThreadServiceBean implements ModMailThreadService {
.thenCompose(list -> list.getMainFuture().thenCompose(unused -> {
list.getFutures().forEach(messageCompletableFuture -> {
Message message = messageCompletableFuture.join();
undoActions.add(UndoActionInstance.getMessageDeleteAction(message.getGuild().getIdLong(), message.getChannel().getIdLong(), message.getIdLong()));
if(message != null) {
undoActions.add(UndoActionInstance.getMessageDeleteAction(message.getGuild().getIdLong(), message.getChannel().getIdLong(), message.getIdLong()));
}
});
return memberService.getMemberInServerAsync(serverId, userId).thenCompose(member ->
self.afterSuccessfulLog(modMailThreadId, closingContext.getNotifyUser(), member, undoActions)