-
Notifications
You must be signed in to change notification settings - Fork 508
Use room avatar as the conversation icon #4872
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The RoomAvatar does not provide (yet) a default avatar for a room if it has not been set. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Now the avatar of the other user will be returned when getting the avatar of a one-to-one conversation. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Although the avatar itself is stored in the app data the avatar id and its version are stored in the database for convenience. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The image itself is always got directly from the user avatar, so it is always up to date. However, as the version is specific to the room avatar and stored in the database it needs to be explicitly bumped. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The generic avatar system will not be included in Nextcloud 21, so for the time being Talk needs to provide its own endpoints for room avatars. Signed-off-by: Daniel Calviño Sánchez <[email protected]>
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
When the room avatar is an icon that should be provided by the client
the avatar id starts with "icon". The icons follow the same name
currently used in the web UI ("icon-public", "icon-contacts",
"icon-file", "icon-password", "icon-changelog" and "icon-mail") so the
name can be directly used.
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
The "custom" room avatars are the conversation picture set by the room participants, so they need to be got from the avatar endpoint. As it is an OCS endpoint the "OCS-APIRequest" header must be set, so the endpoint can not be directly used as the URL of a CSS image. Instead a request with the right headers is performed to the OCS endpoint, the response is treated as a blob, and then a URL to that blob is used. The "user" room avatars (those for one-to-one conversations) can be got in the same way, so othe avatar component is dropped in favour of the room avatar endpoint. Besides being more consistent it also removes the user menu that was shown on the avatar component and felt out of place in the room list (and also did not properly work, as it was not possible to show the menu without also changing to the one-to-one conversation). Signed-off-by: Daniel Calviño Sánchez <[email protected]>
7 tasks
Member
|
I will close the PR for now (as there was no active development since 6 months). Anyone can pick it up whenever they want and reopen the PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requires #4737
Kept as draft until #4737 is merged, but ready for review otherwise (only the last two commits are relevant).
Until the conversation picture can be set directly in Talk UI this can be tested by creating a one-to-one conversation and changing the user avatar in the normal user settings, or by creating a group or public conversation and using curl
curl --user username:password --request POST --header "OCS-APIRequest: true" --form "files[]=@/absolute/path/to/file.png" "http://localhost/ocs/v2.php/apps/spreed/api/v3/avatar/2r5ov6ze"curl --user username:password --request DELETE --header "OCS-APIRequest: true" "http://localhost/ocs/v2.php/apps/spreed/api/v3/avatar/2r5ov6ze"