[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()
.fake(true)
.custom(false)
.animated(false)
.emoteKey(emoteText)
.build();
}

View File

@@ -160,15 +160,16 @@ public class EmoteManagementServiceBean implements EmoteManagementService {
if(fakeEmote.getCustom()) {
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.setCustom(fakeEmote.getCustom());
emoteBeingSet.setEmoteId(fakeEmote.getEmoteId());
emoteBeingSet.setEmoteKey(fakeEmote.getEmoteKey());
emoteBeingSet.setAnimated(fakeEmote.getAnimated());
} else {
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.setCustom(false);
emoteBeingSet.setEmoteKey(fakeEmote.getEmoteKey());
emoteBeingSet.setEmoteId(null);
emoteBeingSet.setAnimated(false);
}
emoteBeingSet.setCustom(fakeEmote.getCustom());
emoteBeingSet.setEmoteKey(fakeEmote.getEmoteKey());
return emoteBeingSet;
}
}