summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkPostForm.vue
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-05-04 10:21:16 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-05-08 16:20:29 -0400
commitdf0d8045d5dc289102455315b9930cf82edaf3ad (patch)
tree873f138d96f3e0e3fa0d79899d1f9b0f3d2971f0 /packages/frontend/src/components/MkPostForm.vue
parentwhen replying to a note, auto-fill mentions based on the backend data instead... (diff)
downloadsharkey-df0d8045d5dc289102455315b9930cf82edaf3ad.tar.gz
sharkey-df0d8045d5dc289102455315b9930cf82edaf3ad.tar.bz2
sharkey-df0d8045d5dc289102455315b9930cf82edaf3ad.zip
fix duplicate mentions and spurious "user is not mentioned" warnings when replying to a DM thread including a user with a capitalized username
Diffstat (limited to 'packages/frontend/src/components/MkPostForm.vue')
-rw-r--r--packages/frontend/src/components/MkPostForm.vue6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue
index 59c23b090e..78e94d48b0 100644
--- a/packages/frontend/src/components/MkPostForm.vue
+++ b/packages/frontend/src/components/MkPostForm.vue
@@ -412,7 +412,7 @@ function checkMissingMention() {
const ast = mfm.parse(text.value);
for (const x of extractMentions(ast)) {
- if (!visibleUsers.value.some(u => (u.username === x.username) && (u.host === x.host))) {
+ if (!visibleUsers.value.some(u => (u.username.toLowerCase() === x.username.toLowerCase()) && (u.host === x.host))) {
hasNotSpecifiedMentions.value = true;
return;
}
@@ -425,7 +425,7 @@ function addMissingMention() {
const ast = mfm.parse(text.value);
for (const x of extractMentions(ast)) {
- if (!visibleUsers.value.some(u => (u.username === x.username) && (u.host === x.host))) {
+ if (!visibleUsers.value.some(u => (u.username.toLowerCase() === x.username.toLowerCase()) && (u.host === x.host))) {
misskeyApi('users/show', { username: x.username, host: x.host }).then(user => {
pushVisibleUser(user);
});
@@ -641,7 +641,7 @@ function showOtherSettings() {
//#endregion
function pushVisibleUser(user: Misskey.entities.UserDetailed) {
- if (!visibleUsers.value.some(u => u.username === user.username && u.host === user.host)) {
+ if (!visibleUsers.value.some(u => u.username.toLowerCase() === user.username.toLowerCase() && u.host === user.host)) {
visibleUsers.value.push(user);
}
}