mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-18 12:57:39 +00:00
[AB-xxx] adding information whether a modmail thread comes from an appeal to storage and to modmail notification
This commit is contained in:
@@ -59,6 +59,9 @@ public class ModMailThread implements Serializable {
|
||||
@Column(name = "closed")
|
||||
private Instant closed;
|
||||
|
||||
@Column(name = "appeal", nullable = false)
|
||||
private Boolean appeal;
|
||||
|
||||
/**
|
||||
* The messages which were officially posted in the context of the mod mail thread. Either via command (from the
|
||||
* staff side of view) or by messaging the bot (from the member view)
|
||||
|
||||
@@ -8,11 +8,14 @@ import lombok.Getter;
|
||||
@Builder
|
||||
public class ServerChoicePayload {
|
||||
private Long serverId;
|
||||
@Builder.Default
|
||||
private Boolean appealModmail = false;
|
||||
|
||||
public static ServerChoicePayload fromServerChoice(ServerChoice choice) {
|
||||
return ServerChoicePayload
|
||||
.builder()
|
||||
.serverId(choice.getServerId())
|
||||
.appealModmail(choice.getAppealModmail())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,8 @@ public class ModMailNotificationModel extends ServerContext {
|
||||
* The {@link GuildMessageChannel} in which the mod mail thread is handled
|
||||
*/
|
||||
private GuildMessageChannel channel;
|
||||
/**
|
||||
* Whether the modmail is created for the purpose of an appeal
|
||||
*/
|
||||
private boolean appeal;
|
||||
}
|
||||
|
||||
@@ -8,4 +8,6 @@ import lombok.Getter;
|
||||
public class ServerChoice {
|
||||
private String serverName;
|
||||
private Long serverId;
|
||||
@Builder.Default
|
||||
private Boolean appealModmail = false;
|
||||
}
|
||||
|
||||
@@ -25,11 +25,12 @@ public interface ModMailThreadService {
|
||||
* @param user The {@link User} to create the mod mail thread for
|
||||
* @param guild The {@link Guild} in which the mod mail thread should be created in
|
||||
* @param initialMessage The initial message sparking this mod mail thread, null in case it was created by a command
|
||||
* @param userInitiated Whether or not the mod mail thread was initiated by a user
|
||||
* @param userInitiated Whether 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.
|
||||
* @param appeal Whether the modmail thread was created for the purpose of an appeal
|
||||
* @return A {@link CompletableFuture future} which completes when the modmail thread is set up
|
||||
*/
|
||||
CompletableFuture<MessageChannel> createModMailThreadForUser(User user, Guild guild, Message initialMessage, boolean userInitiated, List<UndoActionInstance> undoActions);
|
||||
CompletableFuture<MessageChannel> createModMailThreadForUser(User user, Guild guild, Message initialMessage, boolean userInitiated, List<UndoActionInstance> undoActions, boolean appeal);
|
||||
|
||||
CompletableFuture<Void> sendContactNotification(User user, MessageChannel createdMessageChannel, MessageChannel feedBackChannel);
|
||||
CompletableFuture<Void> sendContactNotification(User user, MessageChannel createdMessageChannel, InteractionHook interactionHook);
|
||||
|
||||
@@ -104,9 +104,10 @@ public interface ModMailThreadManagementService {
|
||||
* Creates an instance of {@link ModMailThread} with the appropriate parameters and returns the created instance.
|
||||
* @param userInAServer The {@link AUserInAServer} for which the thread was created for
|
||||
* @param channel An instance of {@link AChannel} in which the conversation with the member is handled
|
||||
* @param appeal Whether the modmail thread is for the purpose of an appeal
|
||||
* @return The created instance of {@link ModMailThread}
|
||||
*/
|
||||
ModMailThread createModMailThread(AUserInAServer userInAServer, AChannel channel);
|
||||
ModMailThread createModMailThread(AUserInAServer userInAServer, AChannel channel, boolean appeal);
|
||||
|
||||
/**
|
||||
* Updates the {@link ModMailThread} with the new state and saves the instance.
|
||||
|
||||
Reference in New Issue
Block a user