Skip to content

Commit

Permalink
fix: 🐛 Correctly calculate mentions when replying to reblogs
Browse files Browse the repository at this point in the history
  • Loading branch information
CPlusPatch committed Dec 25, 2024
1 parent 4b1b604 commit 53cd4fc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/composer/composer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,19 @@ const getMentions = () => {
return "";
}
const peopleToMention = relation.note.mentions
.concat(relation.note.account)
const note = relation.note.reblog || relation.note;
const peopleToMention = note.mentions
.concat(note.account)
// Deduplicate mentions
.filter((men, i, a) => a.indexOf(men) === i)
// Remove self
.filter((men) => men.id !== identity.value?.account.id);
if (peopleToMention.length === 0) {
return "";
}
const mentions = peopleToMention.map((me) => `@${me.acct}`).join(" ");
return `${mentions} `;
Expand Down

0 comments on commit 53cd4fc

Please sign in to comment.