-
Notifications
You must be signed in to change notification settings - Fork 17
Add command with logic to change user's display name #45
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
base: master
Are you sure you want to change the base?
Conversation
|
Hello @Nephyx! Thanks for updating this PR.
Comment last updated at 2019-10-12 21:36:19 UTC |
tmessage/cli.py
Outdated
| displayed_name = change_response["displayed_name"] | ||
| else: | ||
| print(Back.WHITE + Fore.RED + | ||
| "A new display name is missing", end='\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continuation line under-indented for visual indent
| return change_response["displayed_name"] | ||
| else: | ||
| print(Back.WHITE + Fore.RED + | ||
| "A new display name is missing", end='\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
continuation line under-indented for visual indent
| endpoint_url = f'{API_USER_URL}/changeDisplayName' | ||
| headers = { | ||
| "Content-Type": "application/json" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Nephyx,
To adapt the code to the protected route on API (I suggested this at Haider8/tmessage-api#3), when a request to change the displayed name is made, the request's header need the Authorization argument with a value of Bearer [access_token], too.
Whenever the user receives a token, it should be saved to a variable so that it can be sent later on in the request's header.
|
Any update on this pull request @Nephyx? |
Hi, I am almost done with implementing the route protection and expect to have it done in one or two days (based on my availability due to work and other duties). |
This PR adds a new user command
/display-name [NEW_DISPLAY_NAME]together with API call implementation which modifies user's display name in the database and immediately starts using it in the client.A new display name can be composed of multiple words.
Related to necessary backend changes in Haider8/tmessage-api#3 and closes #39.