Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2345 - Broken username in the in-app notification after the user has been kicked out #2346

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/model/contracts/shared/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ export function swapMentionIDForDisplayname (
}
): string {
const {
ourContactProfilesById,
getChatroomNameById,
usernameFromID,
userDisplayNameFromID
} = sbp('state/vuex/getters')
const { reverseNamespaceLookups } = sbp('state/vuex/state')
const possibleMentions = [
...Object.keys(ourContactProfilesById).map(u => makeMentionFromUserID(u).me).filter(v => !!v),
...Object.keys(reverseNamespaceLookups).map(u => makeMentionFromUserID(u).me).filter(v => !!v),
Copy link
Collaborator Author

@SebinSong SebinSong Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't know the exact context that this reverseNamespaceLookups field was created for but apparently this field contains user-ids for both current members and members who have been kicked out. (as opposed to ourContractProfilesById only having current members of the group) So making an update here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SebinSong this was introduced in this PR: #2294

Nice job realizing it would be useful for this issue!

makeChannelMention('[^\\s]+', true) // chat-mention as contractID has a format of `#:chatID:...`. So target them as a pattern instead of the exact strings.
]

Expand Down