Skip to content

Commit

Permalink
Merge pull request #13797 from nextcloud/fix/13778/federation-fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
Antreesy authored Nov 18, 2024
2 parents 578861b + 3927d0b commit 1b015af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/composables/useChatMentions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/composables/useDocumentTitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function useDocumentTitle() {
* - a conversation has a different last message id then previously
*/
const shouldShowAsterisk = Object.keys(newLastMessageMap).some(token => {
return !savedLastMessageMap.value[token] // Conversation is new
return savedLastMessageMap.value[token] === undefined // Conversation is new
|| (savedLastMessageMap.value[token] !== newLastMessageMap[token] // Last message changed
&& newLastMessageMap[token] !== -1) // But is not from the current user
})
Expand Down

0 comments on commit 1b015af

Please sign in to comment.