[AB-139] changing the places at which there might be an uncached member object

fixing integer validator
fixing syncing roles not working if the role did not change in the database
fixing warn id being flipped
fixing star stats model
This commit is contained in:
Sheldan
2020-10-11 22:04:18 +02:00
parent 1d3c414d6b
commit 36d11371cb
105 changed files with 1762 additions and 1086 deletions

View File

@@ -1,6 +1,6 @@
package dev.sheldan.abstracto.moderation.models.template.commands;
import dev.sheldan.abstracto.core.models.context.UserInitiatedServerContext;
import dev.sheldan.abstracto.core.models.context.SlimUserInitiatedServerContext;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
@@ -13,7 +13,7 @@ import java.util.List;
@Getter
@Setter
@SuperBuilder
public class WarningsModel extends UserInitiatedServerContext {
public class WarningsModel extends SlimUserInitiatedServerContext {
/**
* A collection of {@link dev.sheldan.abstracto.moderation.models.database.Warning}s being rendered, might be all warnings of the server, or only the warnings of a specific user
*/

View File

@@ -12,7 +12,6 @@ import java.util.concurrent.CompletableFuture;
public interface MuteService {
CompletableFuture<Void> muteMember(Member memberToMute, Member userMuting, String reason, Instant unMuteDate, ServerChannelMessage message);
CompletableFuture<Void> muteAUserInAServer(AUserInAServer member, AUserInAServer userMuting, String reason, Instant unMuteDate, ServerChannelMessage message);
CompletableFuture<Void> muteUserInServer(FullUserInServer userToMute, FullUserInServer userMuting, String reason, Instant unMuteDate, ServerChannelMessage message);
CompletableFuture<Void> applyMuteRole(AUserInAServer aUserInAServer);
CompletableFuture<Void> muteMemberWithLog(MuteContext context);

View File

@@ -31,7 +31,8 @@ public interface MuteManagementService {
* @param muteId The id of the mute to search for
* @return An optional containing a {@link Mute} if the ID exists, and null otherwise
*/
Optional<Mute> findMute(Long muteId, Long serverId);
Optional<Mute> findMuteOptional(Long muteId, Long serverId);
Mute findMute(Long muteId, Long serverId);
/**
* Saves the given mute to the database.

View File

@@ -9,6 +9,7 @@ import java.util.List;
public interface UserNoteManagementService {
UserNote createUserNote(AUserInAServer aUserInAServer, String note);
void deleteNote(Long id, AServer server);
UserNote loadNote(Long userNoteId, Long serverId);
boolean noteExists(Long id, AServer server);
List<UserNote> loadNotesForUser(AUserInAServer aUserInAServer);
List<UserNote> loadNotesForServer(AServer server);

View File

@@ -15,6 +15,7 @@ public interface WarnManagementService {
List<Warning> getAllWarnsForUser(AUserInAServer aUserInAServer);
List<Warning> getAllWarningsOfServer(AServer server);
Long getActiveWarnsForUser(AUserInAServer aUserInAServer);
Optional<Warning> findById(Long id, Long serverId);
Optional<Warning> findByIdOptional(Long id, Long serverId);
Warning findById(Long id, Long serverId);
void deleteWarning(Warning warn);
}