matrix-org / matrix-appservice-discord

A bridge between Matrix and Discord.
Apache License 2.0
785 stars 148 forks source link

Apply nick pattern to user updates #891

Open TheTechmage opened 11 months ago

TheTechmage commented 11 months ago

When a nickname is updated for a user, and it isn't updated as a GuildMember object, we fail to apply the nick pattern to the Matrix nickname for the ghost user. By using the same logic as the GetUserStateForGuildMember in GetUserStateForDiscordUser, the nickname should now match the nickname pattern. Hopefully this will cut back on nickname changes being echoed out in Matrix channels, when no changes were made in the first place. At the very least, if a prefix/suffix is added to usernames, those should remain on the user at all times now.