Skip to content

Conversation

@Nephyx
Copy link
Contributor

@Nephyx Nephyx commented Oct 12, 2019

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.

@pep8speaks
Copy link

pep8speaks commented Oct 12, 2019

Hello @Nephyx! Thanks for updating this PR.

Line 63:13: E128 continuation line under-indented for visual indent

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')
Copy link

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')
Copy link

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"
}
Copy link
Contributor

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.

@Haider8
Copy link
Owner

Haider8 commented Oct 14, 2019

Any update on this pull request @Nephyx?

@Nephyx
Copy link
Contributor Author

Nephyx commented Oct 14, 2019

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).

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.

User should have an option to Change display name

4 participants