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

Check the displayname of a Matrix user before updating their nick #1157

Merged
merged 1 commit into from
Oct 20, 2020

Conversation

Half-Shot
Copy link
Contributor

Fixes #1155

@Half-Shot Half-Shot requested a review from a team October 19, 2020 16:10
Copy link
Member

@jaywink jaywink left a comment

Choose a reason for hiding this comment

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

One comment due to poor understanding of bridge code.

req.log.warn(`Didn't change nick on the IRC side: ${e}`);
const intent = this.ircBridge.getAppServiceBridge().getIntent();
// Check that the /profile matches the displayname.
const userProfile = await intent.getProfileInfo(event.state_key, "displayname");
Copy link
Member

Choose a reason for hiding this comment

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

My understanding of the bridges is still poor, but looks like this code is only handled "on join"? So wondering shouldn't it be whenever the matrix side changes display name? And also if this is code that runs for everyone during a startup, will the profile details gets fetched for everyone or just changed names since previous restart?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, changing displaynames manifests as a resend of the m.room.member[content.membership="join"] event, which is handled by this function every time. onJoin is a slight misnomer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And also if this is code that runs for everyone during a startup, will the profile details gets fetched for everyone or just changed names since previous restart?

We shouldn't see a join for everyone during startup, so I don't think this is a huge concern.

@Half-Shot Half-Shot merged commit ad67610 into develop Oct 20, 2020
@Half-Shot Half-Shot deleted the hs/nick-profile-check branch October 20, 2020 10:48
@erciccione
Copy link

Curious to see how this will relate to #757, since the IRC nick is changed to GuestXYZ when the user gets unidentified (for reasons unknown for now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check /profile before changing nick on m.room.member update
3 participants