+
+ /**
+ * Get Raw Url Preview data from the homeserver. There is no cache management for this request
+ * @param url The url to get the preview data from
+ * @param timestamp The optional timestamp
+ */
+ suspend fun getRawPreviewUrl(url: String, timestamp: Long?): JsonDict
+
+ /**
+ * 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
+ * @param cacheStrategy the cache strategy, see the type for more details
+ */
+ suspend fun getPreviewUrl(url: String, timestamp: Long?, cacheStrategy: CacheStrategy): PreviewUrlData
+
+ /**
+ * 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
new file mode 100644
index 0000000000..33fc8b052b
--- /dev/null
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/media/PreviewUrlData.kt
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2020 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.media
+
+/**
+ * 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`:
+ *
+ * {
+ * "matrix:image:size": 112805,
+ * "og:description": "Matrix is an open standard for interoperable, decentralised, real-time communication",
+ * "og:image": "mxc://matrix.org/2020-12-03_uFqjagCCTJbaaJxb",
+ * "og:image:alt": "Matrix is an open standard for interoperable, decentralised, real-time communication",
+ * "og:image:height": 467,
+ * "og:image:type": "image/jpeg",
+ * "og:image:width": 911,
+ * "og:locale": "en_US",
+ * "og:site_name": "Matrix.org",
+ * "og:title": "Matrix.org",
+ * "og:type": "website",
+ * "og:url": "https://matrix.org"
+ * }
+ *
+ */
+data class PreviewUrlData(
+ // Value of field "og:url". If not provided, this is the value passed in parameter
+ val url: String,
+ // Value of field "og:site_name"
+ val siteName: String?,
+ // Value of field "og:title"
+ val title: String?,
+ // Value of field "og:description"
+ val description: String?,
+ // Value of field "og:image"
+ val mxcUrl: String?
+)
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 ac1d726d03..aefc086b43 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
@@ -25,6 +25,7 @@ interface PermalinkService {
companion object {
const val MATRIX_TO_URL_BASE = "https://matrix.to/#/"
+ const val MATRIX_TO_CUSTOM_SCHEME_URL_BASE = "element://"
}
/**
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 837bda031b..cb6690b5c5 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
@@ -18,6 +18,7 @@ package org.matrix.android.sdk.api.session.room
import androidx.lifecycle.LiveData
import org.matrix.android.sdk.api.MatrixCallback
+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.members.MembershipService
@@ -46,6 +47,7 @@ interface Room :
DraftService,
ReadService,
TypingService,
+ AliasService,
TagsService,
MembershipService,
StateService,
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 dc5b3d55f5..61970ce848 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
@@ -17,6 +17,7 @@
package org.matrix.android.sdk.api.session.room
import org.matrix.android.sdk.api.MatrixCallback
+import org.matrix.android.sdk.api.session.room.model.RoomDirectoryVisibility
import org.matrix.android.sdk.api.session.room.model.roomdirectory.PublicRoomsParams
import org.matrix.android.sdk.api.session.room.model.roomdirectory.PublicRoomsResponse
import org.matrix.android.sdk.api.session.room.model.thirdparty.ThirdPartyProtocol
@@ -39,4 +40,14 @@ interface RoomDirectoryService {
* Includes both the available protocols and all fields required for queries against each protocol.
*/
fun getThirdPartyProtocol(callback: MatrixCallback