diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 22b3a1727d..9517a4f3a7 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -67,4 +67,4 @@ jobs:
path: |
vector/build/outputs/apk/*/release/*.apk
-# TODO: add exodus checks
+# TODO add exodus checks
diff --git a/.github/workflows/post-pr.yml b/.github/workflows/post-pr.yml
index 54107475c7..9cd33143ad 100644
--- a/.github/workflows/post-pr.yml
+++ b/.github/workflows/post-pr.yml
@@ -325,5 +325,5 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
hookshot_url: ${{ secrets.ELEMENT_ANDROID_HOOKSHOT_URL }}
- text_template: "Post-merge validation of ${{ github.head_ref }} into ${{ github.base_ref }} by ${{ github.event.merged_by }} failed: {{#each job_statuses }}{{#with this }}{{#if completed }} {{name}} {{conclusion}} at {{completed_at}}, {{/if}}{{/with}}{{/each}}"
- html_template: "Post-merge validation of ${{ github.head_ref }} into ${{ github.base_ref }} by ${{ github.event.merged_by }} failed: {{#each job_statuses }}{{#with this }}{{#if completed }} {{icon conclusion}} {{name}} {{conclusion}} at {{completed_at}} [details]{{/if}}{{/with}}{{/each}}"
+ text_template: "Post-merge validation of ${{ github.head_ref }} into ${{ github.base_ref }} by ${{ github.event.pull_request.merged_by }} failed: {{#each job_statuses }}{{#with this }}{{#if completed }} {{name}} {{conclusion}} at {{completed_at}}, {{/if}}{{/with}}{{/each}}"
+ html_template: "Post-merge validation of ${{ github.head_ref }} into ${{ github.base_ref }} by ${{ github.event.pull_request.merged_by }} failed: {{#each job_statuses }}{{#with this }}{{#if completed }} {{icon conclusion}} {{name}} {{conclusion}} at {{completed_at}} [details]{{/if}}{{/with}}{{/each}}"
diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml
index dee596980f..a97d532644 100644
--- a/.github/workflows/quality.yml
+++ b/.github/workflows/quality.yml
@@ -14,6 +14,16 @@ jobs:
- name: Run code quality check suite
run: ./tools/check/check_code_quality.sh
+# Knit for all the modules (https://github.com/Kotlin/kotlinx-knit)
+ knit:
+ name: Knit
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Run knit
+ run: |
+ ./gradlew knit
+
# ktlint for all the modules
ktlint:
name: Kotlin Linter
@@ -147,3 +157,23 @@ jobs:
name: release-lint-report-${{ matrix.target }}
path: |
vector/build/reports/*.*
+
+ detekt:
+ name: Detekt Analysis
+ runs-on: ubuntu-latest
+ # Allow all jobs on main and develop. Just one per PR.
+ concurrency:
+ group: ${{ github.ref == 'refs/heads/main' && format('detekt-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('detekt-develop-{0}', github.sha) || format('detekt-{0}', github.ref) }}
+ cancel-in-progress: true
+ steps:
+ - uses: actions/checkout@v3
+ - name: Run detekt
+ run: |
+ ./gradlew detekt
+ - name: Upload reports
+ if: always()
+ uses: actions/upload-artifact@v3
+ with:
+ name: detekt-report
+ path: |
+ */build/reports/detekt/detekt.html
diff --git a/build.gradle b/build.gradle
index fa26638015..8553428b49 100644
--- a/build.gradle
+++ b/build.gradle
@@ -30,14 +30,17 @@ buildscript {
classpath "com.likethesalad.android:stem-plugin:2.0.0"
classpath 'org.owasp:dependency-check-gradle:7.1.0.1'
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.6.21"
+ classpath "org.jetbrains.kotlinx:kotlinx-knit:0.4.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
-// ktlint Plugin
plugins {
+ // ktlint Plugin
id "org.jlleitschuh.gradle.ktlint" version "10.3.0"
+ // Detekt
+ id "io.gitlab.arturbosch.detekt" version "1.20.0"
}
// https://github.com/jeremylong/DependencyCheck
@@ -52,6 +55,7 @@ dependencyCheck {
allprojects {
apply plugin: "org.jlleitschuh.gradle.ktlint"
+ apply plugin: "io.gitlab.arturbosch.detekt"
repositories {
// Do not use `mavenCentral()`, it prevents Dependabot from working properly
@@ -119,7 +123,7 @@ allprojects {
// display the corresponding rule
verbose = true
disabledRules = [
- // TODO: Re-enable these 4 rules after reformatting project
+ // TODO Re-enable these 4 rules after reformatting project
"indent",
"experimental:argument-list-wrapping",
"max-line-length",
@@ -140,6 +144,15 @@ allprojects {
"experimental:kdoc-wrapping",
]
}
+
+ detekt {
+ // preconfigure defaults
+ buildUponDefaultConfig = true
+ // activate all available (even unstable) rules.
+ allRules = true
+ // point to your custom config defining rules to run, overwriting default behavior
+ config = files("$rootDir/tools/detekt/detekt.yml")
+ }
}
task clean(type: Delete) {
diff --git a/changelog.d/5887.sdk b/changelog.d/5887.sdk
new file mode 100644
index 0000000000..0f128938dd
--- /dev/null
+++ b/changelog.d/5887.sdk
@@ -0,0 +1 @@
+Small change in the Matrix class: deprecated methods have been removed and the constructor is now public. Also the fun `workerFactory()` has been renamed to `getWorkerFactory()`
diff --git a/changelog.d/5906.bugfix b/changelog.d/5906.bugfix
new file mode 100644
index 0000000000..be1379c6e4
--- /dev/null
+++ b/changelog.d/5906.bugfix
@@ -0,0 +1 @@
+Desynchronized 4S | Megolm backup causing Unusable backup
diff --git a/changelog.d/5973.doc b/changelog.d/5973.doc
new file mode 100644
index 0000000000..cd3b31dd21
--- /dev/null
+++ b/changelog.d/5973.doc
@@ -0,0 +1 @@
+Note public_baseurl requirement in integration tests documentation.
diff --git a/changelog.d/6038.misc b/changelog.d/6038.misc
new file mode 100644
index 0000000000..881aae5ca3
--- /dev/null
+++ b/changelog.d/6038.misc
@@ -0,0 +1 @@
+Setup detekt
diff --git a/changelog.d/6047.feature b/changelog.d/6047.feature
new file mode 100644
index 0000000000..59d37e21e9
--- /dev/null
+++ b/changelog.d/6047.feature
@@ -0,0 +1 @@
+Add presence indicator busy and away.
diff --git a/dependencies.gradle b/dependencies.gradle
index 90990810a4..10f9539e5a 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -10,7 +10,7 @@ ext.versions = [
def gradle = "7.2.0"
// Ref: https://kotlinlang.org/releases.html
def kotlin = "1.6.21"
-def kotlinCoroutines = "1.6.0"
+def kotlinCoroutines = "1.6.1"
def dagger = "2.42"
def retrofit = "2.9.0"
def arrow = "0.8.2"
diff --git a/dependencies_groups.gradle b/dependencies_groups.gradle
index 8422e05930..76869fccf1 100644
--- a/dependencies_groups.gradle
+++ b/dependencies_groups.gradle
@@ -123,6 +123,7 @@ ext.groups = [
'io.github.detekt.sarif4k',
'io.github.microutils',
'io.github.reactivecircus.flowbinding',
+ 'io.gitlab.arturbosch.detekt',
'io.grpc',
'io.jsonwebtoken',
'io.kindedj',
@@ -195,6 +196,7 @@ ext.groups = [
'org.testng',
'org.threeten',
'org.webjars',
+ 'org.yaml',
'ru.noties',
'xerces',
'xml-apis',
diff --git a/docs/add_threePids.md b/docs/add_threePids.md
index 89fc92f329..6fb0aff426 100644
--- a/docs/add_threePids.md
+++ b/docs/add_threePids.md
@@ -37,9 +37,9 @@ Wording: "We've sent you an email to verify your address. Please follow the inst
}
```
-## User receive an e-mail
+## User receives an e-mail
-> [homeserver.org] Validate your email
+> `homeserver.org` Validate your email
>
> A request to add an email address to your Matrix account has been received. If this was you, please click the link below to confirm adding this email:
https://homeserver.org/_matrix/client/unstable/add_threepid/email/submit_token?token=WUnEhQAmJrXupdEbXgdWvnVIKaGYZFsU&client_secret=TixzvOnw7nLEUdiQEmkHzkXKrY4HhiGh&sid=bxyDHuJKsdkjMlTJ
diff --git a/docs/integration_tests.md b/docs/integration_tests.md
index 0fa1998499..e79f966d1f 100644
--- a/docs/integration_tests.md
+++ b/docs/integration_tests.md
@@ -43,14 +43,17 @@ virtualenv -p python3 env
source env/bin/activate
pip install -e .
demo/start.sh --no-rate-limit
+
```
-Alternatively, to install the latest Synapse release package (and not a cloned branch) you can run the following instead of `pip install -e .`:
+Alternatively, to install the latest Synapse release package (and not a cloned branch) you can run the following instead of `git clone` and `pip install -e .`:
```bash
pip install matrix-synapse
```
+On your first run, you will want to stop the demo and edit the config to correct the `public_baseurl` to http://10.0.2.2:8080 and restart the server.
+
You should now have 3 running federated Synapse instances 🎉, at http://127.0.0.1:8080/, http://127.0.0.1:8081/ and http://127.0.0.1:8082/, which should display a "It Works! Synapse is running" message.
## Run the test
@@ -87,6 +90,18 @@ You'll need python3 to be able to run synapse
Try on the Emulator browser to open "http://10.0.2.2:8080". You should see the "Synapse is running" message.
+### Tests partially run but some fail with "Unable to contact localhost:8080"
+
+This is because the `public_baseurl` of synapse is not consistent with the endpoint that the tests are connecting to.
+
+Ensure you have the following configuration in `demo/etc/8080.config`.
+
+```
+public_baseurl: http://10.0.2.2:8080/
+```
+
+After changing this you will need to restart synapse using `demo/stop.sh` and `demo/start.sh` to load the new configuration.
+
### virtualenv command fails
You can try using
diff --git a/docs/pull_request.md b/docs/pull_request.md
index 473d5a259b..94f8f3b6d8 100644
--- a/docs/pull_request.md
+++ b/docs/pull_request.md
@@ -116,7 +116,7 @@ Review such PR is the same recipe than for PR from Dependabot
##### Sync analytics plan
This tools imports any update in the analytics plan. See instruction in the PR itself to handle it.
-More info can be found in the file [analytics.md]
+More info can be found in the file [analytics.md](./analytics.md)
## Reviewing PR
@@ -247,4 +247,4 @@ Also "Resolve conversation" should probably be hit by the creator of the convers
PR submitter is responsible of the incoming change. PR reviewers who approved the PR take a part of responsibility on the code which will land to develop, and then be used by our users, and the user of our forks.
-That said, bug may still be merged on `develop`, this is still acceptable of course. In this case, please make sure an issue is created and correctly labelled. Ideally, such issues should be fixed before the next release candidate, i.e. with a higher priority. But as we release the application every 10 working days, it can be hard to fix every bugs. That's why PR should be fully tested and reviewed before being merge and we should never comment code review remark with "will be handled later", or similar comments.
\ No newline at end of file
+That said, bug may still be merged on `develop`, this is still acceptable of course. In this case, please make sure an issue is created and correctly labelled. Ideally, such issues should be fixed before the next release candidate, i.e. with a higher priority. But as we release the application every 10 working days, it can be hard to fix every bugs. That's why PR should be fully tested and reviewed before being merge and we should never comment code review remark with "will be handled later", or similar comments.
diff --git a/library/core-utils/src/main/java/im/vector/lib/core/utils/epoxy/charsequence/EpoxyCharSequence.kt b/library/core-utils/src/main/java/im/vector/lib/core/utils/epoxy/charsequence/EpoxyCharSequence.kt
index 77e2d58001..f0f01bc6ea 100644
--- a/library/core-utils/src/main/java/im/vector/lib/core/utils/epoxy/charsequence/EpoxyCharSequence.kt
+++ b/library/core-utils/src/main/java/im/vector/lib/core/utils/epoxy/charsequence/EpoxyCharSequence.kt
@@ -17,7 +17,7 @@
package im.vector.lib.core.utils.epoxy.charsequence
/**
- * Wrapper for a CharSequence, which support mutation of the CharSequence, which can happen during rendering
+ * Wrapper for a CharSequence, which support mutation of the CharSequence, which can happen during rendering.
*/
class EpoxyCharSequence(val charSequence: CharSequence) {
private val hash = charSequence.toString().hashCode()
diff --git a/library/core-utils/src/main/java/im/vector/lib/core/utils/epoxy/charsequence/Extensions.kt b/library/core-utils/src/main/java/im/vector/lib/core/utils/epoxy/charsequence/Extensions.kt
index ba0f0b9ad6..c52eaedbb7 100644
--- a/library/core-utils/src/main/java/im/vector/lib/core/utils/epoxy/charsequence/Extensions.kt
+++ b/library/core-utils/src/main/java/im/vector/lib/core/utils/epoxy/charsequence/Extensions.kt
@@ -17,6 +17,6 @@
package im.vector.lib.core.utils.epoxy.charsequence
/**
- * Extensions to wrap CharSequence to EpoxyCharSequence
+ * Extensions to wrap CharSequence to EpoxyCharSequence.
*/
fun CharSequence.toEpoxyCharSequence() = EpoxyCharSequence(this)
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/AudioPicker.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/AudioPicker.kt
index 739bda7004..3d6fdb96fc 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/AudioPicker.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/AudioPicker.kt
@@ -22,7 +22,7 @@ import im.vector.lib.multipicker.entity.MultiPickerAudioType
import im.vector.lib.multipicker.utils.toMultiPickerAudioType
/**
- * Audio file picker implementation
+ * Audio file picker implementation.
*/
class AudioPicker : Picker() {
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/CameraPicker.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/CameraPicker.kt
index 785b9fae43..c4a2ebbea9 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/CameraPicker.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/CameraPicker.kt
@@ -28,12 +28,12 @@ import im.vector.lib.multipicker.utils.createTemporaryMediaFile
import im.vector.lib.multipicker.utils.toMultiPickerImageType
/**
- * Implementation of taking a photo with Camera
+ * Implementation of taking a photo with Camera.
*/
class CameraPicker {
/**
- * Start camera by using a ActivityResultLauncher
+ * Start camera by using a ActivityResultLauncher.
* @return Uri of taken photo or null if the operation is cancelled.
*/
fun startWithExpectingFile(context: Context, activityResultLauncher: ActivityResultLauncher): Uri {
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/CameraVideoPicker.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/CameraVideoPicker.kt
index 59601b30d9..e042e2366a 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/CameraVideoPicker.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/CameraVideoPicker.kt
@@ -28,12 +28,12 @@ import im.vector.lib.multipicker.utils.createTemporaryMediaFile
import im.vector.lib.multipicker.utils.toMultiPickerVideoType
/**
- * Implementation of taking a video with Camera
+ * Implementation of taking a video with Camera.
*/
class CameraVideoPicker {
/**
- * Start camera by using a ActivityResultLauncher
+ * Start camera by using a ActivityResultLauncher.
* @return Uri of taken photo or null if the operation is cancelled.
*/
fun startWithExpectingFile(context: Context, activityResultLauncher: ActivityResultLauncher): Uri {
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/ContactPicker.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/ContactPicker.kt
index bb21196858..be83d2ea47 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/ContactPicker.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/ContactPicker.kt
@@ -26,7 +26,7 @@ import im.vector.lib.multipicker.entity.MultiPickerContactType
import im.vector.lib.multipicker.utils.getColumnIndexOrNull
/**
- * Contact Picker implementation
+ * Contact Picker implementation.
*/
class ContactPicker : Picker() {
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/FilePicker.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/FilePicker.kt
index 2e3148c9de..13ef5aa637 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/FilePicker.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/FilePicker.kt
@@ -32,7 +32,7 @@ import im.vector.lib.multipicker.utils.toMultiPickerImageType
import im.vector.lib.multipicker.utils.toMultiPickerVideoType
/**
- * Implementation of selecting any type of files
+ * Implementation of selecting any type of files.
*/
class FilePicker : Picker() {
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/ImagePicker.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/ImagePicker.kt
index 4cc2352109..bc5a13558a 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/ImagePicker.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/ImagePicker.kt
@@ -22,7 +22,7 @@ import im.vector.lib.multipicker.entity.MultiPickerImageType
import im.vector.lib.multipicker.utils.toMultiPickerImageType
/**
- * Image Picker implementation
+ * Image Picker implementation.
*/
class ImagePicker : Picker() {
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/MediaPicker.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/MediaPicker.kt
index c58abde694..db74dbf9ff 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/MediaPicker.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/MediaPicker.kt
@@ -24,7 +24,7 @@ import im.vector.lib.multipicker.utils.toMultiPickerImageType
import im.vector.lib.multipicker.utils.toMultiPickerVideoType
/**
- * Image/Video Picker implementation
+ * Image/Video Picker implementation.
*/
class MediaPicker : Picker() {
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/MultiPicker.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/MultiPicker.kt
index 821c2f0d4c..e7883c9e53 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/MultiPicker.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/MultiPicker.kt
@@ -16,7 +16,7 @@
package im.vector.lib.multipicker
-class MultiPicker {
+class MultiPicker private constructor() {
companion object Type {
val IMAGE by lazy { MultiPicker() }
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/Picker.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/Picker.kt
index ba765a3b1d..8960f3228b 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/Picker.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/Picker.kt
@@ -24,7 +24,7 @@ import android.net.Uri
import androidx.activity.result.ActivityResultLauncher
/**
- * Abstract class to provide all types of Pickers
+ * Abstract class to provide all types of Pickers.
*/
abstract class Picker {
diff --git a/library/multipicker/src/main/java/im/vector/lib/multipicker/VideoPicker.kt b/library/multipicker/src/main/java/im/vector/lib/multipicker/VideoPicker.kt
index 6b6bc52c1b..89bb1af6aa 100644
--- a/library/multipicker/src/main/java/im/vector/lib/multipicker/VideoPicker.kt
+++ b/library/multipicker/src/main/java/im/vector/lib/multipicker/VideoPicker.kt
@@ -22,7 +22,7 @@ import im.vector.lib.multipicker.entity.MultiPickerVideoType
import im.vector.lib.multipicker.utils.toMultiPickerVideoType
/**
- * Video Picker implementation
+ * Video Picker implementation.
*/
class VideoPicker : Picker() {
diff --git a/library/ui-styles/src/main/res/values/colors.xml b/library/ui-styles/src/main/res/values/colors.xml
index d887e7774e..2104b49ab5 100644
--- a/library/ui-styles/src/main/res/values/colors.xml
+++ b/library/ui-styles/src/main/res/values/colors.xml
@@ -126,6 +126,14 @@
@color/palette_element_green@color/palette_element_green
+
+ @color/element_alert_light
+ @color/element_alert_dark
+
+
+ @color/palette_element_orange
+ @color/palette_element_orange
+
@color/palette_prune
diff --git a/library/ui-styles/src/main/res/values/palette.xml b/library/ui-styles/src/main/res/values/palette.xml
index e6cee80b59..73ac768919 100644
--- a/library/ui-styles/src/main/res/values/palette.xml
+++ b/library/ui-styles/src/main/res/values/palette.xml
@@ -17,6 +17,7 @@
#FF812D#0DBD8B
+ #D9B072#FFFFFF#FF5B55
diff --git a/library/ui-styles/src/main/res/values/theme_dark.xml b/library/ui-styles/src/main/res/values/theme_dark.xml
index 7177687fdd..eeff039b71 100644
--- a/library/ui-styles/src/main/res/values/theme_dark.xml
+++ b/library/ui-styles/src/main/res/values/theme_dark.xml
@@ -44,6 +44,8 @@
@color/vctr_presence_indicator_offline_dark@color/vctr_presence_indicator_online_dark
+ @color/vctr_presence_indicator_busy_dark
+ @color/vctr_presence_indicator_away_dark?vctr_system
diff --git a/library/ui-styles/src/main/res/values/theme_light.xml b/library/ui-styles/src/main/res/values/theme_light.xml
index c90c021591..0c363b583d 100644
--- a/library/ui-styles/src/main/res/values/theme_light.xml
+++ b/library/ui-styles/src/main/res/values/theme_light.xml
@@ -44,6 +44,8 @@
@color/vctr_presence_indicator_offline_light@color/vctr_presence_indicator_online_light
+ @color/vctr_presence_indicator_busy_light
+ @color/vctr_presence_indicator_away_light?vctr_system
diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle
index c840b9a6e9..dfa99d0f8a 100644
--- a/matrix-sdk-android/build.gradle
+++ b/matrix-sdk-android/build.gradle
@@ -21,7 +21,7 @@ dokkaHtml {
dokkaSourceSets {
configureEach {
// Emit warnings about not documented members.
- reportUndocumented.set(true)
+ // reportUndocumented.set(true)
// Suppress legacy Riot's packages.
perPackageOption {
matchingRegex.set("org.matrix.android.sdk.internal.legacy.riot")
diff --git a/matrix-sdk-android/docs/modules.md b/matrix-sdk-android/docs/modules.md
index b19bc73534..fb082c1bc2 100644
--- a/matrix-sdk-android/docs/modules.md
+++ b/matrix-sdk-android/docs/modules.md
@@ -11,11 +11,11 @@ This pages list the complete API that this SDK is exposing to a client applicati
A few entry points:
-- **Matrix**: The app will have to create and manage a Matrix object.
-- From this **Matrix** object, you will be able to get various services, including the **AuthenticationService**.
-- With this **AuthenticationService** you will be able to get an existing **Session**, or create one using a **LoginWizard** or a **RegistrationWizard**, which will finally give you a **Session**.
-- From the **Session**, you will be able to retrieve many Services, including the **RoomService**.
-- From the **RoomService**, you will be able to list the rooms, create a **Room**, and get a specific **Room**.
-- And from a **Room**, you will be able to do many things, including get a **Timeline**, send messages, etc.
+- **[Matrix](org.matrix.android.sdk.api.Matrix)**: The app will have to create and manage a **[Matrix](org.matrix.android.sdk.api.Matrix)** object.
+- From this **[Matrix](org.matrix.android.sdk.api.Matrix)** object, you will be able to get various services, including the **[AuthenticationService](org.matrix.android.sdk.api.auth.AuthenticationService)**.
+- With this **[AuthenticationService](org.matrix.android.sdk.api.auth.AuthenticationService)** you will be able to get an existing **[Session](org.matrix.android.sdk.api.session.Session)**, or create one using a **[LoginWizard](org.matrix.android.sdk.api.auth.login.LoginWizard)** or a **[RegistrationWizard](org.matrix.android.sdk.api.auth.registration.RegistrationWizard)**, which will finally give you a **[Session](org.matrix.android.sdk.api.session.Session)**.
+- From the **[Session](org.matrix.android.sdk.api.session.Session)**, you will be able to retrieve many Services, including the **[RoomService](org.matrix.android.sdk.api.session.room.RoomService)**.
+- From the **[RoomService](org.matrix.android.sdk.api.session.room.RoomService)**, you will be able to list the rooms, create a **[Room](org.matrix.android.sdk.api.session.room.Room)**, and get a specific **[Room](org.matrix.android.sdk.api.session.room.Room)**.
+- And from a **[Room](org.matrix.android.sdk.api.session.room.Room)**, you will be able to do many things, including get a **[Timeline](org.matrix.android.sdk.api.session.room.timeline.Timeline)**, send messages, etc.
Please read the whole documentation to learn more!
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CommonTestHelper.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CommonTestHelper.kt
index 4b9e605cd0..e33e4faea2 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CommonTestHelper.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CommonTestHelper.kt
@@ -63,8 +63,9 @@ class CommonTestHelper(context: Context) {
fun getTestInterceptor(session: Session): MockOkHttpInterceptor? = TestModule.interceptorForSession(session.sessionId) as? MockOkHttpInterceptor
init {
+ var _matrix: TestMatrix? = null
UiThreadStatement.runOnUiThread {
- TestMatrix.initialize(
+ _matrix = TestMatrix(
context,
MatrixConfiguration(
applicationFlavor = "TestFlavor",
@@ -72,7 +73,7 @@ class CommonTestHelper(context: Context) {
)
)
}
- matrix = TestMatrix.getInstance()
+ matrix = _matrix!!
}
fun createAccount(userNamePrefix: String, testParams: SessionTestParams): Session {
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CryptoTestHelper.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CryptoTestHelper.kt
index dfb4863d5b..348841313b 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CryptoTestHelper.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/CryptoTestHelper.kt
@@ -203,17 +203,49 @@ class CryptoTestHelper(private val testHelper: CommonTestHelper) {
val roomFromAlicePOV = aliceSession.getRoom(aliceRoomId)!!
// Alice sends a message
- testHelper.sendTextMessage(roomFromAlicePOV, messagesFromAlice[0], 1)
+ testHelper.sendTextMessage(roomFromAlicePOV, messagesFromAlice[0], 1).first().eventId.let { sentEventId ->
+ // ensure bob got it
+ ensureEventReceived(aliceRoomId, sentEventId, bobSession, true)
+ }
// Bob send 3 messages
- testHelper.sendTextMessage(roomFromBobPOV, messagesFromBob[0], 1)
- testHelper.sendTextMessage(roomFromBobPOV, messagesFromBob[1], 1)
- testHelper.sendTextMessage(roomFromBobPOV, messagesFromBob[2], 1)
+ testHelper.sendTextMessage(roomFromBobPOV, messagesFromBob[0], 1).first().eventId.let { sentEventId ->
+ // ensure alice got it
+ ensureEventReceived(aliceRoomId, sentEventId, aliceSession, true)
+ }
+
+ testHelper.sendTextMessage(roomFromBobPOV, messagesFromBob[1], 1).first().eventId.let { sentEventId ->
+ // ensure alice got it
+ ensureEventReceived(aliceRoomId, sentEventId, aliceSession, true)
+ }
+ testHelper.sendTextMessage(roomFromBobPOV, messagesFromBob[2], 1).first().eventId.let { sentEventId ->
+ // ensure alice got it
+ ensureEventReceived(aliceRoomId, sentEventId, aliceSession, true)
+ }
+
// Alice sends a message
- testHelper.sendTextMessage(roomFromAlicePOV, messagesFromAlice[1], 1)
+ testHelper.sendTextMessage(roomFromAlicePOV, messagesFromAlice[1], 1).first().eventId.let { sentEventId ->
+ // ensure bob got it
+ ensureEventReceived(aliceRoomId, sentEventId, bobSession, true)
+ }
return cryptoTestData
}
+ private fun ensureEventReceived(roomId: String, eventId: String, session: Session, andCanDecrypt: Boolean) {
+ testHelper.waitWithLatch { latch ->
+ testHelper.retryPeriodicallyWithLatch(latch) {
+ val timeLineEvent = session.getRoom(roomId)?.timelineService()?.getTimelineEvent(eventId)
+ if (andCanDecrypt) {
+ timeLineEvent != null &&
+ timeLineEvent.isEncrypted() &&
+ timeLineEvent.root.getClearType() == EventType.MESSAGE
+ } else {
+ timeLineEvent != null
+ }
+ }
+ }
+ }
+
fun checkEncryptedEvent(event: Event, roomId: String, clearMessage: String, senderSession: Session) {
assertEquals(EventType.ENCRYPTED, event.type)
assertNotNull(event.content)
@@ -381,9 +413,9 @@ class CryptoTestHelper(private val testHelper: CommonTestHelper) {
testHelper.waitWithLatch {
testHelper.retryPeriodicallyWithLatch(it) {
- bobVerificationService.getExistingVerificationRequests(alice.myUserId).firstOrNull {
- it.requestInfo?.fromDevice == alice.sessionParams.deviceId
- } != null
+ bobVerificationService.getExistingVerificationRequests(alice.myUserId).firstOrNull {
+ it.requestInfo?.fromDevice == alice.sessionParams.deviceId
+ } != null
}
}
val incomingRequest = bobVerificationService.getExistingVerificationRequests(alice.myUserId).first {
@@ -411,7 +443,8 @@ class CryptoTestHelper(private val testHelper: CommonTestHelper) {
requestID!!,
roomId,
bob.myUserId,
- bob.sessionParams.credentials.deviceId!!)
+ bob.sessionParams.credentials.deviceId!!
+ )
// we should reach SHOW SAS on both
var alicePovTx: OutgoingSasVerificationTransaction? = null
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/TestMatrix.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/TestMatrix.kt
index fa44167a8f..e663cc1865 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/TestMatrix.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/common/TestMatrix.kt
@@ -38,13 +38,12 @@ import org.matrix.android.sdk.internal.util.BackgroundDetectionObserver
import org.matrix.android.sdk.internal.worker.MatrixWorkerFactory
import org.matrix.olm.OlmManager
import java.util.concurrent.Executors
-import java.util.concurrent.atomic.AtomicBoolean
import javax.inject.Inject
/**
* This mimics the Matrix class but using TestMatrixComponent internally instead of regular MatrixComponent.
*/
-internal class TestMatrix constructor(context: Context, matrixConfiguration: MatrixConfiguration) {
+internal class TestMatrix(context: Context, matrixConfiguration: MatrixConfiguration) {
@Inject internal lateinit var legacySessionImporter: LegacySessionImporter
@Inject internal lateinit var authenticationService: AuthenticationService
@@ -60,13 +59,14 @@ internal class TestMatrix constructor(context: Context, matrixConfiguration: Mat
private val uiHandler = Handler(Looper.getMainLooper())
init {
- Monarchy.init(context)
- DaggerTestMatrixComponent.factory().create(context, matrixConfiguration).inject(this)
+ val appContext = context.applicationContext
+ Monarchy.init(appContext)
+ DaggerTestMatrixComponent.factory().create(appContext, matrixConfiguration).inject(this)
val configuration = Configuration.Builder()
.setExecutor(Executors.newCachedThreadPool())
.setWorkerFactory(matrixWorkerFactory)
.build()
- WorkManager.initialize(context, configuration)
+ WorkManager.initialize(appContext, configuration)
uiHandler.post {
ProcessLifecycleOwner.get().lifecycle.addObserver(backgroundDetectionObserver)
}
@@ -95,23 +95,6 @@ internal class TestMatrix constructor(context: Context, matrixConfiguration: Mat
}
companion object {
-
- private lateinit var instance: TestMatrix
- private val isInit = AtomicBoolean(false)
-
- fun initialize(context: Context, matrixConfiguration: MatrixConfiguration) {
- if (isInit.compareAndSet(false, true)) {
- instance = TestMatrix(context.applicationContext, matrixConfiguration)
- }
- }
-
- fun getInstance(): TestMatrix {
- if (isInit.compareAndSet(false, false)) {
- throw IllegalStateException("Matrix is not initialized properly. You should call TestMatrix.initialize first")
- }
- return instance
- }
-
fun getSdkVersion(): String {
return BuildConfig.SDK_VERSION + " (" + BuildConfig.GIT_SDK_REVISION + ")"
}
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTest.kt
index a7ddb6c553..9136272b1e 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTest.kt
@@ -24,7 +24,6 @@ import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue
import org.junit.FixMethodOrder
-import org.junit.Ignore
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
@@ -37,7 +36,9 @@ import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupLastVersio
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupState
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupStateListener
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupVersionTrust
+import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysBackupVersionTrustSignature
import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysVersion
+import org.matrix.android.sdk.api.session.crypto.keysbackup.KeysVersionResult
import org.matrix.android.sdk.api.session.crypto.keysbackup.MegolmBackupCreationInfo
import org.matrix.android.sdk.api.session.crypto.keysbackup.toKeysVersionResult
import org.matrix.android.sdk.api.session.crypto.model.ImportRoomKeysResult
@@ -54,18 +55,16 @@ import java.util.concurrent.CountDownLatch
@LargeTest
class KeysBackupTest : InstrumentedTest {
- private val testHelper = CommonTestHelper(context())
- private val cryptoTestHelper = CryptoTestHelper(testHelper)
- private val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
-
/**
* - From doE2ETestWithAliceAndBobInARoomWithEncryptedMessages, we should have no backed up keys
* - Check backup keys after having marked one as backed up
* - Reset keys backup markers
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun roomKeysTest_testBackupStore_ok() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
// From doE2ETestWithAliceAndBobInARoomWithEncryptedMessages, we should have no backed up keys
@@ -104,6 +103,8 @@ class KeysBackupTest : InstrumentedTest {
*/
@Test
fun prepareKeysBackupVersionTest() {
+ val testHelper = CommonTestHelper(context())
+
val bobSession = testHelper.createAccount(TestConstants.USER_BOB, KeysBackupTestConstants.defaultSessionParams)
assertNotNull(bobSession.cryptoService().keysBackupService())
@@ -132,7 +133,11 @@ class KeysBackupTest : InstrumentedTest {
*/
@Test
fun createKeysBackupVersionTest() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+
val bobSession = testHelper.createAccount(TestConstants.USER_BOB, KeysBackupTestConstants.defaultSessionParams)
+ cryptoTestHelper.initializeCrossSigning(bobSession)
val keysBackup = bobSession.cryptoService().keysBackupService()
@@ -147,13 +152,46 @@ class KeysBackupTest : InstrumentedTest {
assertFalse(keysBackup.isEnabled)
// Create the version
- testHelper.doSync {
+ val version = testHelper.doSync {
keysBackup.createKeysBackupVersion(megolmBackupCreationInfo, it)
}
// Backup must be enable now
assertTrue(keysBackup.isEnabled)
+ // Check that it's signed with MSK
+ val versionResult = testHelper.doSync {
+ keysBackup.getVersion(version.version, it)
+ }
+ val trust = testHelper.doSync {
+ keysBackup.getKeysBackupTrust(versionResult!!, it)
+ }
+
+ assertEquals("Should have 2 signatures", 2, trust.signatures.size)
+
+ trust.signatures
+ .firstOrNull { it is KeysBackupVersionTrustSignature.DeviceSignature }
+ .let {
+ assertNotNull("Should be signed by a device", it)
+ it as KeysBackupVersionTrustSignature.DeviceSignature
+ }.let {
+ assertEquals("Should be signed by current device", bobSession.sessionParams.deviceId, it.deviceId)
+ assertTrue("Signature should be valid", it.valid)
+ }
+
+ trust.signatures
+ .firstOrNull { it is KeysBackupVersionTrustSignature.UserSignature }
+ .let {
+ assertNotNull("Should be signed by a user", it)
+ it as KeysBackupVersionTrustSignature.UserSignature
+ }.let {
+ val msk = bobSession.cryptoService().crossSigningService()
+ .getMyCrossSigningKeys()?.masterKey()?.unpaddedBase64PublicKey
+ assertEquals("Should be signed by my msk 1", msk, it.keyId)
+ assertEquals("Should be signed by my msk 2", msk, it.cryptoCrossSigningKey?.unpaddedBase64PublicKey)
+ assertTrue("Signature should be valid", it.valid)
+ }
+
stateObserver.stopAndCheckStates(null)
testHelper.signOutAndClose(bobSession)
}
@@ -163,8 +201,11 @@ class KeysBackupTest : InstrumentedTest {
* - Check the backup completes
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun backupAfterCreateKeysBackupVersionTest() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
keysBackupTestHelper.waitForKeybackUpBatching()
@@ -204,8 +245,11 @@ class KeysBackupTest : InstrumentedTest {
* Check that backupAllGroupSessions() returns valid data
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun backupAllGroupSessionsTest() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
val keysBackup = cryptoTestData.firstSession.cryptoService().keysBackupService()
@@ -249,8 +293,11 @@ class KeysBackupTest : InstrumentedTest {
* - Compare the decrypted megolm key with the original one
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun testEncryptAndDecryptKeysBackupData() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
val keysBackup = cryptoTestData.firstSession.cryptoService().keysBackupService() as DefaultKeysBackupService
@@ -293,8 +340,11 @@ class KeysBackupTest : InstrumentedTest {
* - Restore must be successful
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun restoreKeysBackupTest() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(null)
// - Restore the e2e backup from the homeserver
@@ -378,8 +428,11 @@ class KeysBackupTest : InstrumentedTest {
* - It must be trusted and must have with 2 signatures now
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun trustKeyBackupVersionTest() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
// - Do an e2e backup to the homeserver with a recovery key
// - And log Alice on a new device
val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(null)
@@ -438,8 +491,11 @@ class KeysBackupTest : InstrumentedTest {
* - It must be trusted and must have with 2 signatures now
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun trustKeyBackupVersionWithRecoveryKeyTest() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
// - Do an e2e backup to the homeserver with a recovery key
// - And log Alice on a new device
val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(null)
@@ -496,8 +552,11 @@ class KeysBackupTest : InstrumentedTest {
* - The backup must still be untrusted and disabled
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun trustKeyBackupVersionWithWrongRecoveryKeyTest() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
// - Do an e2e backup to the homeserver with a recovery key
// - And log Alice on a new device
val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(null)
@@ -538,8 +597,11 @@ class KeysBackupTest : InstrumentedTest {
* - It must be trusted and must have with 2 signatures now
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun trustKeyBackupVersionWithPasswordTest() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
val password = "Password"
// - Do an e2e backup to the homeserver with a password
@@ -598,8 +660,11 @@ class KeysBackupTest : InstrumentedTest {
* - The backup must still be untrusted and disabled
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun trustKeyBackupVersionWithWrongPasswordTest() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
val password = "Password"
val badPassword = "Bad Password"
@@ -639,8 +704,11 @@ class KeysBackupTest : InstrumentedTest {
* - It must fail
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun restoreKeysBackupWithAWrongRecoveryKeyTest() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(null)
// - Try to restore the e2e backup with a wrong recovery key
@@ -673,8 +741,11 @@ class KeysBackupTest : InstrumentedTest {
* - Restore must be successful
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun testBackupWithPassword() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
val password = "password"
val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(password)
@@ -730,8 +801,11 @@ class KeysBackupTest : InstrumentedTest {
* - It must fail
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun restoreKeysBackupWithAWrongPasswordTest() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
val password = "password"
val wrongPassword = "passw0rd"
@@ -767,8 +841,11 @@ class KeysBackupTest : InstrumentedTest {
* - Restore must be successful
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun testUseRecoveryKeyToRestoreAPasswordBasedKeysBackup() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
val password = "password"
val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(password)
@@ -797,8 +874,11 @@ class KeysBackupTest : InstrumentedTest {
* - It must fail
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun testUsePasswordToRestoreARecoveryKeyBasedKeysBackup() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
val testData = keysBackupTestHelper.createKeysBackupScenarioWithPassword(null)
// - Try to restore the e2e backup with a password
@@ -829,8 +909,11 @@ class KeysBackupTest : InstrumentedTest {
* - Check the returned KeysVersionResult is trusted
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun testIsKeysBackupTrusted() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
// - Create a backup version
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
@@ -855,7 +938,7 @@ class KeysBackupTest : InstrumentedTest {
assertTrue(keysBackupVersionTrust.usable)
assertEquals(1, keysBackupVersionTrust.signatures.size)
- val signature = keysBackupVersionTrust.signatures[0]
+ val signature = keysBackupVersionTrust.signatures[0] as KeysBackupVersionTrustSignature.DeviceSignature
assertTrue(signature.valid)
assertNotNull(signature.device)
assertEquals(cryptoTestData.firstSession.cryptoService().getMyDevice().deviceId, signature.deviceId)
@@ -865,66 +948,6 @@ class KeysBackupTest : InstrumentedTest {
cryptoTestData.cleanUp(testHelper)
}
- /**
- * Check backup starts automatically if there is an existing and compatible backup
- * version on the homeserver.
- * - Create a backup version
- * - Restart alice session
- * -> The new alice session must back up to the same version
- */
- @Test
- @Ignore("This test will be ignored until it is fixed")
- fun testCheckAndStartKeysBackupWhenRestartingAMatrixSession() {
- // - Create a backup version
- val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
-
- val keysBackup = cryptoTestData.firstSession.cryptoService().keysBackupService()
-
- val stateObserver = StateObserver(keysBackup)
-
- assertFalse(keysBackup.isEnabled)
-
- val keyBackupCreationInfo = keysBackupTestHelper.prepareAndCreateKeysBackupData(keysBackup)
-
- assertTrue(keysBackup.isEnabled)
-
- // - Restart alice session
- // - Log Alice on a new device
- val aliceSession2 = testHelper.logIntoAccount(cryptoTestData.firstSession.myUserId, KeysBackupTestConstants.defaultSessionParamsWithInitialSync)
-
- cryptoTestData.cleanUp(testHelper)
-
- val keysBackup2 = aliceSession2.cryptoService().keysBackupService()
-
- val stateObserver2 = StateObserver(keysBackup2)
-
- // -> The new alice session must back up to the same version
- val latch = CountDownLatch(1)
- var count = 0
- keysBackup2.addListener(object : KeysBackupStateListener {
- override fun onStateChange(newState: KeysBackupState) {
- // Check the backup completes
- if (newState == KeysBackupState.ReadyToBackUp) {
- count++
-
- if (count == 2) {
- // Remove itself from the list of listeners
- keysBackup2.removeListener(this)
-
- latch.countDown()
- }
- }
- }
- })
- testHelper.await(latch)
-
- assertEquals(keyBackupCreationInfo.version, keysBackup2.currentBackupVersion)
-
- stateObserver.stopAndCheckStates(null)
- stateObserver2.stopAndCheckStates(null)
- testHelper.signOutAndClose(aliceSession2)
- }
-
/**
* Check WrongBackUpVersion state
*
@@ -935,6 +958,10 @@ class KeysBackupTest : InstrumentedTest {
*/
@Test
fun testBackupWhenAnotherBackupWasCreated() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
// - Create a backup version
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
@@ -1005,8 +1032,11 @@ class KeysBackupTest : InstrumentedTest {
* -> It must success
*/
@Test
- @Ignore("This test will be ignored until it is fixed")
fun testBackupAfterVerifyingADevice() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
// - Create a backup version
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
@@ -1039,6 +1069,8 @@ class KeysBackupTest : InstrumentedTest {
// - Try to backup all in aliceSession2, it must fail
val keysBackup2 = aliceSession2.cryptoService().keysBackupService()
+ assertFalse("Backup should not be enabled", keysBackup2.isEnabled)
+
val stateObserver2 = StateObserver(keysBackup2)
var isSuccessful = false
@@ -1056,8 +1088,8 @@ class KeysBackupTest : InstrumentedTest {
assertFalse(isSuccessful)
// Backup state must be NotTrusted
- assertEquals(KeysBackupState.NotTrusted, keysBackup2.state)
- assertFalse(keysBackup2.isEnabled)
+ assertEquals("Backup state must be NotTrusted", KeysBackupState.NotTrusted, keysBackup2.state)
+ assertFalse("Backup should not be enabled", keysBackup2.isEnabled)
// - Validate the old device from the new one
aliceSession2.cryptoService().setDeviceVerification(
@@ -1103,6 +1135,10 @@ class KeysBackupTest : InstrumentedTest {
*/
@Test
fun deleteKeysBackupTest() {
+ val testHelper = CommonTestHelper(context())
+ val cryptoTestHelper = CryptoTestHelper(testHelper)
+ val keysBackupTestHelper = KeysBackupTestHelper(testHelper, cryptoTestHelper)
+
// - Create a backup version
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceAndBobInARoomWithEncryptedMessages()
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTestHelper.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTestHelper.kt
index 90e7fc1e45..2220536e28 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTestHelper.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/keysbackup/KeysBackupTestHelper.kt
@@ -106,14 +106,14 @@ internal class KeysBackupTestHelper(
Assert.assertNotNull(megolmBackupCreationInfo)
- Assert.assertFalse(keysBackup.isEnabled)
+ Assert.assertFalse("Key backup should not be enabled before creation", keysBackup.isEnabled)
// Create the version
val keysVersion = testHelper.doSync {
keysBackup.createKeysBackupVersion(megolmBackupCreationInfo, it)
}
- Assert.assertNotNull(keysVersion.version)
+ Assert.assertNotNull("Key backup version should not be null", keysVersion.version)
// Backup must be enable now
Assert.assertTrue(keysBackup.isEnabled)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/Matrix.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/Matrix.kt
index e7d1e64a2b..979201706b 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/Matrix.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/Matrix.kt
@@ -38,15 +38,18 @@ import org.matrix.android.sdk.internal.util.BackgroundDetectionObserver
import org.matrix.android.sdk.internal.worker.MatrixWorkerFactory
import org.matrix.olm.OlmManager
import java.util.concurrent.Executors
-import java.util.concurrent.atomic.AtomicBoolean
import javax.inject.Inject
/**
* This is the main entry point to the matrix sdk.
*
- * See [Companion.createInstance] to create an instance. The app should create and manage the instance itself.
+ *
+ * The constructor creates a new instance of Matrix, it's recommended to manage this instance as a singleton.
+ *
+ * @param context the application context
+ * @param matrixConfiguration global configuration that will be used for every [org.matrix.android.sdk.api.session.Session]
*/
-class Matrix private constructor(context: Context, matrixConfiguration: MatrixConfiguration) {
+class Matrix(context: Context, matrixConfiguration: MatrixConfiguration) {
@Inject internal lateinit var legacySessionImporter: LegacySessionImporter
@Inject internal lateinit var authenticationService: AuthenticationService
@@ -61,89 +64,72 @@ class Matrix private constructor(context: Context, matrixConfiguration: MatrixCo
@Inject internal lateinit var lightweightSettingsStorage: LightweightSettingsStorage
init {
- Monarchy.init(context)
- DaggerMatrixComponent.factory().create(context, matrixConfiguration).inject(this)
- if (context.applicationContext !is Configuration.Provider) {
+ val appContext = context.applicationContext
+ Monarchy.init(appContext)
+ DaggerMatrixComponent.factory().create(appContext, matrixConfiguration).inject(this)
+ if (appContext !is Configuration.Provider) {
val configuration = Configuration.Builder()
.setExecutor(Executors.newCachedThreadPool())
.setWorkerFactory(matrixWorkerFactory)
.build()
- WorkManager.initialize(context, configuration)
+ WorkManager.initialize(appContext, configuration)
}
ProcessLifecycleOwner.get().lifecycle.addObserver(backgroundDetectionObserver)
}
+ /**
+ * Return the User Agent used for any request that the SDK is making to the homeserver.
+ * There is no way to change the user agent at the moment.
+ */
fun getUserAgent() = userAgentHolder.userAgent
+ /**
+ * Return the AuthenticationService.
+ */
fun authenticationService() = authenticationService
+ /**
+ * Return the RawService.
+ */
fun rawService() = rawService
+ /**
+ * Return the LightweightSettingsStorage.
+ */
fun lightweightSettingsStorage() = lightweightSettingsStorage
+ /**
+ * Return the HomeServerHistoryService.
+ */
fun homeServerHistoryService() = homeServerHistoryService
+ /**
+ * Return the legacy session importer, useful if you want to migrate an app, which was using the legacy Matrix Android Sdk.
+ */
fun legacySessionImporter() = legacySessionImporter
- fun workerFactory(): WorkerFactory = matrixWorkerFactory
+ /**
+ * Get the worker factory. The returned value has to be provided to `WorkConfiguration.Builder()`.
+ */
+ fun getWorkerFactory(): WorkerFactory = matrixWorkerFactory
+ /**
+ * Register an API interceptor, to be able to be notified when the specified API got a response.
+ */
fun registerApiInterceptorListener(path: ApiPath, listener: ApiInterceptorListener) {
apiInterceptor.addListener(path, listener)
}
+ /**
+ * Un-register an API interceptor.
+ */
fun unregisterApiInterceptorListener(path: ApiPath, listener: ApiInterceptorListener) {
apiInterceptor.removeListener(path, listener)
}
companion object {
-
- private lateinit var instance: Matrix
- private val isInit = AtomicBoolean(false)
-
/**
- * Creates a new instance of Matrix, it's recommended to manage this instance as a singleton.
- * To make use of the built in singleton use Matrix.initialize() and/or Matrix.getInstance(context) instead
- **/
- fun createInstance(context: Context, matrixConfiguration: MatrixConfiguration): Matrix {
- return Matrix(context.applicationContext, matrixConfiguration)
- }
-
- /**
- * Initializes a singleton instance of Matrix for the given MatrixConfiguration
- * This instance will be returned by Matrix.getInstance(context)
- */
- @Deprecated("Use Matrix.createInstance and manage the instance manually")
- fun initialize(context: Context, matrixConfiguration: MatrixConfiguration) {
- if (isInit.compareAndSet(false, true)) {
- instance = Matrix(context.applicationContext, matrixConfiguration)
- }
- }
-
- /**
- * Either provides an already initialized singleton Matrix instance or queries the application context for a MatrixConfiguration.Provider
- * to lazily create and store the instance.
- */
- @Suppress("deprecation") // suppressing warning as this method is unused but is still provided for SDK clients
- @Deprecated("Use Matrix.createInstance and manage the instance manually")
- fun getInstance(context: Context): Matrix {
- if (isInit.compareAndSet(false, true)) {
- val appContext = context.applicationContext
- if (appContext is MatrixConfiguration.Provider) {
- val matrixConfiguration = (appContext as MatrixConfiguration.Provider).providesMatrixConfiguration()
- instance = Matrix(appContext, matrixConfiguration)
- } else {
- throw IllegalStateException(
- "Matrix is not initialized properly." +
- " If you want to manage your own Matrix instance use Matrix.createInstance" +
- " otherwise you should call Matrix.initialize or let your application implement MatrixConfiguration.Provider."
- )
- }
- }
- return instance
- }
-
- /**
- * @return a String with details about the Matrix SDK version
+ * @return a String with details about the Matrix SDK version.
*/
fun getSdkVersion(): String {
return BuildConfig.SDK_VERSION + " (" + BuildConfig.GIT_SDK_REVISION + ")"
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixCallback.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixCallback.kt
index 166ba8eab9..7cd450b5ad 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixCallback.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixCallback.kt
@@ -23,7 +23,7 @@ package org.matrix.android.sdk.api
interface MatrixCallback {
/**
- * On success method, default to no-op
+ * On success method, default to no-op.
* @param data the data successfully returned from the async function
*/
fun onSuccess(data: T) {
@@ -31,7 +31,7 @@ interface MatrixCallback {
}
/**
- * On failure method, default to no-op
+ * On failure method, default to no-op.
* @param failure the failure data returned from the async function
*/
fun onFailure(failure: Throwable) {
@@ -40,6 +40,6 @@ interface MatrixCallback {
}
/**
- * Basic no op implementation
+ * Basic no op implementation.
*/
class NoOpMatrixCallback : MatrixCallback
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixConfiguration.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixConfiguration.kt
index f8472319fd..21106fba6c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixConfiguration.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixConfiguration.kt
@@ -46,7 +46,7 @@ data class MatrixConfiguration(
*/
val proxy: Proxy? = null,
/**
- * TLS versions and cipher suites limitation for unauthenticated requests
+ * TLS versions and cipher suites limitation for unauthenticated requests.
*/
val connectionSpec: ConnectionSpec = ConnectionSpec.RESTRICTED_TLS,
/**
@@ -62,16 +62,7 @@ data class MatrixConfiguration(
*/
val roomDisplayNameFallbackProvider: RoomDisplayNameFallbackProvider,
/**
- * Thread messages default enable/disabled value
+ * Thread messages default enable/disabled value.
*/
val threadMessagesEnabledDefault: Boolean = false,
-) {
-
- /**
- * Can be implemented by your Application class.
- */
- @Deprecated("Use Matrix.createInstance and manage the instance manually instead of Matrix.getInstance")
- interface Provider {
- fun providesMatrixConfiguration(): MatrixConfiguration
- }
-}
+)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixConstants.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixConstants.kt
index 49520f3678..33a820ddde 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixConstants.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixConstants.kt
@@ -17,7 +17,7 @@
package org.matrix.android.sdk.api
/**
- * This object define some global constants regarding the Matrix specification
+ * This object define some global constants regarding the Matrix specification.
*/
object MatrixConstants {
/**
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixPatterns.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixPatterns.kt
index 2a26b612fb..867e066e60 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixPatterns.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixPatterns.kt
@@ -147,7 +147,7 @@ object MatrixPatterns {
}
/**
- * Extract server name from a matrix id
+ * Extract server name from a matrix id.
*
* @param matrixId
* @return null if not found or if matrixId is null
@@ -172,7 +172,7 @@ object MatrixPatterns {
}
/**
- * Return the domain form a userId
+ * Return the domain form a userId.
* Examples:
* - "@alice:domain.org".getDomain() will return "domain.org"
* - "@bob:domain.org:3455".getDomain() will return "domain.org:3455"
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixUrls.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixUrls.kt
index 4a41eaec4a..7958186f16 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixUrls.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixUrls.kt
@@ -17,21 +17,21 @@
package org.matrix.android.sdk.api
/**
- * This class contains pattern to match Matrix Url, aka mxc urls
+ * This class contains pattern to match Matrix Url, aka mxc urls.
*/
object MatrixUrls {
/**
- * "mxc" scheme, including "://". So "mxc://"
+ * "mxc" scheme, including "://". So "mxc://".
*/
const val MATRIX_CONTENT_URI_SCHEME = "mxc://"
/**
- * Return true if the String starts with "mxc://"
+ * Return true if the String starts with "mxc://".
*/
fun String.isMxcUrl() = startsWith(MATRIX_CONTENT_URI_SCHEME)
/**
- * Remove the "mxc://" prefix. No op if the String is not a Mxc URL
+ * Remove the "mxc://" prefix. No op if the String is not a Mxc URL.
*/
fun String.removeMxcPrefix() = removePrefix(MATRIX_CONTENT_URI_SCHEME)
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/AuthenticationService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/AuthenticationService.kt
index 9cb784c9c0..5a19df90c4 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/AuthenticationService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/AuthenticationService.kt
@@ -40,12 +40,12 @@ interface AuthenticationService {
suspend fun getLoginFlowOfSession(sessionId: String): LoginFlowResult
/**
- * Get a SSO url
+ * Get a SSO url.
*/
fun getSsoUrl(redirectUrl: String, deviceId: String?, providerId: String?): String?
/**
- * Get the sign in or sign up fallback URL
+ * Get the sign in or sign up fallback URL.
*/
fun getFallbackUrl(forSignIn: Boolean, deviceId: String?): String?
@@ -64,17 +64,17 @@ interface AuthenticationService {
fun getRegistrationWizard(): RegistrationWizard
/**
- * True when login and password has been sent with success to the homeserver
+ * True when login and password has been sent with success to the homeserver.
*/
val isRegistrationStarted: Boolean
/**
- * Cancel pending login or pending registration
+ * Cancel pending login or pending registration.
*/
suspend fun cancelPendingLoginOrRegistration()
/**
- * Reset all pending settings, including current HomeServerConnectionConfig
+ * Reset all pending settings, including current HomeServerConnectionConfig.
*/
suspend fun reset()
@@ -91,20 +91,20 @@ interface AuthenticationService {
fun getLastAuthenticatedSession(): Session?
/**
- * Create a session after a SSO successful login
+ * Create a session after a SSO successful login.
*/
suspend fun createSessionFromSso(homeServerConnectionConfig: HomeServerConnectionConfig,
credentials: Credentials): Session
/**
- * Perform a wellknown request, using the domain from the matrixId
+ * Perform a wellknown request, using the domain from the matrixId.
*/
suspend fun getWellKnownData(matrixId: String,
homeServerConnectionConfig: HomeServerConnectionConfig?): WellknownResult
/**
- * Authenticate with a matrixId and a password
- * Usually call this after a successful call to getWellKnownData()
+ * Authenticate with a matrixId and a password.
+ * Usually call this after a successful call to getWellKnownData().
* @param homeServerConnectionConfig the information about the homeserver and other configuration
* @param matrixId the matrixId of the user
* @param password the password of the account
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/TokenBasedAuth.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/TokenBasedAuth.kt
index e522352c38..2c99ced995 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/TokenBasedAuth.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/TokenBasedAuth.kt
@@ -20,7 +20,7 @@ import com.squareup.moshi.JsonClass
import org.matrix.android.sdk.api.auth.data.LoginFlowTypes
/**
- * This class provides the authentication data by using user and password
+ * This class provides the authentication data by using user and password.
*/
@JsonClass(generateAdapter = true)
data class TokenBasedAuth(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/UserPasswordAuth.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/UserPasswordAuth.kt
index e985c5f08a..8cd5b5e6eb 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/UserPasswordAuth.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/UserPasswordAuth.kt
@@ -20,7 +20,7 @@ import com.squareup.moshi.JsonClass
import org.matrix.android.sdk.api.auth.data.LoginFlowTypes
/**
- * This class provides the authentication data by using user and password
+ * This class provides the authentication data by using user and password.
*/
@JsonClass(generateAdapter = true)
data class UserPasswordAuth(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/Credentials.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/Credentials.kt
index 317acccfb5..e3728753ad 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/Credentials.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/Credentials.kt
@@ -37,7 +37,7 @@ data class Credentials(
*/
@Json(name = "access_token") val accessToken: String,
/**
- * Not documented
+ * Not documented.
*/
@Json(name = "refresh_token") val refreshToken: String?,
/**
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/SessionParams.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/SessionParams.kt
index b490ac877e..e3815231d9 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/SessionParams.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/SessionParams.kt
@@ -22,12 +22,12 @@ package org.matrix.android.sdk.api.auth.data
*/
data class SessionParams(
/**
- * Please consider using shortcuts instead
+ * Please consider using shortcuts instead.
*/
val credentials: Credentials,
/**
- * Please consider using shortcuts instead
+ * Please consider using shortcuts instead.
*/
val homeServerConnectionConfig: HomeServerConnectionConfig,
@@ -41,12 +41,12 @@ data class SessionParams(
*/
/**
- * The userId of the session (Ex: "@user:domain.org")
+ * The userId of the session (Ex: "@user:domain.org").
*/
val userId = credentials.userId
/**
- * The deviceId of the session (Ex: "ABCDEFGH")
+ * The deviceId of the session (Ex: "ABCDEFGH").
*/
val deviceId = credentials.deviceId
@@ -62,12 +62,12 @@ data class SessionParams(
val homeServerUrlBase = homeServerConnectionConfig.homeServerUriBase.toString()
/**
- * The current homeserver host, using what has been entered by the user during login phase
+ * The current homeserver host, using what has been entered by the user during login phase.
*/
val homeServerHost = homeServerConnectionConfig.homeServerUri.host
/**
- * The default identity server url if any, returned by the homeserver during login phase
+ * The default identity server url if any, returned by the homeserver during login phase.
*/
val defaultIdentityServerUrl = homeServerConnectionConfig.identityServerUri?.toString()
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/WellKnown.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/WellKnown.kt
index 4bcef60605..10c7d51392 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/WellKnown.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/WellKnown.kt
@@ -43,6 +43,7 @@ import org.matrix.android.sdk.api.util.JsonDict
* }
* }
*
+ * .
*/
@JsonClass(generateAdapter = true)
data class WellKnown(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/WellKnownBaseConfig.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/WellKnownBaseConfig.kt
index ad6b9970de..df00099232 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/WellKnownBaseConfig.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/data/WellKnownBaseConfig.kt
@@ -26,6 +26,7 @@ import com.squareup.moshi.JsonClass
* "base_url": "https://vector.im"
* }
*
+ * .
*/
@JsonClass(generateAdapter = true)
data class WellKnownBaseConfig(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/login/LoginWizard.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/login/LoginWizard.kt
index 247d58ce79..3232025de3 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/login/LoginWizard.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/login/LoginWizard.kt
@@ -26,7 +26,7 @@ import org.matrix.android.sdk.api.util.JsonDict
*/
interface LoginWizard {
/**
- * Get some information about a matrixId: displayName and avatar url
+ * Get some information about a matrixId: displayName and avatar url.
*/
suspend fun getProfileInfo(matrixId: String): LoginProfileInfo
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/registration/RegistrationFlowResponse.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/registration/RegistrationFlowResponse.kt
index 2b421f2873..1252e93b84 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/registration/RegistrationFlowResponse.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/auth/registration/RegistrationFlowResponse.kt
@@ -73,7 +73,7 @@ data class RegistrationFlowResponse(
)
/**
- * Convert to something easier to handle on client side
+ * Convert to something easier to handle on client side.
*/
fun RegistrationFlowResponse.toFlowResult(): FlowResult {
// Get all the returned stages
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/crypto/CryptoConstants.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/crypto/CryptoConstants.kt
index 172cfa8360..37b9ac379e 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/crypto/CryptoConstants.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/crypto/CryptoConstants.kt
@@ -32,7 +32,7 @@ const val MXCRYPTO_ALGORITHM_MEGOLM = "m.megolm.v1.aes-sha2"
const val MXCRYPTO_ALGORITHM_MEGOLM_BACKUP = "m.megolm_backup.v1.curve25519-aes-sha2"
/**
- * Secured Shared Storage algorithm constant
+ * Secured Shared Storage algorithm constant.
*/
const val SSSS_ALGORITHM_CURVE25519_AES_SHA2 = "m.secret_storage.v1.curve25519-aes-sha2"
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/crypto/Emojis.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/crypto/Emojis.kt
index 9c0eb10970..85d6961384 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/crypto/Emojis.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/crypto/Emojis.kt
@@ -20,7 +20,7 @@ import org.matrix.android.sdk.api.session.crypto.verification.EmojiRepresentatio
import org.matrix.android.sdk.internal.crypto.verification.getEmojiForCode
/**
- * Provide all the emojis used for SAS verification (for debug purpose)
+ * Provide all the emojis used for SAS verification (for debug purpose).
*/
fun getAllVerificationEmojis(): List {
return (0..63).map { getEmojiForCode(it) }
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/extensions/Strings.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/extensions/Strings.kt
index e264843ea4..5e1350e327 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/extensions/Strings.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/extensions/Strings.kt
@@ -24,6 +24,6 @@ fun CharSequence.ensurePrefix(prefix: CharSequence): CharSequence {
}
/**
- * Append a new line and then the provided string
+ * Append a new line and then the provided string.
*/
fun StringBuilder.appendNl(str: String) = append("\n").append(str)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/Extensions.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/Extensions.kt
index 362ebcec26..d3cc8fc8e4 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/Extensions.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/Extensions.kt
@@ -47,7 +47,7 @@ fun Throwable.shouldBeRetried() = this is Failure.NetworkConnection ||
isLimitExceededError()
/**
- * Get the retry delay in case of rate limit exceeded error, adding 100 ms, of defaultValue otherwise
+ * Get the retry delay in case of rate limit exceeded error, adding 100 ms, of defaultValue otherwise.
*/
fun Throwable.getRetryDelay(defaultValue: Long): Long {
return (this as? Failure.ServerError)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/InitialSyncRequestReason.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/InitialSyncRequestReason.kt
index ebe07823f4..8bebbcc3a5 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/InitialSyncRequestReason.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/InitialSyncRequestReason.kt
@@ -17,11 +17,11 @@
package org.matrix.android.sdk.api.failure
/**
- * This enum provide the reason why the SDK request an initial sync to the application
+ * This enum provide the reason why the SDK request an initial sync to the application.
*/
enum class InitialSyncRequestReason {
/**
- * The list of ignored users has changed, and at least one user who was ignored is not ignored anymore
+ * The list of ignored users has changed, and at least one user who was ignored is not ignored anymore.
*/
IGNORED_USERS_LIST_CHANGE,
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/MatrixError.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/MatrixError.kt
index 32e1aca17d..3dbbc39564 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/MatrixError.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/failure/MatrixError.kt
@@ -28,9 +28,9 @@ import org.matrix.android.sdk.api.util.JsonDict
*/
@JsonClass(generateAdapter = true)
data class MatrixError(
- /** unique string which can be used to handle an error message */
+ /** unique string which can be used to handle an error message. */
@Json(name = "errcode") val code: String,
- /** human-readable error message */
+ /** human-readable error message. */
@Json(name = "error") val message: String,
// For M_CONSENT_NOT_GIVEN
@@ -92,19 +92,19 @@ data class MatrixError(
/** Sent when the room alias given to the createRoom API is already in use. */
const val M_ROOM_IN_USE = "M_ROOM_IN_USE"
- /** (Not documented yet) */
+ /** (Not documented yet). */
const val M_BAD_PAGINATION = "M_BAD_PAGINATION"
/** The request was not correctly authorized. Usually due to login failures. */
const val M_UNAUTHORIZED = "M_UNAUTHORIZED"
- /** (Not documented yet) */
+ /** (Not documented yet). */
const val M_OLD_VERSION = "M_OLD_VERSION"
/** The server did not understand the request. */
const val M_UNRECOGNIZED = "M_UNRECOGNIZED"
- /** (Not documented yet) */
+ /** (Not documented yet). */
const val M_LOGIN_EMAIL_URL_NOT_YET = "M_LOGIN_EMAIL_URL_NOT_YET"
/** Authentication could not be performed on the third party identifier. */
@@ -122,7 +122,7 @@ data class MatrixError(
/** The request or entity was too large. */
const val M_TOO_LARGE = "M_TOO_LARGE"
- /** (Not documented yet) */
+ /** (Not documented yet). */
const val M_CONSENT_NOT_GIVEN = "M_CONSENT_NOT_GIVEN"
/** The request cannot be completed because the homeserver has reached a resource limit imposed on it. For example,
@@ -176,10 +176,10 @@ data class MatrixError(
/** The user is unable to reject an invite to join the server notices room. See the Server Notices module for more information. */
const val M_CANNOT_LEAVE_SERVER_NOTICE_ROOM = "M_CANNOT_LEAVE_SERVER_NOTICE_ROOM"
- /** (Not documented yet) */
+ /** (Not documented yet). */
const val M_WRONG_ROOM_KEYS_VERSION = "M_WRONG_ROOM_KEYS_VERSION"
- /** (Not documented yet) */
+ /** (Not documented yet). */
const val M_WEAK_PASSWORD = "M_WEAK_PASSWORD"
/** The provided password's length is shorter than the minimum length required by the server. */
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/federation/FederationService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/federation/FederationService.kt
index 0761ef8d21..8fe6460753 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/federation/FederationService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/federation/FederationService.kt
@@ -18,7 +18,7 @@ package org.matrix.android.sdk.api.federation
interface FederationService {
/**
- * Get information about the homeserver
+ * Get information about the homeserver.
*/
suspend fun getFederationVersion(): FederationVersion
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/listeners/ProgressListener.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/listeners/ProgressListener.kt
index 02ebd7f784..ec55348dc5 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/listeners/ProgressListener.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/listeners/ProgressListener.kt
@@ -17,7 +17,7 @@
package org.matrix.android.sdk.api.listeners
/**
- * Interface to send a progress info
+ * Interface to send a progress info.
*/
interface ProgressListener {
/**
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/listeners/StepProgressListener.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/listeners/StepProgressListener.kt
index 0fabfed2ff..4b87507c02 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/listeners/StepProgressListener.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/listeners/StepProgressListener.kt
@@ -17,7 +17,7 @@
package org.matrix.android.sdk.api.listeners
/**
- * Interface to send a progress info
+ * Interface to send a progress info.
*/
interface StepProgressListener {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/logger/LoggerTag.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/logger/LoggerTag.kt
index 44ac439d7b..ae65963f37 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/logger/LoggerTag.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/logger/LoggerTag.kt
@@ -22,15 +22,15 @@ package org.matrix.android.sdk.api.logger
* val loggerTag = LoggerTag("MyTag", LoggerTag.VOIP)
* Timber.tag(loggerTag.value).v("My log message")
*/
-open class LoggerTag(_value: String, parentTag: LoggerTag? = null) {
+open class LoggerTag(name: String, parentTag: LoggerTag? = null) {
object SYNC : LoggerTag("SYNC")
object VOIP : LoggerTag("VOIP")
object CRYPTO : LoggerTag("CRYPTO")
val value: String = if (parentTag == null) {
- _value
+ name
} else {
- "${parentTag.value}/$_value"
+ "${parentTag.value}/$name"
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/query/QueryStringValue.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/query/QueryStringValue.kt
index 31ec131c5c..368ff98661 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/query/QueryStringValue.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/query/QueryStringValue.kt
@@ -36,19 +36,19 @@ sealed interface QueryStringValue {
enum class Case {
/**
- * Match query sensitive to case
+ * Match query sensitive to case.
*/
SENSITIVE,
/**
- * Match query insensitive to case, this only works for Latin-1 character sets
+ * Match query insensitive to case, this only works for Latin-1 character sets.
*/
INSENSITIVE,
/**
- * Match query with input normalized (case insensitive)
- * Works around Realms inability to sort or filter by case for non Latin-1 character sets
- * Expects the target field to contain normalized data
+ * Match query with input normalized (case insensitive).
+ * Works around Realms inability to sort or filter by case for non Latin-1 character sets.
+ * Expects the target field to contain normalized data.
*
* @see org.matrix.android.sdk.internal.util.Normalizer.normalize
*/
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/raw/RawService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/raw/RawService.kt
index 3366d040f7..71a4f84a8d 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/raw/RawService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/raw/RawService.kt
@@ -23,19 +23,19 @@ import org.matrix.android.sdk.api.cache.CacheStrategy
*/
interface RawService {
/**
- * Get a URL, either from cache or from the remote server, depending on the cache strategy
+ * Get a URL, either from cache or from the remote server, depending on the cache strategy.
*/
suspend fun getUrl(url: String, cacheStrategy: CacheStrategy): String
/**
- * Specific case for the well-known file. Cache validity is 8 hours
+ * Specific case for the well-known file. Cache validity is 8 hours.
* @param domain the domain to get the .well-known file, for instance "matrix.org".
* The URL will be "https://{domain}/.well-known/matrix/client"
*/
suspend fun getWellknown(domain: String): String
/**
- * Clear all the cache data
+ * Clear all the cache data.
*/
suspend fun clearCache()
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt
index 19502f0b46..2f1ae8cd87 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt
@@ -72,23 +72,23 @@ interface Session {
val coroutineDispatchers: MatrixCoroutineDispatchers
/**
- * The params associated to the session
+ * The params associated to the session.
*/
val sessionParams: SessionParams
/**
- * The session is valid, i.e. it has a valid token so far
+ * The session is valid, i.e. it has a valid token so far.
*/
val isOpenable: Boolean
/**
- * Useful shortcut to get access to the userId
+ * Useful shortcut to get access to the userId.
*/
val myUserId: String
get() = sessionParams.userId
/**
- * The sessionId
+ * The sessionId.
*/
val sessionId: String
@@ -99,16 +99,16 @@ interface Session {
fun open()
/**
- * Requires a one time background sync
+ * Requires a one time background sync.
*/
fun requireBackgroundSync()
/**
- * Launches infinite self rescheduling background syncs via the WorkManager
+ * Launches infinite self rescheduling background syncs via the WorkManager.
*
- * While dozing, syncs will only occur during maintenance windows
+ * While dozing, syncs will only occur during maintenance windows.
* For reliability it's recommended to also start a long running foreground service
- * along with disabling battery optimizations
+ * along with disabling battery optimizations.
*/
fun startAutomaticBackgroundSync(timeOutInSeconds: Long, repeatDelayInSeconds: Long)
@@ -125,7 +125,7 @@ interface Session {
fun stopSync()
/**
- * Clear cache of the session
+ * Clear cache of the session.
*/
suspend fun clearCache()
@@ -147,7 +147,7 @@ interface Session {
fun syncFlow(): SharedFlow
/**
- * This methods return true if an initial sync has been processed
+ * This methods return true if an initial sync has been processed.
*/
fun hasAlreadySynced(): Boolean
@@ -162,187 +162,187 @@ interface Session {
fun contentUrlResolver(): ContentUrlResolver
/**
- * Returns the ContentUploadProgressTracker associated with the session
+ * Returns the ContentUploadProgressTracker associated with the session.
*/
fun contentUploadProgressTracker(): ContentUploadStateTracker
/**
- * Returns the TypingUsersTracker associated with the session
+ * Returns the TypingUsersTracker associated with the session.
*/
fun typingUsersTracker(): TypingUsersTracker
/**
- * Returns the ContentDownloadStateTracker associated with the session
+ * Returns the ContentDownloadStateTracker associated with the session.
*/
fun contentDownloadProgressTracker(): ContentDownloadStateTracker
/**
- * Returns the cryptoService associated with the session
+ * Returns the cryptoService associated with the session.
*/
fun cryptoService(): CryptoService
/**
- * Returns the ContentScannerService associated with the session
+ * Returns the ContentScannerService associated with the session.
*/
fun contentScannerService(): ContentScannerService
/**
- * Returns the identity service associated with the session
+ * Returns the identity service associated with the session.
*/
fun identityService(): IdentityService
/**
- * Returns the HomeServerCapabilities service associated with the session
+ * Returns the HomeServerCapabilities service associated with the session.
*/
fun homeServerCapabilitiesService(): HomeServerCapabilitiesService
/**
- * Returns the RoomService associated with the session
+ * Returns the RoomService associated with the session.
*/
fun roomService(): RoomService
/**
- * Returns the RoomDirectoryService associated with the session
+ * Returns the RoomDirectoryService associated with the session.
*/
fun roomDirectoryService(): RoomDirectoryService
/**
- * Returns the GroupService associated with the session
+ * Returns the GroupService associated with the session.
*/
fun groupService(): GroupService
/**
- * Returns the UserService associated with the session
+ * Returns the UserService associated with the session.
*/
fun userService(): UserService
/**
- * Returns the SignOutService associated with the session
+ * Returns the SignOutService associated with the session.
*/
fun signOutService(): SignOutService
/**
- * Returns the FilterService associated with the session
+ * Returns the FilterService associated with the session.
*/
fun filterService(): FilterService
/**
- * Returns the PushRuleService associated with the session
+ * Returns the PushRuleService associated with the session.
*/
fun pushRuleService(): PushRuleService
/**
- * Returns the PushersService associated with the session
+ * Returns the PushersService associated with the session.
*/
fun pushersService(): PushersService
/**
- * Returns the EventService associated with the session
+ * Returns the EventService associated with the session.
*/
fun eventService(): EventService
/**
- * Returns the TermsService associated with the session
+ * Returns the TermsService associated with the session.
*/
fun termsService(): TermsService
/**
- * Returns the SyncStatusService associated with the session
+ * Returns the SyncStatusService associated with the session.
*/
fun syncStatusService(): SyncStatusService
/**
- * Returns the SecureStorageService associated with the session
+ * Returns the SecureStorageService associated with the session.
*/
fun secureStorageService(): SecureStorageService
/**
- * Returns the ProfileService associated with the session
+ * Returns the ProfileService associated with the session.
*/
fun profileService(): ProfileService
/**
- * Returns the PresenceService associated with the session
+ * Returns the PresenceService associated with the session.
*/
fun presenceService(): PresenceService
/**
- * Returns the AccountService associated with the session
+ * Returns the AccountService associated with the session.
*/
fun accountService(): AccountService
/**
- * Returns the ToDeviceService associated with the session
+ * Returns the ToDeviceService associated with the session.
*/
fun toDeviceService(): ToDeviceService
/**
- * Returns the EventStreamService associated with the session
+ * Returns the EventStreamService associated with the session.
*/
fun eventStreamService(): EventStreamService
/**
- * Returns the widget service associated with the session
+ * Returns the widget service associated with the session.
*/
fun widgetService(): WidgetService
/**
- * Returns the media service associated with the session
+ * Returns the media service associated with the session.
*/
fun mediaService(): MediaService
/**
- * Returns the integration manager service associated with the session
+ * Returns the integration manager service associated with the session.
*/
fun integrationManagerService(): IntegrationManagerService
/**
- * Returns the call signaling service associated with the session
+ * Returns the call signaling service associated with the session.
*/
fun callSignalingService(): CallSignalingService
/**
- * Returns the file download service associated with the session
+ * Returns the file download service associated with the session.
*/
fun fileService(): FileService
/**
- * Returns the permalink service associated with the session
+ * Returns the permalink service associated with the session.
*/
fun permalinkService(): PermalinkService
/**
- * Returns the search service associated with the session
+ * Returns the search service associated with the session.
*/
fun searchService(): SearchService
/**
- * Returns the federation service associated with the session
+ * Returns the federation service associated with the session.
*/
fun federationService(): FederationService
/**
- * Returns the third party service associated with the session
+ * Returns the third party service associated with the session.
*/
fun thirdPartyService(): ThirdPartyService
/**
- * Returns the space service associated with the session
+ * Returns the space service associated with the session.
*/
fun spaceService(): SpaceService
/**
- * Returns the open id service associated with the session
+ * Returns the open id service associated with the session.
*/
fun openIdService(): OpenIdService
/**
- * Returns the account data service associated with the session
+ * Returns the account data service associated with the session.
*/
fun accountDataService(): SessionAccountDataService
/**
- * Returns the SharedSecretStorageService associated with the session
+ * Returns the SharedSecretStorageService associated with the session.
*/
fun sharedSecretStorageService(): SharedSecretStorageService
@@ -377,8 +377,8 @@ interface Session {
/**
* Possible cases:
* - The access token is not valid anymore,
- * - a M_CONSENT_NOT_GIVEN error has been received from the homeserver
- * See [GlobalError] for all the possible cases
+ * - a M_CONSENT_NOT_GIVEN error has been received from the homeserver;
+ * See [GlobalError] for all the possible cases.
*/
fun onGlobalError(session: Session, globalError: GlobalError) = Unit
}
@@ -386,7 +386,7 @@ interface Session {
fun getUiaSsoFallbackUrl(authenticationSessionId: String): String
/**
- * Maintenance API, allows to print outs info on DB size to logcat
+ * Maintenance API, allows to print outs info on DB size to logcat.
*/
fun logDbUsageInfo()
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/SessionExtensions.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/SessionExtensions.kt
index aeb0e7e4ee..a15e73eb88 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/SessionExtensions.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/SessionExtensions.kt
@@ -21,16 +21,16 @@ import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.user.model.User
/**
- * Get a room using the RoomService of a Session
+ * Get a room using the RoomService of a Session.
*/
fun Session.getRoom(roomId: String): Room? = roomService().getRoom(roomId)
/**
- * Get a room summary using the RoomService of a Session
+ * Get a room summary using the RoomService of a Session.
*/
fun Session.getRoomSummary(roomIdOrAlias: String): RoomSummary? = roomService().getRoomSummary(roomIdOrAlias)
/**
- * Get a user using the UserService of a Session
+ * Get a user using the UserService of a Session.
*/
fun Session.getUser(userId: String): User? = userService().getUser(userId)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/ToDeviceService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/ToDeviceService.kt
index d7afad5b6c..56e5ebdbe7 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/ToDeviceService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/ToDeviceService.kt
@@ -21,9 +21,8 @@ import org.matrix.android.sdk.api.session.events.model.Content
import java.util.UUID
interface ToDeviceService {
-
/**
- * Send an event to a specific list of devices
+ * Send an event to a specific list of devices.
*/
suspend fun sendToDevice(eventType: String, contentMap: MXUsersDevicesMap, txnId: String? = UUID.randomUUID().toString())
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/SessionAccountDataService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/SessionAccountDataService.kt
index 2ffb9112d1..a22dd33774 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/SessionAccountDataService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/SessionAccountDataService.kt
@@ -26,12 +26,12 @@ import org.matrix.android.sdk.api.util.Optional
*/
interface SessionAccountDataService {
/**
- * Retrieve the account data with the provided type or null if not found
+ * Retrieve the account data with the provided type or null if not found.
*/
fun getUserAccountDataEvent(type: String): UserAccountDataEvent?
/**
- * Observe the account data with the provided type
+ * Observe the account data with the provided type.
*/
fun getLiveUserAccountDataEvent(type: String): LiveData>
@@ -60,7 +60,7 @@ interface SessionAccountDataService {
fun getLiveRoomAccountDataEvents(types: Set): LiveData>
/**
- * Update the account data with the provided type and the provided account data content
+ * Update the account data with the provided type and the provided account data content.
*/
suspend fun updateUserAccountData(type: String, content: Content)
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/CallListener.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/CallListener.kt
index d17be59cd4..7f932e8815 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/CallListener.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/CallListener.kt
@@ -39,32 +39,32 @@ interface CallListener {
fun onCallAnswerReceived(callAnswerContent: CallAnswerContent)
/**
- * Called when a called has been hung up
+ * Called when a called has been hung up.
*/
fun onCallHangupReceived(callHangupContent: CallHangupContent)
/**
- * Called when a called has been rejected
+ * Called when a called has been rejected.
*/
fun onCallRejectReceived(callRejectContent: CallRejectContent)
/**
- * Called when an answer has been selected
+ * Called when an answer has been selected.
*/
fun onCallSelectAnswerReceived(callSelectAnswerContent: CallSelectAnswerContent)
/**
- * Called when a negotiation is sent
+ * Called when a negotiation is sent.
*/
fun onCallNegotiateReceived(callNegotiateContent: CallNegotiateContent)
/**
- * Called when the call has been managed by an other session
+ * Called when the call has been managed by an other session.
*/
fun onCallManagedByOtherSession(callId: String)
/**
- * Called when an asserted identity event is received
+ * Called when an asserted identity event is received.
*/
fun onCallAssertedIdentityReceived(callAssertedIdentityContent: CallAssertedIdentityContent)
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/CallSignalingService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/CallSignalingService.kt
index c34744e75f..e17c02c40a 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/CallSignalingService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/CallSignalingService.kt
@@ -21,7 +21,7 @@ interface CallSignalingService {
suspend fun getTurnServer(): TurnServerResponse
/**
- * Create an outgoing call
+ * Create an outgoing call.
*/
fun createOutgoingCall(roomId: String, otherUserId: String, isVideoCall: Boolean): MxCall
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/CallState.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/CallState.kt
index ff1df63300..4bf78c9d6a 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/CallState.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/CallState.kt
@@ -20,7 +20,7 @@ import org.matrix.android.sdk.api.session.room.model.call.EndCallReason
sealed class CallState {
- /** Idle, setting up objects */
+ /** Idle, setting up objects. */
object Idle : CallState()
/**
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/MxCall.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/MxCall.kt
index dd23e81cc6..e13f7310e0 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/MxCall.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/call/MxCall.kt
@@ -35,7 +35,7 @@ interface MxCallDetail {
}
/**
- * Define both an incoming call and on outgoing call
+ * Define both an incoming call and on outgoing call.
*/
interface MxCall : MxCallDetail {
@@ -46,13 +46,13 @@ interface MxCall : MxCallDetail {
var state: CallState
/**
- * Pick Up the incoming call
- * It has no effect on outgoing call
+ * Pick Up the incoming call.
+ * It has no effect on outgoing call.
*/
fun accept(sdpString: String)
/**
- * SDP negotiation for media pause, hold/resume, ICE restarts and voice/video call up/downgrading
+ * SDP negotiation for media pause, hold/resume, ICE restarts and voice/video call up/downgrading.
*/
fun negotiate(sdpString: String, type: SdpType)
@@ -62,17 +62,17 @@ interface MxCall : MxCallDetail {
fun selectAnswer()
/**
- * Reject an incoming call
+ * Reject an incoming call.
*/
fun reject()
/**
- * End the call
+ * End the call.
*/
fun hangUp(reason: EndCallReason? = null)
/**
- * Start a call
+ * Start a call.
* Send offer SDP to the other participant.
*/
fun offerSdp(sdpString: String)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/content/ContentUrlResolver.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/content/ContentUrlResolver.kt
index 523d60359b..e59e676ed9 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/content/ContentUrlResolver.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/content/ContentUrlResolver.kt
@@ -29,7 +29,7 @@ interface ContentUrlResolver {
}
/**
- * URL to use to upload content
+ * URL to use to upload content.
*/
val uploadUrl: String
@@ -42,7 +42,7 @@ interface ContentUrlResolver {
fun resolveFullSize(contentUrl: String?): String?
/**
- * Get the ResolvedMethod to download a URL
+ * Get the ResolvedMethod to download a URL.
*
* @param contentUrl the Matrix media content URI (in the form of "mxc://...").
* @param elementToDecrypt Encryption data may be required if you use a content scanner
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt
index b8c08d23dc..35f3ab3162 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt
@@ -155,8 +155,8 @@ interface CryptoService {
fun getIncomingRoomKeyRequestsPaged(): LiveData>
/**
- * Can be called by the app layer to accept a request manually
- * Use carefully as it is prone to social attacks
+ * Can be called by the app layer to accept a request manually.
+ * Use carefully as it is prone to social attacks.
*/
suspend fun manuallyAcceptRoomKeyRequest(request: IncomingRoomKeyRequest)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/MXCryptoError.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/MXCryptoError.kt
index 5ff4b54b11..0b5bbe3bbd 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/MXCryptoError.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/MXCryptoError.kt
@@ -28,7 +28,7 @@ sealed class MXCryptoError : Throwable() {
data class Base(val errorType: ErrorType,
val technicalMessage: String,
/**
- * Describe the error with more details
+ * Describe the error with more details.
*/
val detailedErrorDescription: String? = null) : MXCryptoError()
@@ -63,7 +63,7 @@ sealed class MXCryptoError : Throwable() {
companion object {
/**
- * Resource for technicalMessage
+ * Resource for technicalMessage.
*/
const val UNABLE_TO_ENCRYPT_REASON = "Unable to encrypt %s"
const val UNABLE_TO_DECRYPT_REASON = "Unable to decrypt %1\$s. Algorithm: %2\$s"
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/NewSessionListener.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/NewSessionListener.kt
index 73cbf5fb78..d9e841a50f 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/NewSessionListener.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/NewSessionListener.kt
@@ -17,7 +17,7 @@
package org.matrix.android.sdk.api.session.crypto
/**
- * This listener notifies on new Megolm sessions being created
+ * This listener notifies on new Megolm sessions being created.
*/
interface NewSessionListener {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/attachments/ElementToDecrypt.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/attachments/ElementToDecrypt.kt
index de168ac6e5..2591703e0c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/attachments/ElementToDecrypt.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/attachments/ElementToDecrypt.kt
@@ -35,7 +35,7 @@ fun EncryptedFileInfo.toElementToDecrypt(): ElementToDecrypt? {
}
/**
- * Represent data to decode an attachment
+ * Represent data to decode an attachment.
*/
@Parcelize
data class ElementToDecrypt(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/crosssigning/CrossSigningService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/crosssigning/CrossSigningService.kt
index 46b131f613..5439389096 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/crosssigning/CrossSigningService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/crosssigning/CrossSigningService.kt
@@ -66,7 +66,7 @@ interface CrossSigningService {
fun markMyMasterKeyAsTrusted()
/**
- * Sign one of your devices and upload the signature
+ * Sign one of your devices and upload the signature.
*/
fun trustDevice(deviceId: String,
callback: MatrixCallback)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupService.kt
index 9ff99f8dce..0d40490c3e 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupService.kt
@@ -23,7 +23,7 @@ import org.matrix.android.sdk.api.session.crypto.model.ImportRoomKeysResult
interface KeysBackupService {
/**
- * Retrieve the current version of the backup from the homeserver
+ * Retrieve the current version of the backup from the homeserver.
*
* It can be different than keysBackupVersion.
* @param callback Asynchronous callback
@@ -40,12 +40,12 @@ interface KeysBackupService {
callback: MatrixCallback)
/**
- * Facility method to get the total number of locally stored keys
+ * Facility method to get the total number of locally stored keys.
*/
fun getTotalNumbersOfKeys(): Int
/**
- * Facility method to get the number of backed up keys
+ * Facility method to get the number of backed up keys.
*/
fun getTotalNumbersOfBackedUpKeys(): Int
@@ -68,7 +68,7 @@ interface KeysBackupService {
callback: MatrixCallback)
/**
- * Return the current progress of the backup
+ * Return the current progress of the backup.
*/
fun getBackupProgress(progressListener: ProgressListener)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupStateListener.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupStateListener.kt
index a6f4bd0ec7..32216fe3f5 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupStateListener.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupStateListener.kt
@@ -19,7 +19,7 @@ package org.matrix.android.sdk.api.session.crypto.keysbackup
interface KeysBackupStateListener {
/**
- * The keys backup state has changed
+ * The keys backup state has changed.
* @param newState the new state
*/
fun onStateChange(newState: KeysBackupState)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupVersionTrustSignature.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupVersionTrustSignature.kt
index 219a328cfd..7127c8d3f4 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupVersionTrustSignature.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysBackupVersionTrustSignature.kt
@@ -16,25 +16,35 @@
package org.matrix.android.sdk.api.session.crypto.keysbackup
+import org.matrix.android.sdk.api.session.crypto.crosssigning.CryptoCrossSigningKey
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
/**
* A signature in a `KeysBackupVersionTrust` object.
*/
-data class KeysBackupVersionTrustSignature(
- /**
- * The id of the device that signed the backup version.
- */
- val deviceId: String?,
- /**
- * The device that signed the backup version.
- * Can be null if the device is not known.
- */
- val device: CryptoDeviceInfo?,
+sealed class KeysBackupVersionTrustSignature {
- /**
- * Flag to indicate the signature from this device is valid.
- */
- val valid: Boolean,
-)
+ data class DeviceSignature(
+ /**
+ * The id of the device that signed the backup version.
+ */
+ val deviceId: String?,
+
+ /**
+ * The device that signed the backup version.
+ * Can be null if the device is not known.
+ */
+ val device: CryptoDeviceInfo?,
+
+ /**
+ * Flag to indicate the signature from this device is valid.
+ */
+ val valid: Boolean) : KeysBackupVersionTrustSignature()
+
+ data class UserSignature(
+ val keyId: String?,
+ val cryptoCrossSigningKey: CryptoCrossSigningKey?,
+ val valid: Boolean
+ ) : KeysBackupVersionTrustSignature()
+}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysVersionResult.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysVersionResult.kt
index f283a34e98..3d89bf9e2f 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysVersionResult.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/KeysVersionResult.kt
@@ -30,8 +30,8 @@ data class KeysVersionResult(
override val algorithm: String,
/**
- * algorithm-dependent data, for "m.megolm_backup.v1.curve25519-aes-sha2"
- * see [org.matrix.android.sdk.internal.crypto.keysbackup.MegolmBackupAuthData]
+ * algorithm-dependent data, for "m.megolm_backup.v1.curve25519-aes-sha2".
+ * @see [org.matrix.android.sdk.internal.crypto.keysbackup.MegolmBackupAuthData]
*/
@Json(name = "auth_data")
override val authData: JsonDict,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/RecoveryKey.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/RecoveryKey.kt
index 85d6ef4365..9ad0bfc8b6 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/RecoveryKey.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keysbackup/RecoveryKey.kt
@@ -30,7 +30,7 @@ private const val CHAR_1 = 0x01.toByte()
private const val RECOVERY_KEY_LENGTH = 2 + 32 + 1
/**
- * Tell if the format of the recovery key is correct
+ * Tell if the format of the recovery key is correct.
*
* @param recoveryKey
* @return true if the format of the recovery key is correct
@@ -40,7 +40,7 @@ fun isValidRecoveryKey(recoveryKey: String?): Boolean {
}
/**
- * Compute recovery key from curve25519 key
+ * Compute recovery key from curve25519 key.
*
* @param curve25519Key
* @return the recovery key
@@ -69,7 +69,7 @@ fun computeRecoveryKey(curve25519Key: ByteArray): String {
}
/**
- * Please call [.isValidRecoveryKey] and ensure it returns true before calling this method
+ * Please call [.isValidRecoveryKey] and ensure it returns true before calling this method.
*
* @param recoveryKey the recovery key
* @return curveKey, or null in case of error
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keyshare/GossipingRequestListener.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keyshare/GossipingRequestListener.kt
index 24d3cf4004..cc160f8d85 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keyshare/GossipingRequestListener.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/keyshare/GossipingRequestListener.kt
@@ -20,7 +20,7 @@ import org.matrix.android.sdk.api.session.crypto.model.IncomingRoomKeyRequest
import org.matrix.android.sdk.api.session.crypto.model.SecretShareRequest
/**
- * Room keys events listener
+ * Room keys events listener.
*/
interface GossipingRequestListener {
/**
@@ -31,7 +31,7 @@ interface GossipingRequestListener {
fun onRoomKeyRequest(request: IncomingRoomKeyRequest)
/**
- * Returns the secret value to be shared
+ * Returns the secret value to be shared.
* @return true if is handled
*/
fun onSecretShareRequest(request: SecretShareRequest): Boolean
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/DeviceInfo.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/DeviceInfo.kt
index 221d0793d9..b144069b99 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/DeviceInfo.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/DeviceInfo.kt
@@ -20,24 +20,24 @@ import com.squareup.moshi.JsonClass
import org.matrix.android.sdk.api.interfaces.DatedObject
/**
- * This class describes the device information
+ * This class describes the device information.
*/
@JsonClass(generateAdapter = true)
data class DeviceInfo(
/**
- * The owner user id (not documented and useless but the homeserver sent it. You should not need it)
+ * The owner user id (not documented and useless but the homeserver sent it. You should not need it).
*/
@Json(name = "user_id")
val userId: String? = null,
/**
- * The device id
+ * The device id.
*/
@Json(name = "device_id")
val deviceId: String? = null,
/**
- * The device display name
+ * The device display name.
*/
@Json(name = "display_name")
val displayName: String? = null,
@@ -49,7 +49,7 @@ data class DeviceInfo(
val lastSeenTs: Long? = null,
/**
- * The last ip address
+ * The last ip address.
*/
@Json(name = "last_seen_ip")
val lastSeenIp: String? = null
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/EncryptedFileInfo.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/EncryptedFileInfo.kt
index 13ad1df476..fb64c6f338 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/EncryptedFileInfo.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/EncryptedFileInfo.kt
@@ -20,7 +20,7 @@ import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
/**
- * In Matrix specs: EncryptedFile
+ * In Matrix specs: EncryptedFile.
*/
@JsonClass(generateAdapter = true)
data class EncryptedFileInfo(
@@ -56,7 +56,7 @@ data class EncryptedFileInfo(
val v: String? = null
) {
/**
- * Check what the spec tells us
+ * Check what the spec tells us.
*/
fun isValid(): Boolean {
if (url.isNullOrBlank()) {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/EncryptedFileKey.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/EncryptedFileKey.kt
index 859c6ac43f..6308e3d615 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/EncryptedFileKey.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/EncryptedFileKey.kt
@@ -52,7 +52,7 @@ data class EncryptedFileKey(
val k: String? = null
) {
/**
- * Check what the spec tells us
+ * Check what the spec tells us.
*/
fun isValid(): Boolean {
if (alg != "A256CTR") {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/GossipingToDeviceObject.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/GossipingToDeviceObject.kt
index 1922b2bcee..ac575332da 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/GossipingToDeviceObject.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/GossipingToDeviceObject.kt
@@ -17,7 +17,7 @@
package org.matrix.android.sdk.api.session.crypto.model
/**
- * Interface representing an room key action request
+ * Interface representing an room key action request.
* Note: this class cannot be abstract because of [org.matrix.androidsdk.core.JsonUtils.toRoomKeyShare]
*/
interface GossipingToDeviceObject : SendToDeviceObject {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/IncomingRoomKeyRequest.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/IncomingRoomKeyRequest.kt
index 0a28478a10..0c19d275cc 100755
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/IncomingRoomKeyRequest.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/IncomingRoomKeyRequest.kt
@@ -23,22 +23,22 @@ import org.matrix.android.sdk.internal.util.time.Clock
*/
data class IncomingRoomKeyRequest(
/**
- * The user id
+ * The user id.
*/
val userId: String? = null,
/**
- * The device id
+ * The device id.
*/
val deviceId: String? = null,
/**
- * The request id
+ * The request id.
*/
val requestId: String? = null,
/**
- * The request body
+ * The request body.
*/
val requestBody: RoomKeyRequestBody? = null,
@@ -46,7 +46,7 @@ data class IncomingRoomKeyRequest(
) {
companion object {
/**
- * Factory
+ * Factory.
*
* @param event the event
* @param currentTimeMillis the current time in milliseconds
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/MXDeviceInfo.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/MXDeviceInfo.kt
index 286ab2b7d5..a5a581d240 100755
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/MXDeviceInfo.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/MXDeviceInfo.kt
@@ -30,7 +30,7 @@ data class MXDeviceInfo(
val deviceId: String,
/**
- * the user id
+ * the user id.
*/
@Json(name = "user_id")
val userId: String,
@@ -66,7 +66,7 @@ data class MXDeviceInfo(
val verified: Int = DEVICE_VERIFICATION_UNKNOWN
) : Serializable {
/**
- * Tells if the device is unknown
+ * Tells if the device is unknown.
*
* @return true if the device is unknown
*/
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/MXEncryptEventContentResult.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/MXEncryptEventContentResult.kt
index 706e40a769..4cfcc01a26 100755
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/MXEncryptEventContentResult.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/MXEncryptEventContentResult.kt
@@ -20,11 +20,11 @@ import org.matrix.android.sdk.api.session.events.model.Content
data class MXEncryptEventContentResult(
/**
- * The encrypted event content
+ * The encrypted event content.
*/
val eventContent: Content,
/**
- * the event type
+ * The event type.
*/
val eventType: String
)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/MXUsersDevicesMap.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/MXUsersDevicesMap.kt
index dc5567e908..744fe74d0d 100755
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/MXUsersDevicesMap.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/MXUsersDevicesMap.kt
@@ -31,7 +31,7 @@ class MXUsersDevicesMap {
get() = map.isEmpty()
/**
- * Provides the device ids list for a user id
+ * Provides the device ids list for a user id.
* FIXME Should maybe return emptyList and not null, to avoid many !! in the code
*
* @param userId the user id
@@ -44,7 +44,7 @@ class MXUsersDevicesMap {
}
/**
- * Provides the object for a device id and a user Id
+ * Provides the object for a device id and a user Id.
*
* @param deviceId the device id
* @param userId the object id
@@ -57,7 +57,7 @@ class MXUsersDevicesMap {
}
/**
- * Set an object for a dedicated user Id and device Id
+ * Set an object for a dedicated user Id and device Id.
*
* @param userId the user Id
* @param deviceId the device id
@@ -71,7 +71,7 @@ class MXUsersDevicesMap {
}
/**
- * Defines the objects map for a user Id
+ * Defines the objects map for a user Id.
*
* @param objectsPerDevices the objects maps
* @param userId the user id
@@ -87,7 +87,7 @@ class MXUsersDevicesMap {
}
/**
- * Removes objects for a dedicated user
+ * Removes objects for a dedicated user.
*
* @param userId the user id.
*/
@@ -98,14 +98,14 @@ class MXUsersDevicesMap {
}
/**
- * Clear the internal dictionary
+ * Clear the internal dictionary.
*/
fun removeAllObjects() {
map.clear()
}
/**
- * Add entries from another MXUsersDevicesMap
+ * Add entries from another MXUsersDevicesMap.
*
* @param other the other one
*/
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/OlmDecryptionResult.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/OlmDecryptionResult.kt
index 9cf2bf75fb..a26f6606ed 100755
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/OlmDecryptionResult.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/OlmDecryptionResult.kt
@@ -26,7 +26,7 @@ import org.matrix.android.sdk.api.util.JsonDict
@JsonClass(generateAdapter = true)
data class OlmDecryptionResult(
/**
- * The decrypted payload (with properties 'type', 'content')
+ * The decrypted payload (with properties 'type', 'content').
*/
@Json(name = "payload") val payload: JsonDict? = null,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/RoomKeyRequestBody.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/RoomKeyRequestBody.kt
index 15163248dc..8352949263 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/RoomKeyRequestBody.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/RoomKeyRequestBody.kt
@@ -21,7 +21,7 @@ import com.squareup.moshi.JsonClass
import org.matrix.android.sdk.internal.di.MoshiProvider
/**
- * Class representing an room key request body content
+ * Class representing an room key request body content.
*/
@JsonClass(generateAdapter = true)
data class RoomKeyRequestBody(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/RoomKeyShareRequest.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/RoomKeyShareRequest.kt
index b6bb4c55af..adbe831a07 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/RoomKeyShareRequest.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/RoomKeyShareRequest.kt
@@ -20,7 +20,7 @@ import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
/**
- * Class representing a room key request content
+ * Class representing a room key request content.
*/
@JsonClass(generateAdapter = true)
data class RoomKeyShareRequest(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/SecretShareRequest.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/SecretShareRequest.kt
index 6009077806..263a7b16e4 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/SecretShareRequest.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/model/SecretShareRequest.kt
@@ -20,7 +20,7 @@ import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
/**
- * Class representing a room key request content
+ * Class representing a room key request content.
*/
@JsonClass(generateAdapter = true)
data class SecretShareRequest(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/PendingVerificationRequest.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/PendingVerificationRequest.kt
index be450b9d03..7db450e861 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/PendingVerificationRequest.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/PendingVerificationRequest.kt
@@ -22,7 +22,7 @@ import org.matrix.android.sdk.internal.crypto.model.rest.VERIFICATION_METHOD_SAS
import java.util.UUID
/**
- * Stores current pending verification requests
+ * Stores current pending verification requests.
*/
data class PendingVerificationRequest(
val ageLocalTs: Long,
@@ -45,7 +45,7 @@ data class PendingVerificationRequest(
val isFinished: Boolean = isSuccessful || cancelConclusion != null
/**
- * SAS is supported if I support it and the other party support it
+ * SAS is supported if I support it and the other party support it.
*/
fun isSasSupported(): Boolean {
return requestInfo?.methods?.contains(VERIFICATION_METHOD_SAS).orFalse() &&
@@ -53,7 +53,7 @@ data class PendingVerificationRequest(
}
/**
- * Other can show QR code if I can scan QR code and other can show QR code
+ * Other can show QR code if I can scan QR code and other can show QR code.
*/
fun otherCanShowQrCode(): Boolean {
return if (isIncoming) {
@@ -66,7 +66,7 @@ data class PendingVerificationRequest(
}
/**
- * Other can scan QR code if I can show QR code and other can scan QR code
+ * Other can scan QR code if I can show QR code and other can scan QR code.
*/
fun otherCanScanQrCode(): Boolean {
return if (isIncoming) {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/QrCodeVerificationTransaction.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/QrCodeVerificationTransaction.kt
index 37855099be..06bac4109b 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/QrCodeVerificationTransaction.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/QrCodeVerificationTransaction.kt
@@ -19,22 +19,22 @@ package org.matrix.android.sdk.api.session.crypto.verification
interface QrCodeVerificationTransaction : VerificationTransaction {
/**
- * To use to display a qr code, for the other user to scan it
+ * To use to display a qr code, for the other user to scan it.
*/
val qrCodeText: String?
/**
- * Call when you have scan the other user QR code
+ * Call when you have scan the other user QR code.
*/
fun userHasScannedOtherQrCode(otherQrCodeText: String)
/**
- * Call when you confirm that other user has scanned your QR code
+ * Call when you confirm that other user has scanned your QR code.
*/
fun otherUserScannedMyQrCode()
/**
- * Call when you do not confirm that other user has scanned your QR code
+ * Call when you do not confirm that other user has scanned your QR code.
*/
fun otherUserDidNotScannedMyQrCode()
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/SasVerificationTransaction.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/SasVerificationTransaction.kt
index da546be68f..095b4208f8 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/SasVerificationTransaction.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/SasVerificationTransaction.kt
@@ -28,7 +28,7 @@ interface SasVerificationTransaction : VerificationTransaction {
/**
* To be called by the client when the user has verified that
- * both short codes do match
+ * both short codes do match.
*/
fun userHasVerifiedShortCode()
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationMethod.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationMethod.kt
index 4efec93a34..f2de2c4b47 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationMethod.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationMethod.kt
@@ -17,7 +17,7 @@
package org.matrix.android.sdk.api.session.crypto.verification
/**
- * Verification methods
+ * Verification methods.
*/
enum class VerificationMethod {
// Use it when your application supports the SAS verification method
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationService.kt
index ec67e4b31d..321ec73094 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationService.kt
@@ -34,7 +34,7 @@ interface VerificationService {
fun removeListener(listener: Listener)
/**
- * Mark this device as verified manually
+ * Mark this device as verified manually.
*/
fun markedLocallyAsManuallyVerified(userId: String, deviceID: String)
@@ -52,7 +52,7 @@ interface VerificationService {
transactionId: String?): String?
/**
- * Request key verification with another user via room events (instead of the to-device API)
+ * Request key verification with another user via room events (instead of the to-device API).
*/
fun requestKeyVerificationInDMs(methods: List,
otherUserId: String,
@@ -81,7 +81,7 @@ interface VerificationService {
otherDeviceId: String): String
/**
- * Returns false if the request is unknown
+ * Returns false if the request is unknown.
*/
fun readyPendingVerificationInDMs(methods: List,
otherUserId: String,
@@ -89,7 +89,7 @@ interface VerificationService {
transactionId: String): Boolean
/**
- * Returns false if the request is unknown
+ * Returns false if the request is unknown.
*/
fun readyPendingVerification(methods: List,
otherUserId: String,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationTransaction.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationTransaction.kt
index 4d35bc44ac..b68a82c604 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationTransaction.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/verification/VerificationTransaction.kt
@@ -28,7 +28,7 @@ interface VerificationTransaction {
val isIncoming: Boolean
/**
- * User wants to cancel the transaction
+ * User wants to cancel the transaction.
*/
fun cancel()
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt
index 1ce51a2bde..16bdbd3432 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt
@@ -62,7 +62,7 @@ inline fun Content?.toModel(catchError: Boolean = true): T? {
}
/**
- * This methods is a facility method to map a model to a json Content
+ * This methods is a facility method to map a model to a json Content.
*/
@Suppress("UNCHECKED_CAST")
inline fun T.toContent(): Content {
@@ -123,7 +123,7 @@ data class Event(
var ageLocalTs: Long? = null
/**
- * Copy all fields, including transient fields
+ * Copy all fields, including transient fields.
*/
fun copyAll(): Event {
return copy().also {
@@ -227,14 +227,14 @@ data class Event(
}
/**
- * Determines whether or not current event has mentioned the user
+ * Determines whether or not current event has mentioned the user.
*/
fun isUserMentioned(userId: String): Boolean {
return getDecryptedValue("formatted_body")?.contains(userId) ?: false
}
/**
- * Decrypt the message, or return the pure payload value if there is no encryption
+ * Decrypt the message, or return the pure payload value if there is no encryption.
*/
private fun getDecryptedValue(key: String = "body"): String? {
return if (isEncrypted()) {
@@ -247,7 +247,7 @@ data class Event(
}
/**
- * Tells if the event is redacted
+ * Tells if the event is redacted.
*/
fun isRedacted() = unsignedData?.redactedEvent != null
@@ -305,7 +305,7 @@ data class Event(
/**
* Return the value of "content.msgtype", if the Event type is "m.room.message"
- * and if the content has it, and if it is a String
+ * and if the content has it, and if it is a String.
*/
fun Event.getMsgType(): String? {
if (getClearType() != EventType.MESSAGE) return null
@@ -386,13 +386,13 @@ fun Event.getRelationContent(): RelationDefaultContent? {
}
/**
- * Returns the poll question or null otherwise
+ * Returns the poll question or null otherwise.
*/
fun Event.getPollQuestion(): String? =
getPollContent()?.getBestPollCreationInfo()?.question?.getBestQuestion()
/**
- * Returns the relation content for a specific type or null otherwise
+ * Returns the relation content for a specific type or null otherwise.
*/
fun Event.getRelationContentForType(type: String): RelationDefaultContent? =
getRelationContent()?.takeIf { it.type == type }
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/RelationType.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/RelationType.kt
index 74dc74b294..3db9262c5b 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/RelationType.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/RelationType.kt
@@ -16,7 +16,7 @@
package org.matrix.android.sdk.api.session.events.model
/**
- * Constants defining known event relation types from Matrix specifications
+ * Constants defining known event relation types from Matrix specifications.
*/
object RelationType {
/** Lets you define an event which annotates an existing event.*/
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/EncryptedEventContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/EncryptedEventContent.kt
index 4f39bb61e1..b8388ea002 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/EncryptedEventContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/EncryptedEventContent.kt
@@ -20,37 +20,37 @@ import com.squareup.moshi.JsonClass
import org.matrix.android.sdk.api.session.room.model.relation.RelationDefaultContent
/**
- * Class representing an encrypted event content
+ * Class representing an encrypted event content.
*/
@JsonClass(generateAdapter = true)
data class EncryptedEventContent(
/**
- * the used algorithm
+ * The used algorithm.
*/
@Json(name = "algorithm")
val algorithm: String? = null,
/**
- * The encrypted event
+ * The encrypted event.
*/
@Json(name = "ciphertext")
val ciphertext: String? = null,
/**
- * The device id
+ * The device id.
*/
@Json(name = "device_id")
val deviceId: String? = null,
/**
- * the sender key
+ * The sender key.
*/
@Json(name = "sender_key")
val senderKey: String? = null,
/**
- * The session id
+ * The session id.
*/
@Json(name = "session_id")
val sessionId: String? = null,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/EncryptionEventContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/EncryptionEventContent.kt
index 103293ba83..321afd186d 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/EncryptionEventContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/EncryptionEventContent.kt
@@ -19,7 +19,7 @@ import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
/**
- * Class representing an encrypted event content
+ * Class representing an encrypted event content.
*/
@JsonClass(generateAdapter = true)
data class EncryptionEventContent(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/OlmEventContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/OlmEventContent.kt
index b972dd20bb..65e8128182 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/OlmEventContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/OlmEventContent.kt
@@ -19,7 +19,7 @@ import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
/**
- * Class representing an encrypted event content
+ * Class representing an encrypted event content.
*/
@JsonClass(generateAdapter = true)
data class OlmEventContent(
@@ -30,7 +30,7 @@ data class OlmEventContent(
val ciphertext: Map? = null,
/**
- * the sender key
+ * the sender key.
*/
@Json(name = "sender_key")
val senderKey: String? = null
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/OlmPayloadContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/OlmPayloadContent.kt
index 6060ab5c4b..c3d8a5a800 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/OlmPayloadContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/OlmPayloadContent.kt
@@ -20,36 +20,36 @@ import com.squareup.moshi.JsonClass
import org.matrix.android.sdk.internal.di.MoshiProvider
/**
- * Class representing the OLM payload content
+ * Class representing the OLM payload content.
*/
@JsonClass(generateAdapter = true)
data class OlmPayloadContent(
/**
- * The room id
+ * The room id.
*/
@Json(name = "room_id")
val roomId: String? = null,
/**
- * The sender
+ * The sender.
*/
@Json(name = "sender")
val sender: String? = null,
/**
- * The recipient
+ * The recipient.
*/
@Json(name = "recipient")
val recipient: String? = null,
/**
- * the recipient keys
+ * The recipient keys.
*/
@Json(name = "recipient_keys")
val recipientKeys: Map? = null,
/**
- * The keys
+ * The keys.
*/
@Json(name = "keys")
val keys: Map? = null
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/RoomKeyContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/RoomKeyContent.kt
index 43a47b818f..0830a566ab 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/RoomKeyContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/RoomKeyContent.kt
@@ -19,7 +19,7 @@ import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
/**
- * Class representing an sharekey content
+ * Class representing an sharekey content.
*/
@JsonClass(generateAdapter = true)
data class RoomKeyContent(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/RoomKeyWithHeldContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/RoomKeyWithHeldContent.kt
index 1eac1d6b2d..d58c3614a7 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/RoomKeyWithHeldContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/RoomKeyWithHeldContent.kt
@@ -19,7 +19,7 @@ import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
/**
- * Class representing an sharekey content
+ * Class representing an sharekey content.
*/
@JsonClass(generateAdapter = true)
data class RoomKeyWithHeldContent(
@@ -56,7 +56,7 @@ data class RoomKeyWithHeldContent(
/**
* the device ID of the device sending the m.room_key.withheld message
- * MSC3735
+ * MSC3735.
*/
@Json(name = "from_device") val fromDevice: String? = null
@@ -69,23 +69,23 @@ data class RoomKeyWithHeldContent(
enum class WithHeldCode(val value: String) {
/**
- * the user/device was blacklisted
+ * the user/device was blacklisted.
*/
BLACKLISTED("m.blacklisted"),
/**
- * the user/devices is unverified
+ * the user/devices is unverified.
*/
UNVERIFIED("m.unverified"),
/**
* the user/device is not allowed have the key. For example, this would usually be sent in response
- * to a key request if the user was not in the room when the message was sent
+ * to a key request if the user was not in the room when the message was sent.
*/
UNAUTHORISED("m.unauthorised"),
/**
- * Sent in reply to a key request if the device that the key is requested from does not have the requested key
+ * Sent in reply to a key request if the device that the key is requested from does not have the requested key.
*/
UNAVAILABLE("m.unavailable"),
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/SecretSendEventContent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/SecretSendEventContent.kt
index 5099aba403..be9d9d638c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/SecretSendEventContent.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/content/SecretSendEventContent.kt
@@ -19,7 +19,7 @@ import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
/**
- * Class representing an encrypted event content
+ * Class representing an encrypted event content.
*/
@JsonClass(generateAdapter = true)
data class SecretSendEventContent(
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/file/FileService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/file/FileService.kt
index 8e930f2a50..84a9990826 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/file/FileService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/file/FileService.kt
@@ -73,7 +73,7 @@ interface FileService {
/**
* Use this URI and pass it to intent using flag Intent.FLAG_GRANT_READ_URI_PERMISSION
- * (if not other app won't be able to access it)
+ * (if not other app won't be able to access it).
*/
fun getTemporarySharableURI(mxcUrl: String?,
fileName: String,
@@ -106,17 +106,17 @@ interface FileService {
)
/**
- * Clears all the files downloaded by the service, including decrypted files
+ * Clears all the files downloaded by the service, including decrypted files.
*/
fun clearCache()
/**
- * Clears all the decrypted files by the service
+ * Clears all the decrypted files by the service.
*/
fun clearDecryptedCache()
/**
- * Get size of cached files
+ * Get size of cached files.
*/
fun getCacheSize(): Long
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/file/MatrixSDKFileProvider.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/file/MatrixSDKFileProvider.kt
index ee1550d1db..113bf9333f 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/file/MatrixSDKFileProvider.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/file/MatrixSDKFileProvider.kt
@@ -21,7 +21,7 @@ import androidx.core.content.FileProvider
/**
* We have to declare our own file provider to avoid collision with apps using the sdk
- * and having their own
+ * and having their own.
*/
class MatrixSDKFileProvider : FileProvider() {
override fun getType(uri: Uri): String? {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/group/GroupService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/group/GroupService.kt
index a96466603c..1968af222a 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/group/GroupService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/group/GroupService.kt
@@ -23,16 +23,15 @@ import org.matrix.android.sdk.api.session.group.model.GroupSummary
* This interface defines methods to get groups. It's implemented at the session level.
*/
interface GroupService {
-
/**
- * Get a group from a groupId
+ * Get a group from a groupId.
* @param groupId the groupId to look for.
* @return the group with groupId or null
*/
fun getGroup(groupId: String): Group?
/**
- * Get a groupSummary from a groupId
+ * Get a groupSummary from a groupId.
* @param groupId the groupId to look for.
* @return the groupSummary with groupId or null
*/
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/group/GroupSummaryQueryParams.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/group/GroupSummaryQueryParams.kt
index 0761a22c77..5104b3ee53 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/group/GroupSummaryQueryParams.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/group/GroupSummaryQueryParams.kt
@@ -24,7 +24,7 @@ fun groupSummaryQueryParams(init: (GroupSummaryQueryParams.Builder.() -> Unit) =
}
/**
- * This class can be used to filter group summaries
+ * This class can be used to filter group summaries.
*/
data class GroupSummaryQueryParams(
val displayName: QueryStringValue,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilities.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilities.kt
index 597c1a0ca8..5b06fdacae 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilities.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilities.kt
@@ -34,25 +34,25 @@ data class HomeServerCapabilities(
*/
val canChange3pid: Boolean = true,
/**
- * Max size of file which can be uploaded to the homeserver in bytes. [MAX_UPLOAD_FILE_SIZE_UNKNOWN] if unknown or not retrieved yet
+ * Max size of file which can be uploaded to the homeserver in bytes. [MAX_UPLOAD_FILE_SIZE_UNKNOWN] if unknown or not retrieved yet.
*/
val maxUploadFileSize: Long = MAX_UPLOAD_FILE_SIZE_UNKNOWN,
/**
- * Last version identity server and binding supported
+ * Last version identity server and binding supported.
*/
val lastVersionIdentityServerSupported: Boolean = false,
/**
- * Default identity server url, provided in Wellknown
+ * Default identity server url, provided in Wellknown.
*/
val defaultIdentityServerUrl: String? = null,
/**
- * Room versions supported by the server
+ * Room versions supported by the server.
* This capability describes the default and available room versions a server supports, and at what level of stability.
* Clients should make use of this capability to determine if users need to be encouraged to upgrade their rooms.
*/
val roomVersions: RoomVersionCapabilities? = null,
/**
- * True if the home server support threading
+ * True if the home server support threading.
*/
val canUseThreading: Boolean = false
) {
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilitiesService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilitiesService.kt
index f12cbcd6db..9d2c48e194 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilitiesService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilitiesService.kt
@@ -22,12 +22,12 @@ package org.matrix.android.sdk.api.session.homeserver
interface HomeServerCapabilitiesService {
/**
- * Force a refresh of the stored data
+ * Force a refresh of the stored data.
*/
suspend fun refreshHomeServerCapabilities()
/**
- * Get the HomeServer capabilities
+ * Get the HomeServer capabilities.
*/
fun getHomeServerCapabilities(): HomeServerCapabilities
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/IdentityService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/IdentityService.kt
index fdcb30a5c8..c03b42e6c8 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/IdentityService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/IdentityService.kt
@@ -19,13 +19,13 @@ package org.matrix.android.sdk.api.session.identity
import org.matrix.android.sdk.api.session.identity.model.SignInvitationResult
/**
- * Provides access to the identity server configuration and services identity server can provide
+ * Provides access to the identity server configuration and services identity server can provide.
*/
interface IdentityService {
/**
* Return the default identity server of the user, which may have been provided at login time by the homeserver,
- * or by the Well-known setup of the homeserver
- * It may be different from the current configured identity server
+ * or by the Well-known setup of the homeserver.
+ * It may be different from the current configured identity server.
*/
fun getDefaultIdentityServer(): String?
@@ -35,9 +35,9 @@ interface IdentityService {
fun getCurrentIdentityServerUrl(): String?
/**
- * Check if the identity server is valid
- * See https://matrix.org/docs/spec/identity_service/latest#status-check
- * Matrix Android SDK2 only supports identity server API v2
+ * Check if the identity server is valid.
+ * See https://matrix.org/docs/spec/identity_service/latest#status-check.
+ * Matrix Android SDK2 only supports identity server API v2.
*/
suspend fun isValidIdentityServer(url: String)
@@ -52,12 +52,12 @@ interface IdentityService {
suspend fun setNewIdentityServer(url: String): String
/**
- * Disconnect (logout) from the current identity server
+ * Disconnect (logout) from the current identity server.
*/
suspend fun disconnect()
/**
- * This will ask the identity server to send an email or an SMS to let the user confirm he owns the ThreePid
+ * This will ask the identity server to send an email or an SMS to let the user confirm he owns the ThreePid.
*/
suspend fun startBindThreePid(threePid: ThreePid)
@@ -67,32 +67,32 @@ interface IdentityService {
suspend fun cancelBindThreePid(threePid: ThreePid)
/**
- * This will ask the identity server to send an new email or a new SMS to let the user confirm he owns the ThreePid
+ * This will ask the identity server to send an new email or a new SMS to let the user confirm he owns the ThreePid.
*/
suspend fun sendAgainValidationCode(threePid: ThreePid)
/**
- * Submit the code that the identity server has sent to the user (in email or SMS)
+ * Submit the code that the identity server has sent to the user (in email or SMS).
* Once successful, you will have to call [finalizeBindThreePid]
* @param code the code sent to the user
*/
suspend fun submitValidationToken(threePid: ThreePid, code: String)
/**
- * This will perform the actual association of ThreePid and Matrix account
+ * This will perform the actual association of ThreePid and Matrix account.
*/
suspend fun finalizeBindThreePid(threePid: ThreePid)
/**
- * Unbind a threePid
- * The request will actually be done on the homeserver
+ * Unbind a threePid.
+ * The request will actually be done on the homeserver.
*/
suspend fun unbindThreePid(threePid: ThreePid)
/**
- * Search MatrixId of users providing email and phone numbers
- * Note the the user consent has to be set to true, or it will throw a UserConsentNotProvided failure
- * Application has to explicitly ask for the user consent, and the answer can be stored using [setUserConsent]
+ * Search MatrixId of users providing email and phone numbers.
+ * Note the the user consent has to be set to true, or it will throw a UserConsentNotProvided failure.
+ * Application has to explicitly ask for the user consent, and the answer can be stored using [setUserConsent].
* Please see https://support.google.com/googleplay/android-developer/answer/9888076?hl=en for more details.
*/
suspend fun lookUp(threePids: List): List
@@ -115,8 +115,8 @@ interface IdentityService {
fun setUserConsent(newValue: Boolean)
/**
- * Get the status of the current user's threePid
- * A lookup will be performed, but also pending binding state will be restored
+ * Get the status of the current user's threePid.
+ * A lookup will be performed, but also pending binding state will be restored.
*
* @param threePids the list of threePid the user owns (retrieved form the homeserver)
* @return a map of ThreePid -> SharedState
@@ -126,7 +126,7 @@ interface IdentityService {
/**
* When one performs a 3pid invite and the third party identifier is unknown, the home server
* will store the invitation in the Identity server and store some information in the room state membership event.
- * The email invite will contains the token and secret that can be used to claim the stored invitation
+ * The email invite will contains the token and secret that can be used to claim the stored invitation.
*
* To aid clients who may not be able to perform crypto themselves,
* the identity server offers some crypto functionality to help in accepting invitations.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/model/SignInvitationResult.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/model/SignInvitationResult.kt
index b1662b9cf8..28d9d154f3 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/model/SignInvitationResult.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/model/SignInvitationResult.kt
@@ -33,7 +33,7 @@ data class SignInvitationResult(
*/
val signatures: Map,
/**
- * 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/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/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..b49b80df09 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,7 +57,7 @@ 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 forceMatrixTo whether we should force using matrix.to base URL
@@ -79,7 +79,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
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..095f2ef7c2 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,18 @@ 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)
/**
- * 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 +121,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/PushersService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushers/PushersService.kt
index f884d3e890..5f9857eb2f 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()
@@ -66,7 +66,7 @@ interface PushersService {
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.
*
@@ -81,30 +81,30 @@ interface PushersService {
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
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/PushRuleService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/pushrules/PushRuleService.kt
index abbdbf8104..bc4860be11 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,7 +33,7 @@ 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 enable Enables/Disables the rule
* @param actions Actions to update if not null
*/
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/room/Room.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/Room.kt
index 1f990f4c0a..3a18cf1497 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
@@ -49,18 +49,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 +70,97 @@ 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
}
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..cb70603e66 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,18 @@ 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
/**
- * 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..6d5551ddf0 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,7 +55,7 @@ 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.
@@ -84,14 +84,14 @@ 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
*/
@@ -112,14 +112,14 @@ interface RoomService {
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,7 +132,7 @@ interface RoomService {
suspend fun onRoomDisplayed(roomId: String)
/**
- * Mark all rooms as read
+ * Mark all rooms as read.
*/
suspend fun markAllAsRead(roomIds: List)
@@ -143,7 +143,7 @@ interface RoomService {
searchOnServer: Boolean): Optional
/**
- * Delete a room alias
+ * Delete a room alias.
*/
suspend fun deleteRoomAlias(roomAlias: String)
@@ -162,7 +162,7 @@ interface RoomService {
fun getChangeMembershipsLive(): LiveData