diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2024-11-17 15:02:35 +0100 |
---|---|---|
committer | Maksim Sukharev <antreesy.web@gmail.com> | 2024-11-17 15:02:35 +0100 |
commit | 3927d0ba0cfa5649f3099223712a743f65f9f162 (patch) | |
tree | 83720a4a2df48c3d0a3bc04925da214b19b37d8c | |
parent | cd10d808ccf307f56a592d30ae15efe8a51aba60 (diff) |
fix: autocomplete federated users mentions with mentionIdfix/13778/federation-fixups
- for federated users mentionId contains prefix, which should be passed
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
-rw-r--r-- | src/composables/useChatMentions.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/composables/useChatMentions.ts b/src/composables/useChatMentions.ts index 37a6394f75..bb184995d1 100644 --- a/src/composables/useChatMentions.ts +++ b/src/composables/useChatMentions.ts @@ -52,7 +52,11 @@ function useChatMentionsComposable(token: Ref<string>): ReturnType { * @param isDarkTheme whether current theme is dark */ function parseMention(possibleMention: ChatMention, token: string, isDarkTheme: boolean): AutocompleteChatMention { - const chatMention: AutocompleteChatMention = { ...possibleMention, status: undefined } + const chatMention: AutocompleteChatMention = { + ...possibleMention, + id: possibleMention.mentionId ?? possibleMention.id, // mentionId should be the default match since 'federation-v1' + status: undefined, + } // Set icon for candidate mentions that are not for users. if (possibleMention.source === 'calls') { @@ -85,13 +89,11 @@ function useChatMentionsComposable(token: Ref<string>): ReturnType { } } - // mentionId should be the default match since 'federation-v1' - const id = possibleMention.mentionId ?? possibleMention.id // caching the user id data for each possible mention if (!userDataTokenMap.value[token]) { Vue.set(userDataTokenMap.value, token, {}) } - Vue.set(userDataTokenMap.value[token], id, chatMention) + Vue.set(userDataTokenMap.value[token], chatMention.id, chatMention) return chatMention } |