[AB-xxx] fixing edge case in which a server is duplicated for modmail prompt, because an available server has modmail enabled and uses another available server as appeal server

This commit is contained in:
Sheldan
2024-11-06 22:06:47 +01:00
parent 90816649e2
commit 0e95ddf198

View File

@@ -405,7 +405,7 @@ public class ModMailThreadServiceBean implements ModMailThreadService {
boolean possibleForModmail = false;
Long actualServerId = 0L;
Long potentialMainServer = configService.getLongValue(ModMailFeatureConfig.MOD_MAIL_APPEAL_SERVER, server.getId()); // what _other_ server is the appeal server
if(potentialMainServer != 0) {
if(potentialMainServer != 0 && !alreadyConsideredServers.contains(potentialMainServer)) {
if(featureModeService.featureModeActive(ModMailFeatureDefinition.MOD_MAIL, potentialMainServer, ModMailMode.MOD_MAIL_APPEALS)) {
Long configuredAppealServerId = configService.getLongValue(ModMailFeatureConfig.MOD_MAIL_APPEAL_SERVER, potentialMainServer);
if(configuredAppealServerId != 0 && configuredAppealServerId.equals(server.getId())) { // if the other server has set the current server as the appeal config