,
/**
- * The token for the invitation
+ * The token for the invitation.
*/
val token: String
)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/initsync/SyncStatusService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/initsync/SyncStatusService.kt
index 759813939f..7006e11751 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/initsync/SyncStatusService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/initsync/SyncStatusService.kt
@@ -23,7 +23,7 @@ interface SyncStatusService {
sealed class Status {
/**
- * For initial sync
+ * For initial sync.
*/
abstract class InitialSyncStatus : Status()
@@ -34,7 +34,7 @@ interface SyncStatusService {
) : InitialSyncStatus()
/**
- * For incremental sync
+ * For incremental sync.
*/
abstract class IncrementalSyncStatus : Status()
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/integrationmanager/IntegrationManagerConfig.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/integrationmanager/IntegrationManagerConfig.kt
index 069ed7427c..b04b31af3b 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/integrationmanager/IntegrationManagerConfig.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/integrationmanager/IntegrationManagerConfig.kt
@@ -30,17 +30,17 @@ data class IntegrationManagerConfig(
*/
enum class Kind {
/**
- * Defined in UserAccountData
+ * Defined in UserAccountData.
*/
ACCOUNT,
/**
- * Defined in Wellknown
+ * Defined in Wellknown.
*/
HOMESERVER,
/**
- * Fallback value, hardcoded by the SDK
+ * Fallback value, hardcoded by the SDK.
*/
DEFAULT
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/integrationmanager/IntegrationManagerService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/integrationmanager/IntegrationManagerService.kt
index 60af93888e..5b15a0cb13 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/integrationmanager/IntegrationManagerService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/integrationmanager/IntegrationManagerService.kt
@@ -99,6 +99,7 @@ interface IntegrationManagerService {
* Offers to allow or disallow a native widget domain.
* @param widgetType the widget type to check for
* @param domain the domain to check for
+ * @param allowed true or false
*/
suspend fun setNativeWidgetDomainAllowed(widgetType: String, domain: String, allowed: Boolean)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/media/MediaService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/media/MediaService.kt
index 3b3ef57d73..2e53e67b0c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/media/MediaService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/media/MediaService.kt
@@ -36,7 +36,7 @@ interface MediaService {
suspend fun getRawPreviewUrl(url: String, timestamp: Long?): JsonDict
/**
- * Get Url Preview data from the homeserver, or from cache, depending on the cache strategy
+ * Get Url Preview data from the homeserver, or from cache, depending on the cache strategy.
* @param url The url to get the preview data from
* @param timestamp The optional timestamp. Note that this parameter is not taken into account
* if the data is already in cache and the cache strategy allow to use it
@@ -45,7 +45,7 @@ interface MediaService {
suspend fun getPreviewUrl(url: String, timestamp: Long?, cacheStrategy: CacheStrategy): PreviewUrlData
/**
- * Clear the cache of all retrieved UrlPreview data
+ * Clear the cache of all retrieved UrlPreview data.
*/
suspend fun clearCache()
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/media/PreviewUrlData.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/media/PreviewUrlData.kt
index bfba43a82d..b142ad9754 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/media/PreviewUrlData.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/media/PreviewUrlData.kt
@@ -17,7 +17,7 @@
package org.matrix.android.sdk.api.session.media
/**
- * Facility data class to get the common field of a PreviewUrl response form the server
+ * Facility data class to get the common field of a PreviewUrl response form the server.
*
* Example of return data for the url `https://matrix.org`:
*
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixLinkify.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixLinkify.kt
index c5d919407a..c428e40203 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixLinkify.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixLinkify.kt
@@ -29,6 +29,7 @@ object MatrixLinkify {
* Find the matrix spans i.e matrix id , user id ... to display them as URL.
*
* @param spannable the text in which the matrix items has to be clickable.
+ * @param callback listener to be notified when the span is clicked
*/
@Suppress("UNUSED_PARAMETER")
fun addLinks(spannable: Spannable, callback: MatrixPermalinkSpan.Callback?): Boolean {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixPermalinkSpan.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixPermalinkSpan.kt
index 2f8f5f99a5..9c71c081be 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixPermalinkSpan.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixPermalinkSpan.kt
@@ -22,11 +22,13 @@ import org.matrix.android.sdk.api.session.permalinks.MatrixPermalinkSpan.Callbac
/**
* This MatrixPermalinkSpan is a clickable span which use a [Callback] to communicate back.
- * @param url the permalink url tied to the span
- * @param callback the callback to use.
+ * @property url the permalink url tied to the span
+ * @property callback the callback to use.
*/
-class MatrixPermalinkSpan(private val url: String,
- private val callback: Callback? = null) : ClickableSpan() {
+class MatrixPermalinkSpan(
+ private val url: String,
+ private val callback: Callback? = null
+) : ClickableSpan() {
interface Callback {
fun onUrlClicked(url: String)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkData.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkData.kt
index 57aacc98b8..e8d9c89b54 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkData.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkData.kt
@@ -33,10 +33,10 @@ sealed class PermalinkData {
val viaParameters: List
) : PermalinkData()
- /**
+ /*
* &room_name=Team2
- &room_avatar_url=mxc:
- &inviter_name=bob
+ * &room_avatar_url=mxc:
+ * &inviter_name=bob
*/
@Parcelize
data class RoomEmailInviteLink(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkParser.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkParser.kt
index edb748c76e..9d078dc4b2 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkParser.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkParser.kt
@@ -23,7 +23,7 @@ import timber.log.Timber
import java.net.URLDecoder
/**
- * This class turns a uri to a [PermalinkData]
+ * This class turns a uri to a [PermalinkData].
* element-based domains (e.g. https://app.element.io/#/user/@chagai95:matrix.org) permalinks
* or matrix.to permalinks (e.g. https://matrix.to/#/@chagai95:matrix.org)
* or client permalinks (e.g. user/@chagai95:matrix.org)
@@ -31,7 +31,7 @@ import java.net.URLDecoder
object PermalinkParser {
/**
- * Turns a uri string to a [PermalinkData]
+ * Turns a uri string to a [PermalinkData].
*/
fun parse(uriString: String): PermalinkData {
val uri = Uri.parse(uriString)
@@ -39,7 +39,7 @@ object PermalinkParser {
}
/**
- * Turns a uri to a [PermalinkData]
+ * Turns a uri to a [PermalinkData].
* https://github.com/matrix-org/matrix-doc/blob/master/proposals/1704-matrix.to-permalinks.md
*/
fun parse(uri: Uri): PermalinkData {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkService.kt
index c139da813a..1788bf7bd2 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkService.kt
@@ -57,9 +57,10 @@ interface PermalinkService {
fun createPermalink(id: String, forceMatrixTo: Boolean = false): String?
/**
- * Creates a permalink for a roomId, including the via parameters
+ * Creates a permalink for a roomId, including the via parameters.
*
* @param roomId the room id
+ * @param viaServers the via parameter
* @param forceMatrixTo whether we should force using matrix.to base URL
*
* @return the permalink, or null in case of error
@@ -70,7 +71,7 @@ interface PermalinkService {
* Creates a permalink for an event. If you have an event you can use [createPermalink]
* Ex: "https://matrix.to/#/!nbzmcXAqpxBXjAdgoX:matrix.org/$1531497316352799BevdV:matrix.org?via=matrix.org"
*
- * @param roomId the id of the room
+ * @param roomId the id of the room
* @param eventId the id of the event
* @param forceMatrixTo whether we should force using matrix.to base URL
*
@@ -79,7 +80,7 @@ interface PermalinkService {
fun createPermalink(roomId: String, eventId: String, forceMatrixTo: Boolean = false): String
/**
- * Extract the linked id from the universal link
+ * Extract the linked id from the universal link.
*
* @param url the universal link, Ex: "https://matrix.to/#/@benoit:matrix.org"
* @return the id from the url, ex: "@benoit:matrix.org", or null if the url is not a permalink
@@ -90,7 +91,7 @@ interface PermalinkService {
* Creates a HTML or Markdown mention span template. Can be used to replace a mention with a permalink to mentioned user.
* Ex: "%2\$s" or "[%2\$s](https://matrix.to/#/%1\$s)"
*
- * @param type: type of template to create
+ * @param type type of template to create
* @param forceMatrixTo whether we should force using matrix.to base URL
*
* @return the created template
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/presence/PresenceService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/presence/PresenceService.kt
index 82a81f4b64..901e7ec3dd 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/presence/PresenceService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/presence/PresenceService.kt
@@ -25,7 +25,7 @@ import org.matrix.android.sdk.api.session.presence.model.UserPresence
*/
interface PresenceService {
/**
- * Update the presence status for the current user
+ * Update the presence status for the current user.
* @param presence the new presence state
* @param statusMsg the status message to attach to this state
*/
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/presence/model/PresenceEnum.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/presence/model/PresenceEnum.kt
index 6d9994ef1c..c678e2a706 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/presence/model/PresenceEnum.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/presence/model/PresenceEnum.kt
@@ -28,7 +28,10 @@ enum class PresenceEnum(val value: String) {
OFFLINE("offline"),
@Json(name = "unavailable")
- UNAVAILABLE("unavailable");
+ UNAVAILABLE("unavailable"),
+
+ @Json(name = "org.matrix.msc3026.busy")
+ BUSY("busy");
companion object {
fun from(s: String): PresenceEnum? = values().find { it.value == s }
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/profile/ProfileService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/profile/ProfileService.kt
index d2c677bb31..4c00c76459 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/profile/ProfileService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/profile/ProfileService.kt
@@ -36,21 +36,21 @@ interface ProfileService {
}
/**
- * Return the current display name for this user
+ * Return the current display name for this user.
* @param userId the userId param to look for
*
*/
suspend fun getDisplayName(userId: String): Optional
/**
- * Update the display name for this user
+ * Update the display name for this user.
* @param userId the userId to update the display name of
* @param newDisplayName the new display name of the user
*/
suspend fun setDisplayName(userId: String, newDisplayName: String)
/**
- * Update the avatar for this user
+ * Update the avatar for this user.
* @param userId the userId to update the avatar of
* @param newAvatarUri the new avatar uri of the user
* @param fileName the fileName of selected image
@@ -74,12 +74,12 @@ interface ProfileService {
suspend fun getProfile(userId: String): JsonDict
/**
- * Get the current user 3Pids
+ * Get the current user 3Pids.
*/
fun getThreePids(): List
/**
- * Get the current user 3Pids Live
+ * Get the current user 3Pids Live.
* @param refreshData set to true to fetch data from the homeserver
*/
fun getThreePidsLive(refreshData: Boolean): LiveData>
@@ -90,7 +90,7 @@ interface ProfileService {
fun getPendingThreePids(): List
/**
- * Get the pending 3Pids Live
+ * Get the pending 3Pids Live.
*/
fun getPendingThreePidsLive(): LiveData>
@@ -100,18 +100,20 @@ interface ProfileService {
suspend fun addThreePid(threePid: ThreePid)
/**
- * Validate a code received by text message
+ * Validate a code received by text message.
*/
suspend fun submitSmsCode(threePid: ThreePid.Msisdn, code: String)
/**
- * Finalize adding a 3Pids. Call this method once the user has validated that he owns the ThreePid
+ * Finalize adding a 3Pids. Call this method once the user has validated that he owns the ThreePid.
*/
- suspend fun finalizeAddingThreePid(threePid: ThreePid,
- userInteractiveAuthInterceptor: UserInteractiveAuthInterceptor)
+ suspend fun finalizeAddingThreePid(
+ threePid: ThreePid,
+ userInteractiveAuthInterceptor: UserInteractiveAuthInterceptor
+ )
/**
- * Cancel adding a threepid. It will remove locally stored data about this ThreePid
+ * Cancel adding a threepid. It will remove locally stored data about this ThreePid.
*/
suspend fun cancelAddingThreePid(threePid: ThreePid)
@@ -121,7 +123,7 @@ interface ProfileService {
suspend fun deleteThreePid(threePid: ThreePid)
/**
- * Return a User object from a userId
+ * Return a User object from a userId.
*/
suspend fun getProfileAsUser(userId: String): User {
return getProfile(userId).let { dict ->
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/HttpPusher.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/HttpPusher.kt
new file mode 100644
index 0000000000..1ae23e2b70
--- /dev/null
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/HttpPusher.kt
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2022 The Matrix.org Foundation C.I.C.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.matrix.android.sdk.api.session.pushers
+
+data class HttpPusher(
+ /**
+ * This is a unique identifier for this pusher. The value you should use for
+ * this is the routing or destination address information for the notification,
+ * for example, the APNS token for APNS or the Registration ID for GCM. If your
+ * notification client has no such concept, use any unique identifier. Max length, 512 chars.
+ */
+ val pushkey: String,
+
+ /**
+ * The application id
+ * This is a reverse-DNS style identifier for the application. It is recommended
+ * that this end with the platform, such that different platform versions get
+ * different app identifiers. Max length, 64 chars.
+ */
+ val appId: String,
+
+ /**
+ * This string determines which set of device specific rules this pusher executes.
+ */
+ val profileTag: String,
+
+ /**
+ * The preferred language for receiving notifications (e.g. "en" or "en-US").
+ */
+ val lang: String,
+
+ /**
+ * A human readable string that will allow the user to identify what application owns this pusher.
+ */
+ val appDisplayName: String,
+
+ /**
+ * A human readable string that will allow the user to identify what device owns this pusher.
+ */
+ val deviceDisplayName: String,
+
+ /**
+ * The URL to use to send notifications to. MUST be an HTTPS URL with a path of /_matrix/push/v1/notify.
+ */
+ val url: String,
+
+ /**
+ * If true, the homeserver should add another pusher with the given pushkey and App ID in addition
+ * to any others with different user IDs. Otherwise, the homeserver must remove any other pushers
+ * with the same App ID and pushkey for different users.
+ */
+ val append: Boolean,
+
+ /**
+ * true to limit the push content to only id and not message content
+ * Ref: https://matrix.org/docs/spec/push_gateway/r0.1.1#homeserver-behaviour
+ */
+ val withEventIdOnly: Boolean
+)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt
index f884d3e890..d7958ea3cd 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt
@@ -21,7 +21,7 @@ import java.util.UUID
interface PushersService {
/**
- * Refresh pushers from server state
+ * Refresh pushers from server state.
*/
fun refreshPushers()
@@ -47,26 +47,28 @@ interface PushersService {
* Add a new Email pusher.
* Ref: https://matrix.org/docs/spec/client_server/latest#post-matrix-client-r0-pushers-set
*
- * @param email The email address to send notifications to.
- * @param lang The preferred language for receiving notifications (e.g. "en" or "en-US").
- * @param emailBranding The branding placeholder to include in the email communications.
- * @param appDisplayName A human readable string that will allow the user to identify what application owns this pusher.
+ * @param email The email address to send notifications to.
+ * @param lang The preferred language for receiving notifications (e.g. "en" or "en-US").
+ * @param emailBranding The branding placeholder to include in the email communications.
+ * @param appDisplayName A human readable string that will allow the user to identify what application owns this pusher.
* @param deviceDisplayName A human readable string that will allow the user to identify what device owns this pusher.
- * @param append If true, the homeserver should add another pusher with the given pushkey and App ID in addition
+ * @param append If true, the homeserver should add another pusher with the given pushkey and App ID in addition
* to any others with different user IDs. Otherwise, the homeserver must remove any other pushers
* with the same App ID and pushkey for different users. Typically We always want to append for
* email pushers since we don't want to stop other accounts notifying to the same email address.
* @throws [InvalidParameterException] if a parameter is not correct
*/
- suspend fun addEmailPusher(email: String,
- lang: String,
- emailBranding: String,
- appDisplayName: String,
- deviceDisplayName: String,
- append: Boolean = true)
+ suspend fun addEmailPusher(
+ email: String,
+ lang: String,
+ emailBranding: String,
+ appDisplayName: String,
+ deviceDisplayName: String,
+ append: Boolean = true
+ )
/**
- * Directly ask the push gateway to send a push to this device
+ * Directly ask the push gateway to send a push to this device.
* If successful, the push gateway has accepted the request. In this case, the app should receive a Push with the provided eventId.
* In case of error, PusherRejected will be thrown. In this case it means that the pushkey is not valid.
*
@@ -75,93 +77,38 @@ interface PushersService {
* @param pushkey the FCM token
* @param eventId the eventId which will be sent in the Push message. Use a fake eventId.
*/
- suspend fun testPush(url: String,
- appId: String,
- pushkey: String,
- eventId: String)
+ suspend fun testPush(
+ url: String,
+ appId: String,
+ pushkey: String,
+ eventId: String
+ )
/**
- * Remove a registered pusher
+ * Remove a registered pusher.
* @param pusher the pusher to remove, can be http or email
*/
suspend fun removePusher(pusher: Pusher)
/**
- * Remove a Http pusher by its pushkey and appId
+ * Remove a Http pusher by its pushkey and appId.
* @see addHttpPusher
*/
suspend fun removeHttpPusher(pushkey: String, appId: String)
/**
- * Remove an Email pusher
+ * Remove an Email pusher.
* @see addEmailPusher
*/
suspend fun removeEmailPusher(email: String)
/**
- * Get the current pushers, as a LiveData
+ * Get the current pushers, as a LiveData.
*/
fun getPushersLive(): LiveData>
/**
- * Get the current pushers
+ * Get the current pushers.
*/
fun getPushers(): List
-
- data class HttpPusher(
-
- /**
- * This is a unique identifier for this pusher. The value you should use for
- * this is the routing or destination address information for the notification,
- * for example, the APNS token for APNS or the Registration ID for GCM. If your
- * notification client has no such concept, use any unique identifier. Max length, 512 chars.
- */
- val pushkey: String,
-
- /**
- * The application id
- * This is a reverse-DNS style identifier for the application. It is recommended
- * that this end with the platform, such that different platform versions get
- * different app identifiers. Max length, 64 chars.
- */
- val appId: String,
-
- /**
- * This string determines which set of device specific rules this pusher executes.
- */
- val profileTag: String,
-
- /**
- * The preferred language for receiving notifications (e.g. "en" or "en-US").
- */
- val lang: String,
-
- /**
- * A human readable string that will allow the user to identify what application owns this pusher.
- */
- val appDisplayName: String,
-
- /**
- * A human readable string that will allow the user to identify what device owns this pusher.
- */
- val deviceDisplayName: String,
-
- /**
- * The URL to use to send notifications to. MUST be an HTTPS URL with a path of /_matrix/push/v1/notify.
- */
- val url: String,
-
- /**
- * If true, the homeserver should add another pusher with the given pushkey and App ID in addition
- * to any others with different user IDs. Otherwise, the homeserver must remove any other pushers
- * with the same App ID and pushkey for different users.
- */
- val append: Boolean,
-
- /**
- * true to limit the push content to only id and not message content
- * Ref: https://matrix.org/docs/spec/push_gateway/r0.1.1#homeserver-behaviour
- */
- val withEventIdOnly: Boolean
- )
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/Action.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/Action.kt
index 7790942d84..2b2930c1ba 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/Action.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/Action.kt
@@ -42,7 +42,7 @@ sealed class Action {
}
/**
- * Ref: https://matrix.org/docs/spec/client_server/latest#actions
+ * Ref: https://matrix.org/docs/spec/client_server/latest#actions.
*
* Convert
*
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/ConditionResolver.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/ConditionResolver.kt
index f8a930f987..d64ee5f777 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/ConditionResolver.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/ConditionResolver.kt
@@ -22,15 +22,23 @@ import org.matrix.android.sdk.api.session.events.model.Event
* This class as all required context needed to evaluate rules
*/
interface ConditionResolver {
- fun resolveEventMatchCondition(event: Event,
- condition: EventMatchCondition): Boolean
+ fun resolveEventMatchCondition(
+ event: Event,
+ condition: EventMatchCondition
+ ): Boolean
- fun resolveRoomMemberCountCondition(event: Event,
- condition: RoomMemberCountCondition): Boolean
+ fun resolveRoomMemberCountCondition(
+ event: Event,
+ condition: RoomMemberCountCondition
+ ): Boolean
- fun resolveSenderNotificationPermissionCondition(event: Event,
- condition: SenderNotificationPermissionCondition): Boolean
+ fun resolveSenderNotificationPermissionCondition(
+ event: Event,
+ condition: SenderNotificationPermissionCondition
+ ): Boolean
- fun resolveContainsDisplayNameCondition(event: Event,
- condition: ContainsDisplayNameCondition): Boolean
+ fun resolveContainsDisplayNameCondition(
+ event: Event,
+ condition: ContainsDisplayNameCondition
+ ): Boolean
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/PushRuleService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/PushRuleService.kt
index abbdbf8104..8f9c25fd30 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/PushRuleService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/PushRuleService.kt
@@ -22,7 +22,7 @@ import org.matrix.android.sdk.api.session.pushrules.rest.RuleSet
interface PushRuleService {
/**
- * Fetch the push rules from the server
+ * Fetch the push rules from the server.
*/
fun fetchPushRules(scope: String = RuleScope.GLOBAL)
@@ -33,11 +33,12 @@ interface PushRuleService {
suspend fun addPushRule(kind: RuleKind, pushRule: PushRule)
/**
- * Enables/Disables a push rule and updates the actions if necessary
+ * Enables/Disables a push rule and updates the actions if necessary.
+ * @param kind the rule kind
+ * @param ruleId the rule id
* @param enable Enables/Disables the rule
* @param actions Actions to update if not null
*/
-
suspend fun updatePushRuleActions(kind: RuleKind, ruleId: String, enable: Boolean, actions: List?)
suspend fun removePushRule(kind: RuleKind, ruleId: String)
@@ -50,8 +51,10 @@ interface PushRuleService {
// fun fulfilledBingRule(event: Event, rules: List): PushRule?
- fun resolveSenderNotificationPermissionCondition(event: Event,
- condition: SenderNotificationPermissionCondition): Boolean
+ fun resolveSenderNotificationPermissionCondition(
+ event: Event,
+ condition: SenderNotificationPermissionCondition
+ ): Boolean
interface PushRuleListener {
fun onEvents(pushEvents: PushEvents)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/rest/PushRule.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/rest/PushRule.kt
index 270ffb2940..a11ffc0a98 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/rest/PushRule.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/rest/PushRule.kt
@@ -49,7 +49,7 @@ data class PushRule(
@Json(name = "rule_id")
val ruleId: String,
/**
- * The conditions that must hold true for an event in order for a rule to be applied to an event
+ * The conditions that must hold true for an event in order for a rule to be applied to an event.
*/
@Json(name = "conditions")
val conditions: List? = null,
@@ -71,7 +71,7 @@ data class PushRule(
}
/**
- * Set the notification sound
+ * Set the notification sound.
*
* @param sound notification sound
*/
@@ -82,7 +82,7 @@ data class PushRule(
}
/**
- * Remove the notification sound
+ * Remove the notification sound.
*/
fun removeNotificationSound(): PushRule {
return copy(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/rest/RuleSet.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/rest/RuleSet.kt
index 5bf42b8252..9498ed002c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/rest/RuleSet.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/rest/RuleSet.kt
@@ -67,7 +67,7 @@ data class RuleSet(
/**
* Find a rule from its rule Id.
*
- * @param rules the rules list.
+ * @param rules the rules list.
* @param ruleId the rule Id.
* @return the bing rule if it exists, else null.
*/
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/Room.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/Room.kt
index 1f990f4c0a..5d2769ac3c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/Room.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/Room.kt
@@ -22,6 +22,7 @@ import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataServic
import org.matrix.android.sdk.api.session.room.alias.AliasService
import org.matrix.android.sdk.api.session.room.call.RoomCallService
import org.matrix.android.sdk.api.session.room.crypto.RoomCryptoService
+import org.matrix.android.sdk.api.session.room.location.LocationSharingService
import org.matrix.android.sdk.api.session.room.members.MembershipService
import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.room.model.relation.RelationService
@@ -49,18 +50,18 @@ interface Room {
val coroutineDispatchers: MatrixCoroutineDispatchers
/**
- * The roomId of this room
+ * The roomId of this room.
*/
val roomId: String
/**
- * A live [RoomSummary] associated with the room
+ * A live [RoomSummary] associated with the room.
* You can observe this summary to get dynamic data from this room.
*/
fun getRoomSummaryLive(): LiveData>
/**
- * A current snapshot of [RoomSummary] associated with the room
+ * A current snapshot of [RoomSummary] associated with the room.
*/
fun roomSummary(): RoomSummary?
@@ -70,97 +71,102 @@ interface Room {
fun asSpace(): Space?
/**
- * Get the TimelineService associated to this Room
+ * Get the TimelineService associated to this Room.
*/
fun timelineService(): TimelineService
/**
- * Get the ThreadsService associated to this Room
+ * Get the ThreadsService associated to this Room.
*/
fun threadsService(): ThreadsService
/**
- * Get the ThreadsLocalService associated to this Room
+ * Get the ThreadsLocalService associated to this Room.
*/
fun threadsLocalService(): ThreadsLocalService
/**
- * Get the SendService associated to this Room
+ * Get the SendService associated to this Room.
*/
fun sendService(): SendService
/**
- * Get the DraftService associated to this Room
+ * Get the DraftService associated to this Room.
*/
fun draftService(): DraftService
/**
- * Get the ReadService associated to this Room
+ * Get the ReadService associated to this Room.
*/
fun readService(): ReadService
/**
- * Get the TypingService associated to this Room
+ * Get the TypingService associated to this Room.
*/
fun typingService(): TypingService
/**
- * Get the AliasService associated to this Room
+ * Get the AliasService associated to this Room.
*/
fun aliasService(): AliasService
/**
- * Get the TagsService associated to this Room
+ * Get the TagsService associated to this Room.
*/
fun tagsService(): TagsService
/**
- * Get the MembershipService associated to this Room
+ * Get the MembershipService associated to this Room.
*/
fun membershipService(): MembershipService
/**
- * Get the StateService associated to this Room
+ * Get the StateService associated to this Room.
*/
fun stateService(): StateService
/**
- * Get the UploadsService associated to this Room
+ * Get the UploadsService associated to this Room.
*/
fun uploadsService(): UploadsService
/**
- * Get the ReportingService associated to this Room
+ * Get the ReportingService associated to this Room.
*/
fun reportingService(): ReportingService
/**
- * Get the RoomCallService associated to this Room
+ * Get the RoomCallService associated to this Room.
*/
fun roomCallService(): RoomCallService
/**
- * Get the RelationService associated to this Room
+ * Get the RelationService associated to this Room.
*/
fun relationService(): RelationService
/**
- * Get the RoomCryptoService associated to this Room
+ * Get the RoomCryptoService associated to this Room.
*/
fun roomCryptoService(): RoomCryptoService
/**
- * Get the RoomPushRuleService associated to this Room
+ * Get the RoomPushRuleService associated to this Room.
*/
fun roomPushRuleService(): RoomPushRuleService
/**
- * Get the RoomAccountDataService associated to this Room
+ * Get the RoomAccountDataService associated to this Room.
*/
fun roomAccountDataService(): RoomAccountDataService
/**
- * Get the RoomVersionService associated to this Room
+ * Get the RoomVersionService associated to this Room.
*/
fun roomVersionService(): RoomVersionService
+
+ /**
+ * Get the LocationSharingService associated to this Room.
+ */
+ fun locationSharingService(): LocationSharingService
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomDirectoryService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomDirectoryService.kt
index 9446f0fdff..77092c4811 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomDirectoryService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomDirectoryService.kt
@@ -26,18 +26,20 @@ import org.matrix.android.sdk.api.session.room.model.roomdirectory.PublicRoomsRe
interface RoomDirectoryService {
/**
- * Get rooms from directory
+ * Get rooms from directory.
*/
- suspend fun getPublicRooms(server: String?,
- publicRoomsParams: PublicRoomsParams): PublicRoomsResponse
+ suspend fun getPublicRooms(
+ server: String?,
+ publicRoomsParams: PublicRoomsParams
+ ): PublicRoomsResponse
/**
- * Get the visibility of a room in the directory
+ * Get the visibility of a room in the directory.
*/
suspend fun getRoomDirectoryVisibility(roomId: String): RoomDirectoryVisibility
/**
- * Set the visibility of a room in the directory
+ * Set the visibility of a room in the directory.
*/
suspend fun setRoomDirectoryVisibility(roomId: String, roomDirectoryVisibility: RoomDirectoryVisibility)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomExtensions.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomExtensions.kt
index ece9cfbfac..0e631427bd 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomExtensions.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomExtensions.kt
@@ -21,13 +21,13 @@ import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
/**
- * Get a TimelineEvent using the TimelineService of a Room
+ * Get a TimelineEvent using the TimelineService of a Room.
*/
fun Room.getTimelineEvent(eventId: String): TimelineEvent? =
timelineService().getTimelineEvent(eventId)
/**
- * Get a StateEvent using the StateService of a Room
+ * Get a StateEvent using the StateService of a Room.
*/
fun Room.getStateEvent(eventType: String, stateKey: QueryStringValue = QueryStringValue.NoCondition): Event? =
stateService().getStateEvent(eventType, stateKey)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomService.kt
index 700e292b0c..0a495f3552 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomService.kt
@@ -36,12 +36,12 @@ import org.matrix.android.sdk.api.util.Optional
interface RoomService {
/**
- * Create a room asynchronously
+ * Create a room asynchronously.
*/
suspend fun createRoom(createRoomParams: CreateRoomParams): String
/**
- * Create a direct room asynchronously. This is a facility method to create a direct room with the necessary parameters
+ * Create a direct room asynchronously. This is a facility method to create a direct room with the necessary parameters.
*/
suspend fun createDirectRoom(otherUserId: String): String {
return createRoom(
@@ -55,14 +55,16 @@ interface RoomService {
}
/**
- * Join a room by id
+ * Join a room by id.
* @param roomIdOrAlias the roomId or the room alias of the room to join
* @param reason optional reason for joining the room
* @param viaServers the servers to attempt to join the room through. One of the servers must be participating in the room.
*/
- suspend fun joinRoom(roomIdOrAlias: String,
- reason: String? = null,
- viaServers: List = emptyList())
+ suspend fun joinRoom(
+ roomIdOrAlias: String,
+ reason: String? = null,
+ viaServers: List = emptyList()
+ )
/**
* @param roomId the roomId of the room to join
@@ -84,42 +86,52 @@ interface RoomService {
suspend fun leaveRoom(roomId: String, reason: String? = null)
/**
- * Get a room from a roomId
+ * Get a room from a roomId.
* @param roomId the roomId to look for.
* @return a room with roomId or null
*/
fun getRoom(roomId: String): Room?
/**
- * Get a roomSummary from a roomId or a room alias
+ * Get a roomSummary from a roomId or a room alias.
* @param roomIdOrAlias the roomId or the alias of a room to look for.
* @return a matching room summary or null
*/
fun getRoomSummary(roomIdOrAlias: String): RoomSummary?
+ /**
+ * A live [RoomSummary] associated with the room with id [roomId].
+ * You can observe this summary to get dynamic data from this room, even if the room is not joined yet
+ */
+ fun getRoomSummaryLive(roomId: String): LiveData>
+
/**
* Get a snapshot list of room summaries.
* @return the immutable list of [RoomSummary]
*/
- fun getRoomSummaries(queryParams: RoomSummaryQueryParams,
- sortOrder: RoomSortOrder = RoomSortOrder.NONE): List
+ fun getRoomSummaries(
+ queryParams: RoomSummaryQueryParams,
+ sortOrder: RoomSortOrder = RoomSortOrder.NONE
+ ): List
/**
* Get a live list of room summaries. This list is refreshed as soon as the data changes.
* @return the [LiveData] of List[RoomSummary]
*/
- fun getRoomSummariesLive(queryParams: RoomSummaryQueryParams,
- sortOrder: RoomSortOrder = RoomSortOrder.ACTIVITY): LiveData>
+ fun getRoomSummariesLive(
+ queryParams: RoomSummaryQueryParams,
+ sortOrder: RoomSortOrder = RoomSortOrder.ACTIVITY
+ ): LiveData>
/**
- * Get a snapshot list of Breadcrumbs
+ * Get a snapshot list of Breadcrumbs.
* @param queryParams parameters to query the room summaries. It can be use to keep only joined rooms, for instance.
* @return the immutable list of [RoomSummary]
*/
fun getBreadcrumbs(queryParams: RoomSummaryQueryParams): List
/**
- * Get a live list of Breadcrumbs
+ * Get a live list of Breadcrumbs.
* @param queryParams parameters to query the room summaries. It can be use to keep only joined rooms, for instance.
* @return the [LiveData] of [RoomSummary]
*/
@@ -132,18 +144,20 @@ interface RoomService {
suspend fun onRoomDisplayed(roomId: String)
/**
- * Mark all rooms as read
+ * Mark all rooms as read.
*/
suspend fun markAllAsRead(roomIds: List)
/**
* Resolve a room alias to a room ID.
*/
- suspend fun getRoomIdByAlias(roomAlias: String,
- searchOnServer: Boolean): Optional
+ suspend fun getRoomIdByAlias(
+ roomAlias: String,
+ searchOnServer: Boolean
+ ): Optional
/**
- * Delete a room alias
+ * Delete a room alias.
*/
suspend fun deleteRoomAlias(roomAlias: String)
@@ -162,7 +176,7 @@ interface RoomService {
fun getChangeMembershipsLive(): LiveData