mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-01-07 01:38:32 +00:00
[AB-199] adding build of sources and javadoc
fixing javadoc as various places adding release plugin adding developer connection to scm updating release pipeline to new action versions
This commit is contained in:
@@ -198,6 +198,7 @@ public class ModMailThreadServiceBean implements ModMailThreadService {
|
||||
* @param channel The created {@link TextChannel} in which the mod mail thread is dealt with
|
||||
* @param userInitiated Whether or not the thread was initiated by a member
|
||||
* @param undoActions The list of actions to undo, in case an exception occurs
|
||||
* @return A {@link CompletableFuture future} which completes when the setup is done
|
||||
*/
|
||||
@Transactional
|
||||
public CompletableFuture<Void> performModMailThreadSetup(Member member, Message initialMessage, TextChannel channel, boolean userInitiated, List<UndoActionInstance> undoActions) {
|
||||
@@ -237,6 +238,8 @@ public class ModMailThreadServiceBean implements ModMailThreadService {
|
||||
/**
|
||||
* Sends the message containing the pings to notify the staff members to handle the opened {@link ModMailThread}
|
||||
* @param member The {@link FullUserInServer} which opened the thread
|
||||
* @param channel The created {@link TextChannel} in which the mod mail thread is dealt with
|
||||
* @return A {@link CompletableFuture future} which complets when the notification has been sent
|
||||
*/
|
||||
@Transactional
|
||||
public CompletableFuture<Void> sendModMailNotification(Member member, TextChannel channel) {
|
||||
@@ -519,7 +522,7 @@ public class ModMailThreadServiceBean implements ModMailThreadService {
|
||||
|
||||
@Override
|
||||
public CompletableFuture<Void> closeModMailThread(ModMailThread modMailThread, String note, boolean notifyUser, boolean logThread, List<UndoActionInstance> undoActions) {
|
||||
metricService.incrementCounter(MODMAIL_THREAD_CREATED_COUNTER);
|
||||
metricService.incrementCounter(MODMAIL_THREAD_CLOSED_COUNTER);
|
||||
Long modMailThreadId = modMailThread.getId();
|
||||
log.info("Starting closing procedure for thread {}", modMailThread.getId());
|
||||
List<ModMailMessage> modMailMessages = modMailThread.getMessages();
|
||||
@@ -562,6 +565,7 @@ public class ModMailThreadServiceBean implements ModMailThreadService {
|
||||
* @param messages The list of loaded {@link Message} to log
|
||||
* @param serverId The ID of the {@link Guild} the {@link ModMailThread} is in
|
||||
* @param userId The ID of the user the {@link ModMailThread} is about
|
||||
* @return A {@link CompletableFuture future} which completes when the messages have been logged
|
||||
*/
|
||||
@Transactional
|
||||
public CompletableFuture<Void> logMessagesToModMailLog(String note, Boolean notifyUser, Long modMailThreadId, List<UndoActionInstance> undoActions, LoadedModmailThreadMessageList messages, Long serverId, Long userId) {
|
||||
@@ -575,7 +579,11 @@ public class ModMailThreadServiceBean implements ModMailThreadService {
|
||||
});
|
||||
return memberService.getMemberInServerAsync(serverId, userId).thenCompose(member ->
|
||||
self.afterSuccessfulLog(modMailThreadId, notifyUser, member, undoActions)
|
||||
);
|
||||
).exceptionally(throwable -> {
|
||||
log.warn("Failed to retrieve member for closing the modmail thread. Closing without member information.", throwable);
|
||||
self.afterSuccessfulLog(modMailThreadId, false, null, undoActions);
|
||||
return null;
|
||||
});
|
||||
});
|
||||
} catch (Exception e) {
|
||||
log.error("Failed to log mod mail messages", e);
|
||||
@@ -589,7 +597,9 @@ public class ModMailThreadServiceBean implements ModMailThreadService {
|
||||
* @param modMailThreadId The ID of the {@link ModMailThread} which is being closed.
|
||||
* @param notifyUser Whether or not the user should be notified
|
||||
* @param undoActions The list of {@link UndoActionInstance} to execute in case of exceptions
|
||||
* @param modMailThreaduser The {@link Member member} for which the {@link ModMailThread thread} was for
|
||||
* @throws ModMailThreadNotFoundException in case the {@link ModMailThread} is not found by the ID
|
||||
* @return A {@link CompletableFuture future} which completes after the messages have been logged
|
||||
*/
|
||||
@Transactional
|
||||
public CompletableFuture<Void> afterSuccessfulLog(Long modMailThreadId, Boolean notifyUser, Member modMailThreaduser, List<UndoActionInstance> undoActions) {
|
||||
@@ -620,6 +630,7 @@ public class ModMailThreadServiceBean implements ModMailThreadService {
|
||||
* @param modMailThreadId The ID of the {@link ModMailThread} to delete the {@link MessageChannel} from
|
||||
* @param undoActions The list of {@link UndoActionInstance} to execute in case of exceptions
|
||||
* @throws ModMailThreadNotFoundException in case the {@link ModMailThread} is not found by the ID
|
||||
* @return A {@link CompletableFuture future} which completes after the {@link TextChannel channel} in which the thread was has been deleted
|
||||
*/
|
||||
@Transactional
|
||||
public CompletableFuture<Void> deleteChannelAndClose(Long modMailThreadId, List<UndoActionInstance> undoActions) {
|
||||
@@ -653,6 +664,7 @@ public class ModMailThreadServiceBean implements ModMailThreadService {
|
||||
* @param modMailThreadId The ID of the {@link ModMailThread} to log the messages of
|
||||
* @param messages The list of {@link CompletableFuture} which contain the {@link Message} which could be loaded
|
||||
* @param note The note which was entered when closing the {@link ModMailThread}
|
||||
* @param undoActions A list of {@link dev.sheldan.abstracto.core.models.UndoAction actions} to be undone in case the operation fails. This list will be filled in the method.
|
||||
* @throws ModMailThreadNotFoundException in case the {@link ModMailThread} is not found by the ID
|
||||
* @return An instance of {@link CompletableFutureList}, which contains a main {@link CompletableFuture} which is resolved,
|
||||
* when all of the smaller {@link CompletableFuture} in it are resolved. We need this construct, because we need to access
|
||||
@@ -762,6 +774,9 @@ public class ModMailThreadServiceBean implements ModMailThreadService {
|
||||
* @param modMailThreadId The ID of the {@link ModMailThread} for which the messages were sent for
|
||||
* @param anonymous Whether or not the messages were send anonymous
|
||||
* @param moderator The original {@link AUserInAServer} which authored the messages
|
||||
* @param createdMessageInDM The {@link Message message} which was sent to the private channel with the {@link User user}
|
||||
* @param modMailThreadMessage The {@link Message message} which was sent in the channel representing the {@link ModMailThread thread}. Might be null.
|
||||
* @param replyCommandMessage The {@link Message message} which contained the command used to reply to the user
|
||||
* @throws ModMailThreadNotFoundException in case the {@link ModMailThread} is not found by the ID
|
||||
*/
|
||||
@Transactional
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ModMailClosingHeaderModel {
|
||||
|
||||
/**
|
||||
* The duration between the creation and closed date of a {@link ModMailThread}
|
||||
* @return
|
||||
* @return The duration between the creation date and the date the thread has been closed
|
||||
*/
|
||||
public Duration getDuration() {
|
||||
return Duration.between(closedThread.getCreated(), closedThread.getClosed());
|
||||
|
||||
@@ -26,6 +26,8 @@ public interface ModMailThreadService {
|
||||
* @param initialMessage The initial message sparking this mod mail thread, null in case it was created by a command
|
||||
* @param feedBackChannel The {@link MessageChannel} in which feedback about exceptions should be posted to
|
||||
* @param userInitiated Whether or not the mod mail thread was initiated by a user
|
||||
* @param undoActions A list of {@link dev.sheldan.abstracto.core.models.UndoAction actions} to be undone in case the operation fails. This list will be filled in the method.
|
||||
* @return A {@link CompletableFuture future} which completes when the modmail thread is set up
|
||||
*/
|
||||
CompletableFuture<Void> createModMailThreadForUser(Member member, Message initialMessage, MessageChannel feedBackChannel, boolean userInitiated, List<UndoActionInstance> undoActions);
|
||||
|
||||
@@ -51,7 +53,9 @@ public interface ModMailThreadService {
|
||||
* In case there was no channel found, this will cause a message to be shown to the user and the existing mod mail thread will be closed.
|
||||
* This is the case, if the mod mail thread was still open in the database, but no text channel was found anymore.
|
||||
* @param modMailThread The {@link ModMailThread} on which the user answered
|
||||
* @param undoActions A list of {@link dev.sheldan.abstracto.core.models.UndoAction actions} to be undone in case the operation fails. This list will be filled in the method.
|
||||
* @param messageFromUser The {@link Message} object which was sent by the user as an answer
|
||||
* @return A {@link CompletableFuture future} which completes when the message has been relayed to the channel
|
||||
*/
|
||||
CompletableFuture<Message> relayMessageToModMailThread(ModMailThread modMailThread, Message messageFromUser, List<UndoActionInstance> undoActions);
|
||||
|
||||
@@ -63,8 +67,9 @@ public interface ModMailThreadService {
|
||||
* @param message The pure {@link Message} containing the command which caused the reply
|
||||
* @param anonymous Whether or nor the message should be send anonymous
|
||||
* @param feedBack The {@link MessageChannel} in which feedback about possible exceptions should be sent to
|
||||
* @param undoActions list of {@link UndoActionInstance} to execute in case this fails
|
||||
* @param undoActions A list of {@link dev.sheldan.abstracto.core.models.UndoAction actions} to be undone in case the operation fails. This list will be filled in the method.
|
||||
* @param targetMember The {@link Member} the {@link ModMailThread} is about.
|
||||
* @return A {@link CompletableFuture future} which completes when the message has been relayed to the DM
|
||||
*/
|
||||
CompletableFuture<Void> relayMessageToDm(Long threadId, String text, Message message, boolean anonymous, MessageChannel feedBack, List<UndoActionInstance> undoActions, Member targetMember);
|
||||
|
||||
@@ -77,6 +82,8 @@ public interface ModMailThreadService {
|
||||
* @param note The text of the note used for the header message of the logged mod mail thread.
|
||||
* @param notifyUser Whether or not the user should be notified
|
||||
* @param log whether or not the closed {@link ModMailThread} should be logged (if the {@link dev.sheldan.abstracto.core.config.FeatureMode} is enabled)
|
||||
* @param undoActions A list of {@link dev.sheldan.abstracto.core.models.UndoAction actions} to be undone in case the operation fails. This list will be filled in the method.
|
||||
* @return A {@link CompletableFuture future} which completes when the {@link ModMailThread thread} has been closed.
|
||||
*/
|
||||
CompletableFuture<Void> closeModMailThread(ModMailThread modMailThread, String note, boolean notifyUser, List<UndoActionInstance> undoActions, Boolean log);
|
||||
|
||||
@@ -90,6 +97,8 @@ public interface ModMailThreadService {
|
||||
* logging the mod mail thread
|
||||
* @param notifyUser Whether or not the user should be notified
|
||||
* @param logThread Whether or not the thread should be logged to the appropriate post target
|
||||
* @param undoActions A list of {@link dev.sheldan.abstracto.core.models.UndoAction actions} to be undone in case the operation fails. This list will be filled in the method.
|
||||
* @return A {@link CompletableFuture future} which completes when the {@link ModMailThread thread} has been closed
|
||||
*/
|
||||
CompletableFuture<Void> closeModMailThread(ModMailThread modMailThread, String note, boolean notifyUser, boolean logThread, List<UndoActionInstance> undoActions);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public interface ModMailMessageManagementService {
|
||||
* @param author The {@link AUserInAServer} who authored the {@link Message} originally
|
||||
* @param anonymous Whether or not the message was sent anonymous (only possible by staff members)
|
||||
* @param dmChannel Whether or not the message originated from the user, and therefore in an direct message channel
|
||||
* @return
|
||||
* @return The created {@link ModMailMessage message} instance
|
||||
*/
|
||||
ModMailMessage addMessageToThread(ModMailThread modMailThread, Message createdMessageInDM, Message createdMessageInChannel, Message userPostedMessage, AUserInAServer author, Boolean anonymous, Boolean dmChannel);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user