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

Handle username changes #50

Open
tedr56 opened this issue Mar 16, 2015 · 8 comments
Open

Handle username changes #50

tedr56 opened this issue Mar 16, 2015 · 8 comments
Labels

Comments

@tedr56
Copy link

tedr56 commented Mar 16, 2015

I wonder if NodeBB have a hook in case of username modification.

In that case, it would be usefull to change all post mentions to the new username.

@julianlam
Copy link
Owner

We could add it, but the mentions plugin is just a transparent layer. It does not record the pids containing mentions, so this would add significant complexity to the plugin if we wanted to handle username changes...

@barisusakli
Copy link
Collaborator

How about we store user IDs in the raw post content for mentions? IE post content has @123 stored and when its rendered it gets replaced by the username of uid 123.

Obviously its a breaking change.

@julianlam
Copy link
Owner

That might work, although we'd want to use a syntax that wouldn't normally be a regular username 😄

@~12345

@psychobunny
Copy link
Collaborator

Probably want to avoid syntax that markdown understands as well, I can already sense the potential explosions :D

@barisusakli
Copy link
Collaborator

For this to work we need to change what we insert into the composer
Instead of @psychobunny we should put in [@mention ](/uid/3) then even if the user changes their username we can replace mention with their current userslug using the uid.

@julianlam
Copy link
Owner

Bumping.

The crux of the problem here is I have a strong stance against parsing on the way in. Right now, for UX purposes, the end user sees something like @username in the composer, and I wouldn't want to change the syntax into a more unfriendly one like [@mention ](/uid/3).

The solution would probably have to be some sort of one-time exception to this informal rule...

The syntax would be something like @123|mention, where if the user puts @mention, then it is changed to @123|mention prior to saving. The canonical syntax would be @123, which we'd replace the uid with the username.

For history purposes, we wouldn't want to replace the mention text in old posts (unless it was just the @{uid} variant, which would be handled automatically).

The other complicating factor is that this plugin is super old and has a lot of built-up logic over the years that needs unwinding 😑

@chezfo
Copy link

chezfo commented Jun 7, 2021

The syntax would be something like @123|mention, where if the user puts @mention, then it is changed to @123|mention prior to saving. The canonical syntax would be @123, which we'd replace the uid with the username

While this solution does solve the problem,
But before saving, the text will not be set as a link, so it will not be possible to see in the preview window that it is indeed mentioned as a link.

But can be resolved that at the end of the mention @yusernam Will be replaced by @yusernam|123

I did not understand why history has value, when the mention does not direct you anywhere ...

@pitaj
Copy link
Collaborator

pitaj commented Jun 7, 2021

Huh? Mentions link you to their user page.

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

No branches or pull requests

6 participants