Add command with logic to change user's display name#45
Add command with logic to change user's display name#45Nephyx wants to merge 3 commits intoHaider8:masterfrom
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.
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.
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.