Skip to content

Commit 324856d

Browse files
Merge branch 'develop' into feature/aris/threads_post_release_ui_improvements
# Conflicts: # vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt
2 parents 72a945a + 3674ae7 commit 324856d

File tree

811 files changed

+2994
-2195
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

811 files changed

+2994
-2195
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ jobs:
6767
path: |
6868
vector/build/outputs/apk/*/release/*.apk
6969
70-
# TODO: add exodus checks
70+
# TODO add exodus checks

.github/workflows/post-pr.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -325,5 +325,5 @@ jobs:
325325
with:
326326
github_token: ${{ secrets.GITHUB_TOKEN }}
327327
hookshot_url: ${{ secrets.ELEMENT_ANDROID_HOOKSHOT_URL }}
328-
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}}"
329-
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 }}<br />{{icon conclusion}} {{name}} <font color='{{color conclusion}}'>{{conclusion}} at {{completed_at}} <a href=\"{{html_url}}\">[details]</a></font>{{/if}}{{/with}}{{/each}}"
328+
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}}"
329+
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 }}<br />{{icon conclusion}} {{name}} <font color='{{color conclusion}}'>{{conclusion}} at {{completed_at}} <a href=\"{{html_url}}\">[details]</a></font>{{/if}}{{/with}}{{/each}}"

.github/workflows/quality.yml

+30
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ jobs:
1414
- name: Run code quality check suite
1515
run: ./tools/check/check_code_quality.sh
1616

17+
# Knit for all the modules (https://github.com/Kotlin/kotlinx-knit)
18+
knit:
19+
name: Knit
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Run knit
24+
run: |
25+
./gradlew knit
26+
1727
# ktlint for all the modules
1828
ktlint:
1929
name: Kotlin Linter
@@ -147,3 +157,23 @@ jobs:
147157
name: release-lint-report-${{ matrix.target }}
148158
path: |
149159
vector/build/reports/*.*
160+
161+
detekt:
162+
name: Detekt Analysis
163+
runs-on: ubuntu-latest
164+
# Allow all jobs on main and develop. Just one per PR.
165+
concurrency:
166+
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) }}
167+
cancel-in-progress: true
168+
steps:
169+
- uses: actions/checkout@v3
170+
- name: Run detekt
171+
run: |
172+
./gradlew detekt
173+
- name: Upload reports
174+
if: always()
175+
uses: actions/upload-artifact@v3
176+
with:
177+
name: detekt-report
178+
path: |
179+
*/build/reports/detekt/detekt.html

build.gradle

+15-2
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@ buildscript {
3030
classpath "com.likethesalad.android:stem-plugin:2.0.0"
3131
classpath 'org.owasp:dependency-check-gradle:7.1.0.1'
3232
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.6.21"
33+
classpath "org.jetbrains.kotlinx:kotlinx-knit:0.4.0"
3334
// NOTE: Do not place your application dependencies here; they belong
3435
// in the individual module build.gradle files
3536
}
3637
}
3738

38-
// ktlint Plugin
3939
plugins {
40+
// ktlint Plugin
4041
id "org.jlleitschuh.gradle.ktlint" version "10.3.0"
42+
// Detekt
43+
id "io.gitlab.arturbosch.detekt" version "1.20.0"
4144
}
4245

4346
// https://github.com/jeremylong/DependencyCheck
@@ -52,6 +55,7 @@ dependencyCheck {
5255

5356
allprojects {
5457
apply plugin: "org.jlleitschuh.gradle.ktlint"
58+
apply plugin: "io.gitlab.arturbosch.detekt"
5559

5660
repositories {
5761
// Do not use `mavenCentral()`, it prevents Dependabot from working properly
@@ -119,7 +123,7 @@ allprojects {
119123
// display the corresponding rule
120124
verbose = true
121125
disabledRules = [
122-
// TODO: Re-enable these 4 rules after reformatting project
126+
// TODO Re-enable these 4 rules after reformatting project
123127
"indent",
124128
"experimental:argument-list-wrapping",
125129
"max-line-length",
@@ -140,6 +144,15 @@ allprojects {
140144
"experimental:kdoc-wrapping",
141145
]
142146
}
147+
148+
detekt {
149+
// preconfigure defaults
150+
buildUponDefaultConfig = true
151+
// activate all available (even unstable) rules.
152+
allRules = true
153+
// point to your custom config defining rules to run, overwriting default behavior
154+
config = files("$rootDir/tools/detekt/detekt.yml")
155+
}
143156
}
144157

145158
task clean(type: Delete) {

changelog.d/5887.sdk

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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()`

changelog.d/5906.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Desynchronized 4S | Megolm backup causing Unusable backup

changelog.d/5932.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Allow using the latest user Avatar and name for all messages in the timeline

changelog.d/5973.doc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Note public_baseurl requirement in integration tests documentation.

changelog.d/6038.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Setup detekt

changelog.d/6047.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add presence indicator busy and away.

dependencies.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ext.versions = [
1010
def gradle = "7.2.0"
1111
// Ref: https://kotlinlang.org/releases.html
1212
def kotlin = "1.6.21"
13-
def kotlinCoroutines = "1.6.0"
13+
def kotlinCoroutines = "1.6.1"
1414
def dagger = "2.42"
1515
def retrofit = "2.9.0"
1616
def arrow = "0.8.2"

dependencies_groups.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ ext.groups = [
123123
'io.github.detekt.sarif4k',
124124
'io.github.microutils',
125125
'io.github.reactivecircus.flowbinding',
126+
'io.gitlab.arturbosch.detekt',
126127
'io.grpc',
127128
'io.jsonwebtoken',
128129
'io.kindedj',
@@ -195,6 +196,7 @@ ext.groups = [
195196
'org.testng',
196197
'org.threeten',
197198
'org.webjars',
199+
'org.yaml',
198200
'ru.noties',
199201
'xerces',
200202
'xml-apis',

docs/add_threePids.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ Wording: "We've sent you an email to verify your address. Please follow the inst
3737
}
3838
```
3939

40-
## User receive an e-mail
40+
## User receives an e-mail
4141

42-
> [homeserver.org] Validate your email
42+
> `homeserver.org` Validate your email
4343
>
4444
> 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:
4545
https://homeserver.org/_matrix/client/unstable/add_threepid/email/submit_token?token=WUnEhQAmJrXupdEbXgdWvnVIKaGYZFsU&client_secret=TixzvOnw7nLEUdiQEmkHzkXKrY4HhiGh&sid=bxyDHuJKsdkjMlTJ

docs/integration_tests.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,17 @@ virtualenv -p python3 env
4343
source env/bin/activate
4444
pip install -e .
4545
demo/start.sh --no-rate-limit
46+
4647
```
4748

48-
Alternatively, to install the latest Synapse release package (and not a cloned branch) you can run the following instead of `pip install -e .`:
49+
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 .`:
4950

5051
```bash
5152
pip install matrix-synapse
5253
```
5354

55+
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.
56+
5457
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.
5558

5659
## Run the test
@@ -87,6 +90,18 @@ You'll need python3 to be able to run synapse
8790

8891
Try on the Emulator browser to open "http://10.0.2.2:8080". You should see the "Synapse is running" message.
8992

93+
### Tests partially run but some fail with "Unable to contact localhost:8080"
94+
95+
This is because the `public_baseurl` of synapse is not consistent with the endpoint that the tests are connecting to.
96+
97+
Ensure you have the following configuration in `demo/etc/8080.config`.
98+
99+
```
100+
public_baseurl: http://10.0.2.2:8080/
101+
```
102+
103+
After changing this you will need to restart synapse using `demo/stop.sh` and `demo/start.sh` to load the new configuration.
104+
90105
### virtualenv command fails
91106

92107
You can try using

docs/pull_request.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ In any case, it is better to explicitly declare in the description why the PR is
3030

3131
Also, draft PR should not stay indefinitely in this state. It may be removed if it is the case and the submitter does not update it after a few days.
3232

33+
##### Base branch
34+
35+
The `develop` branch is generally the base branch for every PRs.
36+
37+
Exceptions can occur:
38+
39+
- if a feature implementation is split into multiple PRs. We can have a chain of PRs in this case. PR can be merged one by one on develop, and GitHub change the target branch to `develop` for the next PR automatically.
40+
- we want to merge a PR from the community, but there is still work to do, and the PR is not updated by the submitter. First, we can kindly ask the submitter if they will update their PR, by commenting it. If there is no answer after a few days (including a week-end), we can create a new branch, push it, and change the target branch of the PR to this new branch. The PR can then be merged, and we can add more commits to fix the issues. After that a new PR can be created with `develop` as a target branch.
41+
42+
**Important notice 1:** Releases are created from the `develop` branch. So `develop` branch should always contain a "releasable" source code. So when a feature is being implemented with several PRs, it has to be disabled by default (using a feature flag for instance), until the feature is fully implemented. A last PR to enable the feature can then be created.
43+
44+
**Important notice 2:** Database migration: some developers and some people from the community are using the nightly build from `develop`. Multiple database migrations should be properly handled for them. This is OK to have multiple migrations between 2 releases, this is not OK to add steps to the pending database migration on `develop`. So for instance `develop` users will migrate from version 11 to version 12, then 13, then 14, and `main` users will do all those steps after they get the app upgrade.
45+
3346
##### PR Review Assignment
3447

3548
We use automatic assignment for PR reviews. A PR is automatically routed by GitHub to 2 team members using the round robin algorithm. The process is the following:
@@ -103,7 +116,7 @@ Review such PR is the same recipe than for PR from Dependabot
103116
##### Sync analytics plan
104117

105118
This tools imports any update in the analytics plan. See instruction in the PR itself to handle it.
106-
More info can be found in the file [analytics.md]
119+
More info can be found in the file [analytics.md](./analytics.md)
107120

108121
## Reviewing PR
109122

@@ -234,4 +247,4 @@ Also "Resolve conversation" should probably be hit by the creator of the convers
234247

235248
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.
236249

237-
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.
250+
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.

library/core-utils/src/main/java/im/vector/lib/core/utils/epoxy/charsequence/EpoxyCharSequence.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
package im.vector.lib.core.utils.epoxy.charsequence
1818

1919
/**
20-
* Wrapper for a CharSequence, which support mutation of the CharSequence, which can happen during rendering
20+
* Wrapper for a CharSequence, which support mutation of the CharSequence, which can happen during rendering.
2121
*/
2222
class EpoxyCharSequence(val charSequence: CharSequence) {
2323
private val hash = charSequence.toString().hashCode()

library/core-utils/src/main/java/im/vector/lib/core/utils/epoxy/charsequence/Extensions.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
package im.vector.lib.core.utils.epoxy.charsequence
1818

1919
/**
20-
* Extensions to wrap CharSequence to EpoxyCharSequence
20+
* Extensions to wrap CharSequence to EpoxyCharSequence.
2121
*/
2222
fun CharSequence.toEpoxyCharSequence() = EpoxyCharSequence(this)

library/multipicker/src/main/java/im/vector/lib/multipicker/AudioPicker.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import im.vector.lib.multipicker.entity.MultiPickerAudioType
2222
import im.vector.lib.multipicker.utils.toMultiPickerAudioType
2323

2424
/**
25-
* Audio file picker implementation
25+
* Audio file picker implementation.
2626
*/
2727
class AudioPicker : Picker<MultiPickerAudioType>() {
2828

library/multipicker/src/main/java/im/vector/lib/multipicker/CameraPicker.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ import im.vector.lib.multipicker.utils.createTemporaryMediaFile
2828
import im.vector.lib.multipicker.utils.toMultiPickerImageType
2929

3030
/**
31-
* Implementation of taking a photo with Camera
31+
* Implementation of taking a photo with Camera.
3232
*/
3333
class CameraPicker {
3434

3535
/**
36-
* Start camera by using a ActivityResultLauncher
36+
* Start camera by using a ActivityResultLauncher.
3737
* @return Uri of taken photo or null if the operation is cancelled.
3838
*/
3939
fun startWithExpectingFile(context: Context, activityResultLauncher: ActivityResultLauncher<Intent>): Uri {

library/multipicker/src/main/java/im/vector/lib/multipicker/CameraVideoPicker.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ import im.vector.lib.multipicker.utils.createTemporaryMediaFile
2828
import im.vector.lib.multipicker.utils.toMultiPickerVideoType
2929

3030
/**
31-
* Implementation of taking a video with Camera
31+
* Implementation of taking a video with Camera.
3232
*/
3333
class CameraVideoPicker {
3434

3535
/**
36-
* Start camera by using a ActivityResultLauncher
36+
* Start camera by using a ActivityResultLauncher.
3737
* @return Uri of taken photo or null if the operation is cancelled.
3838
*/
3939
fun startWithExpectingFile(context: Context, activityResultLauncher: ActivityResultLauncher<Intent>): Uri {

library/multipicker/src/main/java/im/vector/lib/multipicker/ContactPicker.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import im.vector.lib.multipicker.entity.MultiPickerContactType
2626
import im.vector.lib.multipicker.utils.getColumnIndexOrNull
2727

2828
/**
29-
* Contact Picker implementation
29+
* Contact Picker implementation.
3030
*/
3131
class ContactPicker : Picker<MultiPickerContactType>() {
3232

library/multipicker/src/main/java/im/vector/lib/multipicker/FilePicker.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import im.vector.lib.multipicker.utils.toMultiPickerImageType
3232
import im.vector.lib.multipicker.utils.toMultiPickerVideoType
3333

3434
/**
35-
* Implementation of selecting any type of files
35+
* Implementation of selecting any type of files.
3636
*/
3737
class FilePicker : Picker<MultiPickerBaseType>() {
3838

library/multipicker/src/main/java/im/vector/lib/multipicker/ImagePicker.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import im.vector.lib.multipicker.entity.MultiPickerImageType
2222
import im.vector.lib.multipicker.utils.toMultiPickerImageType
2323

2424
/**
25-
* Image Picker implementation
25+
* Image Picker implementation.
2626
*/
2727
class ImagePicker : Picker<MultiPickerImageType>() {
2828

library/multipicker/src/main/java/im/vector/lib/multipicker/MediaPicker.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import im.vector.lib.multipicker.utils.toMultiPickerImageType
2424
import im.vector.lib.multipicker.utils.toMultiPickerVideoType
2525

2626
/**
27-
* Image/Video Picker implementation
27+
* Image/Video Picker implementation.
2828
*/
2929
class MediaPicker : Picker<MultiPickerBaseMediaType>() {
3030

library/multipicker/src/main/java/im/vector/lib/multipicker/MultiPicker.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package im.vector.lib.multipicker
1818

19-
class MultiPicker<T> {
19+
class MultiPicker<T> private constructor() {
2020

2121
companion object Type {
2222
val IMAGE by lazy { MultiPicker<ImagePicker>() }

library/multipicker/src/main/java/im/vector/lib/multipicker/Picker.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import android.net.Uri
2424
import androidx.activity.result.ActivityResultLauncher
2525

2626
/**
27-
* Abstract class to provide all types of Pickers
27+
* Abstract class to provide all types of Pickers.
2828
*/
2929
abstract class Picker<T> {
3030

library/multipicker/src/main/java/im/vector/lib/multipicker/VideoPicker.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import im.vector.lib.multipicker.entity.MultiPickerVideoType
2222
import im.vector.lib.multipicker.utils.toMultiPickerVideoType
2323

2424
/**
25-
* Video Picker implementation
25+
* Video Picker implementation.
2626
*/
2727
class VideoPicker : Picker<MultiPickerVideoType>() {
2828

library/ui-styles/src/main/res/values/colors.xml

+8
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@
126126
<color name="vctr_presence_indicator_online_light">@color/palette_element_green</color>
127127
<color name="vctr_presence_indicator_online_dark">@color/palette_element_green</color>
128128

129+
<attr name="vctr_presence_indicator_busy" format="color" />
130+
<color name="vctr_presence_indicator_busy_light">@color/element_alert_light</color>
131+
<color name="vctr_presence_indicator_busy_dark">@color/element_alert_dark</color>
132+
133+
<attr name="vctr_presence_indicator_away" format="color" />
134+
<color name="vctr_presence_indicator_away_light">@color/palette_element_orange</color>
135+
<color name="vctr_presence_indicator_away_dark">@color/palette_element_orange</color>
136+
129137
<!-- Location sharing colors -->
130138
<attr name="vctr_live_location" format="color" />
131139
<color name="vctr_live_location_light">@color/palette_prune</color>

library/ui-styles/src/main/res/values/palette.xml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<color name="palette_melon">#FF812D</color>
1818

1919
<color name="palette_element_green">#0DBD8B</color>
20+
<color name="palette_element_orange">#D9B072</color>
2021
<color name="palette_white">#FFFFFF</color>
2122
<color name="palette_vermilion">#FF5B55</color>
2223
<!-- (unused) -->

library/ui-styles/src/main/res/values/theme_dark.xml

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
<!-- Presence Indicator colors -->
4646
<item name="vctr_presence_indicator_offline">@color/vctr_presence_indicator_offline_dark</item>
4747
<item name="vctr_presence_indicator_online">@color/vctr_presence_indicator_online_dark</item>
48+
<item name="vctr_presence_indicator_busy">@color/vctr_presence_indicator_busy_dark</item>
49+
<item name="vctr_presence_indicator_away">@color/vctr_presence_indicator_away_dark</item>
4850

4951
<!-- Some aliases -->
5052
<item name="vctr_header_background">?vctr_system</item>

library/ui-styles/src/main/res/values/theme_light.xml

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
<!-- Presence Indicator colors -->
4646
<item name="vctr_presence_indicator_offline">@color/vctr_presence_indicator_offline_light</item>
4747
<item name="vctr_presence_indicator_online">@color/vctr_presence_indicator_online_light</item>
48+
<item name="vctr_presence_indicator_busy">@color/vctr_presence_indicator_busy_light</item>
49+
<item name="vctr_presence_indicator_away">@color/vctr_presence_indicator_away_light</item>
4850

4951
<!-- Some aliases -->
5052
<item name="vctr_header_background">?vctr_system</item>

matrix-sdk-android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dokkaHtml {
2121
dokkaSourceSets {
2222
configureEach {
2323
// Emit warnings about not documented members.
24-
reportUndocumented.set(true)
24+
// reportUndocumented.set(true)
2525
// Suppress legacy Riot's packages.
2626
perPackageOption {
2727
matchingRegex.set("org.matrix.android.sdk.internal.legacy.riot")

0 commit comments

Comments
 (0)