-
Notifications
You must be signed in to change notification settings - Fork 753
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
Better room preview, use room Summary API if available #3986
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a few minor remarks
|
||
override suspend fun execute(params: GetRoomSummaryTask.Params): RoomStrippedState { | ||
return executeRequest(globalErrorReceiver) { | ||
roomAPI.getRoomSummary(params.roomId, params.viaServers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any fallback if this unstable API returns a 404? This can occur a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
@@ -253,4 +253,7 @@ internal abstract class RoomModule { | |||
|
|||
@Binds | |||
abstract fun bindSign3pidInvitationTask(task: DefaultSign3pidInvitationTask): Sign3pidInvitationTask | |||
|
|||
@Binds | |||
abstract fun bindSGetRoomSummaryTask(task: DefaultGetRoomSummaryTask): GetRoomSummaryTask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the extra "S"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
...k-android/src/main/java/org/matrix/android/sdk/internal/session/room/peeking/PeekRoomTask.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update!
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.