Better room preview, use room Summary API if available#3986
Merged
Conversation
bmarty
reviewed
Sep 14, 2021
Member
bmarty
left a comment
There was a problem hiding this comment.
LGTM, just a few minor remarks
|
|
||
| override suspend fun execute(params: GetRoomSummaryTask.Params): RoomStrippedState { | ||
| return executeRequest(globalErrorReceiver) { | ||
| roomAPI.getRoomSummary(params.roomId, params.viaServers) |
Member
There was a problem hiding this comment.
Is there any fallback if this unstable API returns a 404? This can occur a lot.
Member
Author
There was a problem hiding this comment.
It's done in PeekRoom task. It will try first the summary API, then check the public repository, and fallback to raw peek state if no results
| * as well as if the user is already a member of that room. | ||
| * https://github.com/deepbluev7/matrix-doc/blob/room-summaries/proposals/3266-room-summary.md | ||
| */ | ||
| @GET(NetworkConstants.URI_API_PREFIX_PATH_UNSTABLE + "im.nheko.summary/rooms/{roomidOrAlias}/summary") |
Member
There was a problem hiding this comment.
I know it is like that in the MSC, I've made a comment about it, but here, can you write roomIdOrAlias, with a capital I please?
| abstract fun bindSign3pidInvitationTask(task: DefaultSign3pidInvitationTask): Sign3pidInvitationTask | ||
|
|
||
| @Binds | ||
| abstract fun bindSGetRoomSummaryTask(task: DefaultGetRoomSummaryTask): GetRoomSummaryTask |
...k-android/src/main/java/org/matrix/android/sdk/internal/session/room/peeking/PeekRoomTask.kt
Show resolved
Hide resolved
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
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.
Fixes #3946
Implements MSC 3266
Improve Room preview by using the new Room Summary API (stripped state). This allows you to get minimum information on a room (name/topic/avatar/type/member count...) even if you cannot peek state or if it's not in public directory.
Basically if you can join the room you will get a summary.