Skip to content

Update endpoints for blurhash implementation. - #650

Merged
jplatte merged 4 commits into
ruma:mainfrom
Frinksy:blurhash
Jul 4, 2021
Merged

Update endpoints for blurhash implementation.#650
jplatte merged 4 commits into
ruma:mainfrom
Frinksy:blurhash

Conversation

@Frinksy

@Frinksy Frinksy commented Jun 26, 2021

Copy link
Copy Markdown
Contributor

Add blurhash to profile and avatar endpoints.

Resolves: #450

@Frinksy
Frinksy requested a review from jplatte as a code owner June 26, 2021 16:17

@jplatte jplatte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments on get_avatar_url apply to the other two modified modules as well.

Comment thread crates/ruma-client-api/src/r0/profile/get_avatar_url.rs
Comment thread crates/ruma-client-api/src/r0/profile/get_avatar_url.rs Outdated
Comment thread crates/ruma-client-api/src/r0/profile/set_avatar_url.rs Outdated
@jplatte
jplatte changed the base branch from next to main June 29, 2021 21:47
@jplatte
jplatte requested review from DevinR528 and iinuwa as code owners June 29, 2021 21:47
@jplatte

jplatte commented Jun 29, 2021

Copy link
Copy Markdown
Member

Changed the base branch to main since this can (and should) be done in a backwards-compatible manner. You can git rebase -i main your branch and remove the unrelated commits as part of that to synchronize this PR to the main branch.

@iinuwa iinuwa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Sorry for the late response.)

It looks like the changes to GET /_matrix/federation/v1/query/profile are missing. The previous implementation also only implemented the blurhash response field for PUT /_matrix/media/r0/upload, but not the generate_blurhash request query parameter.

The types are also missing for the m.sticker and m.room.member events.

@Frinksy

Frinksy commented Jul 2, 2021

Copy link
Copy Markdown
Contributor Author

The types are also missing for the m.sticker and m.room.member events.

I've added the missing field for m.room.member, but I think m.sticker has already been dealt with. m.sticker uses ruma_events::room::ImageInfo, which already has a blurhash field.

Comment thread crates/ruma-client-api/src/r0/media/create_content.rs Outdated
Comment thread crates/ruma-client-api/src/r0/profile/get_avatar_url.rs
Comment thread crates/ruma-client-api/src/r0/profile/set_avatar_url.rs Outdated
Comment thread crates/ruma-client-api/src/r0/profile/set_avatar_url.rs Outdated
@jplatte jplatte self-assigned this Jul 2, 2021

@DevinR528 DevinR528 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good to me (as long as the other review is done, which it looks like you got it all)! Good catch with the gated fields that was a tricky one.

Comment thread crates/ruma-client-api/src/r0/profile/get_avatar_url.rs

@iinuwa iinuwa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think m.sticker has already been dealt with. m.sticker uses ruma_events::room::ImageInfo, which already has a blurhash field.

Ah, yes. My bad.

This looks good to me! I haven't looked at the #[cfg] attribute issue in depth, but I assume we'll need to wait for #659 to be merged before merging this one.

@jplatte

jplatte commented Jul 4, 2021

Copy link
Copy Markdown
Member

#659 has been merged and CI adjusted to also check most things without unstable-pre-spec. This just needs a rebase now.

Frinksy added 4 commits July 4, 2021 17:07
Add blurhash to profile and avatar endpoints.
Add `blurhash` fields to `GET /_matrix/federation/v1/query/profile`
and `m.room.member`.
Add `generate_blurhash` field to `PUT /_matrix/media/r0/upload`.
@jplatte
jplatte merged commit 118ea0f into ruma:main Jul 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Update / finish blurhash implementation

4 participants