[AB-80] fixing not cleaning up emote record when changing emote

This commit is contained in:
Sheldan
2023-01-10 19:15:27 +01:00
parent 3903039aac
commit db27f64832
2 changed files with 6 additions and 4 deletions

View File

@@ -166,6 +166,7 @@ public class EmoteServiceBean implements EmoteService {
.builder() .builder()
.fake(true) .fake(true)
.custom(false) .custom(false)
.animated(false)
.emoteKey(emoteText) .emoteKey(emoteText)
.build(); .build();
} }

View File

@@ -160,15 +160,16 @@ public class EmoteManagementServiceBean implements EmoteManagementService {
if(fakeEmote.getCustom()) { if(fakeEmote.getCustom()) {
log.debug("Setting existing emote (a: {}, c: {}, id: {}, discord id: {}) to new custom emote configuration: new id {}, animated {}.", log.debug("Setting existing emote (a: {}, c: {}, id: {}, discord id: {}) to new custom emote configuration: new id {}, animated {}.",
emoteBeingSet.getAnimated(), emoteBeingSet.getCustom(), emoteBeingSet.getId(), emoteBeingSet.getEmoteId(), fakeEmote.getEmoteId(), fakeEmote.getAnimated()); emoteBeingSet.getAnimated(), emoteBeingSet.getCustom(), emoteBeingSet.getId(), emoteBeingSet.getEmoteId(), fakeEmote.getEmoteId(), fakeEmote.getAnimated());
emoteBeingSet.setCustom(fakeEmote.getCustom());
emoteBeingSet.setEmoteId(fakeEmote.getEmoteId()); emoteBeingSet.setEmoteId(fakeEmote.getEmoteId());
emoteBeingSet.setEmoteKey(fakeEmote.getEmoteKey()); emoteBeingSet.setAnimated(fakeEmote.getAnimated());
} else { } else {
log.debug("Setting existing emote (a: {}, c: {}, id: {}, discord id: {}) to new default emote {}.", log.debug("Setting existing emote (a: {}, c: {}, id: {}, discord id: {}) to new default emote {}.",
emoteBeingSet.getAnimated(), emoteBeingSet.getCustom(), emoteBeingSet.getId(), emoteBeingSet.getEmoteId(), fakeEmote.getEmoteKey()); emoteBeingSet.getAnimated(), emoteBeingSet.getCustom(), emoteBeingSet.getId(), emoteBeingSet.getEmoteId(), fakeEmote.getEmoteKey());
emoteBeingSet.setCustom(false); emoteBeingSet.setEmoteId(null);
emoteBeingSet.setEmoteKey(fakeEmote.getEmoteKey()); emoteBeingSet.setAnimated(false);
} }
emoteBeingSet.setCustom(fakeEmote.getCustom());
emoteBeingSet.setEmoteKey(fakeEmote.getEmoteKey());
return emoteBeingSet; return emoteBeingSet;
} }
} }