Add some Kdoc

This commit is contained in:
Benoit Marty 2022-05-24 16:03:09 +02:00 committed by Benoit Marty
parent 3442829e11
commit 289f27b738
3 changed files with 45 additions and 2 deletions

View File

@ -16,6 +16,14 @@
package org.matrix.android.sdk.api
/**
* This interface exists to let the implementation provide localized room display name fallback.
* The methods can be called when the room has no name, i.e. its `m.room.name` state event does not exist or
* the name in it is an empty String.
* It allows the SDK to store the room name fallback into the local storage and so let the client do
* queries on the room name.
* *Limitation*: if the locale of the device changes, the methods will not be called again.
*/
interface RoomDisplayNameFallbackProvider {
fun getNameForRoomInvite(): String
fun getNameForEmptyRoom(isDirect: Boolean, leftMemberNames: List<String>): String

View File

@ -16,6 +16,10 @@
package org.matrix.android.sdk.api.query
/**
* Filter to be used to do room queries.
* @see [org.matrix.android.sdk.api.session.room.RoomSummaryQueryParams]
*/
sealed class ActiveSpaceFilter {
object None : ActiveSpaceFilter()
data class ActiveSpace(val currentSpaceId: String?) : ActiveSpaceFilter()

View File

@ -47,18 +47,49 @@ fun spaceSummaryQueryParams(init: (RoomSummaryQueryParams.Builder.() -> Unit) =
}
/**
* This class can be used to filter room summaries to use with:
* [org.matrix.android.sdk.api.session.room.Room] and [org.matrix.android.sdk.api.session.room.RoomService].
* This class can be used to filter room summaries to use with [RoomService].
* It provides a [Builder].
* [roomSummaryQueryParams] and [spaceSummaryQueryParams] can also be used to build an instance of this class.
*/
data class RoomSummaryQueryParams(
/**
* Query for the displayName of the room. The display name can be the value of the state event,
* or a value returned by [org.matrix.android.sdk.api.RoomDisplayNameFallbackProvider].
*/
val displayName: QueryStringValue,
/**
* Query for the canonical alias of the room.
*/
val canonicalAlias: QueryStringValue,
/**
* Used to filter room by membership.
*/
val memberships: List<Membership>,
/**
* Used to filter room by room category.
*/
val roomCategoryFilter: RoomCategoryFilter?,
/**
* Used to filter room by room tag.
*/
val roomTagQueryFilter: RoomTagQueryFilter?,
/**
* Used to filter room by room type.
* @see [includeType]
*/
val excludeType: List<String?>?,
/**
* Used to filter room by room type.
* @see [excludeType]
*/
val includeType: List<String?>?,
/**
* Used to filter room using the current space.
*/
val activeSpaceFilter: ActiveSpaceFilter?,
/**
* Used to filter room using the current group.
*/
val activeGroupId: String? = null
) {