Skip to content

Commit

Permalink
Place new reaction where server specified it
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacocococo committed Aug 19, 2024
1 parent 309d272 commit 5d411e8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,11 @@ private void addEmojiReaction(String emoji, Emoji info) {
item.createRequest(emoji, existing==null ? 1 : existing.count, false, null, (status)->{
resetBtn.run();
if(finalExisting==null){
int pos=item.status.reactions.size();
int pos=status.reactions.stream()
.filter(r->r.name.equals(info!=null ? info.shortcode : emoji))
.findFirst()
.map(r->status.reactions.indexOf(r))
.orElse(item.status.reactions.size());
boolean previouslyEmpty=item.status.reactions.isEmpty();
item.status.reactions.add(pos, info!=null ? EmojiReaction.of(info, me) : EmojiReaction.of(emoji, me));
if(previouslyEmpty)
Expand Down

0 comments on commit 5d411e8

Please sign in to comment.