Skip to content

Commit 87e599b

Browse files
committed
Merge branch 'release/1.5.22' into main
2 parents 1d786ea + e271c73 commit 87e599b

File tree

60 files changed

+1002
-214
lines changed

Some content is hidden

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

60 files changed

+1002
-214
lines changed

‎CHANGES.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
Please also refer to the Changelog of Element Android: https://github.com/vector-im/element-android/blob/main/CHANGES.md
22

3+
Changes in Matrix-SDK v1.5.22 (2023-01-30)
4+
=========================================
5+
6+
Imported from Element 1.5.22. (https://github.com/vector-im/element-android/releases/tag/v1.5.22)
7+
8+
SDK API changes ⚠️
9+
------------------
10+
- Implement [MSC3912](https://github.com/matrix-org/matrix-spec-proposals/pull/3912): Relation-based redactions ([#7988](https://github.com/vector-im/element-android/issues/7988))
11+
312
Changes in Matrix-SDK v1.5.20 (2023-01-23)
413
=========================================
514

‎dependencies.gradle‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ ext.versions = [
88

99
def gradle = "7.3.1"
1010
// Ref: https://kotlinlang.org/releases.html
11-
def kotlin = "1.7.22"
11+
def kotlin = "1.8.0"
1212
def kotlinCoroutines = "1.6.4"
1313
def dagger = "2.44.2"
14-
def firebaseBom = "31.1.1"
14+
def firebaseBom = "31.2.0"
1515
def appDistribution = "16.0.0-beta05"
1616
def retrofit = "2.9.0"
1717
def markwon = "4.6.2"
1818
def moshi = "1.14.0"
1919
def lifecycle = "2.5.1"
2020
def flowBinding = "1.2.0"
21-
def flipper = "0.176.0"
21+
def flipper = "0.177.0"
2222
def epoxy = "5.0.0"
2323
def mavericks = "3.0.1"
2424
def glide = "4.14.2"
@@ -27,12 +27,13 @@ def jjwt = "0.11.5"
2727
// Temporary version to unblock #6929. Once 0.16.0 is released we should use it, and revert
2828
// the whole commit which set version 0.16.0-SNAPSHOT
2929
def vanniktechEmoji = "0.16.0-SNAPSHOT"
30-
def sentry = "6.9.2"
31-
def fragment = "1.5.5"
30+
def sentry = "6.12.1"
31+
// Use 1.6.0 alpha to fix issue with test
32+
def fragment = "1.6.0-alpha04"
3233
// Testing
3334
def mockk = "1.12.3" // We need to use 1.12.3 to have mocking in androidTest until a new version is released: https://github.com/mockk/mockk/issues/819
34-
def espresso = "3.4.0"
35-
def androidxTest = "1.4.0"
35+
def espresso = "3.5.1"
36+
def androidxTest = "1.5.0"
3637
def androidxOrchestrator = "1.4.2"
3738
def paparazzi = "1.1.0"
3839

@@ -49,18 +50,19 @@ ext.libs = [
4950
],
5051
androidx : [
5152
'activity' : "androidx.activity:activity-ktx:1.6.1",
52-
'appCompat' : "androidx.appcompat:appcompat:1.5.1",
53+
'appCompat' : "androidx.appcompat:appcompat:1.6.0",
5354
'biometric' : "androidx.biometric:biometric:1.1.0",
5455
'core' : "androidx.core:core-ktx:1.9.0",
5556
'recyclerview' : "androidx.recyclerview:recyclerview:1.2.1",
5657
'exifinterface' : "androidx.exifinterface:exifinterface:1.3.5",
5758
'fragmentKtx' : "androidx.fragment:fragment-ktx:$fragment",
5859
'fragmentTesting' : "androidx.fragment:fragment-testing:$fragment",
60+
'fragmentTestingManifest' : "androidx.fragment:fragment-testing-manifest:$fragment",
5961
'constraintLayout' : "androidx.constraintlayout:constraintlayout:2.1.4",
6062
'work' : "androidx.work:work-runtime-ktx:2.7.1",
6163
'autoFill' : "androidx.autofill:autofill:1.1.0",
6264
'preferenceKtx' : "androidx.preference:preference-ktx:1.2.0",
63-
'junit' : "androidx.test.ext:junit:1.1.3",
65+
'junit' : "androidx.test.ext:junit:1.1.5",
6466
'lifecycleCommon' : "androidx.lifecycle:lifecycle-common:$lifecycle",
6567
'lifecycleLivedata' : "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle",
6668
'lifecycleProcess' : "androidx.lifecycle:lifecycle-process:$lifecycle",
@@ -86,7 +88,7 @@ ext.libs = [
8688
'appdistributionApi' : "com.google.firebase:firebase-appdistribution-api-ktx:$appDistribution",
8789
'appdistribution' : "com.google.firebase:firebase-appdistribution:$appDistribution",
8890
// Phone number https://github.com/google/libphonenumber
89-
'phonenumber' : "com.googlecode.libphonenumber:libphonenumber:8.13.4"
91+
'phonenumber' : "com.googlecode.libphonenumber:libphonenumber:8.13.5"
9092
],
9193
dagger : [
9294
'dagger' : "com.google.dagger:dagger:$dagger",
@@ -101,7 +103,7 @@ ext.libs = [
101103
],
102104
element : [
103105
'opusencoder' : "io.element.android:opusencoder:1.1.0",
104-
'wysiwyg' : "io.element.android:wysiwyg:0.14.0"
106+
'wysiwyg' : "io.element.android:wysiwyg:0.18.0"
105107
],
106108
squareup : [
107109
'moshi' : "com.squareup.moshi:moshi:$moshi",

‎gradle.properties‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ vector.httpLogLevel=NONE
2626
# Ref: https://github.com/vanniktech/gradle-maven-publish-plugin
2727
GROUP=org.matrix.android
2828
POM_ARTIFACT_ID=matrix-android-sdk2
29-
VERSION_NAME=1.5.20
29+
VERSION_NAME=1.5.22
3030

3131
POM_PACKAGING=aar
3232

‎matrix-sdk-android/build.gradle‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ apply plugin: 'kotlin-kapt'
44
apply plugin: 'kotlin-parcelize'
55
apply plugin: 'realm-android'
66
apply plugin: "org.jetbrains.dokka"
7-
// WARNING: always restore this line after importing code from Element Android (1/2)
8-
apply plugin: "com.vanniktech.maven.publish"
97

108
if (project.hasProperty("coverage")) {
119
apply plugin: 'jacoco'
@@ -64,8 +62,7 @@ android {
6462
// that the app's state is completely cleared between tests.
6563
testInstrumentationRunnerArguments clearPackageData: 'true'
6664

67-
// WARNING: always restore this line after importing code from Element Android (2/2)
68-
buildConfigField "String", "SDK_VERSION", "\"${project.getProperties().getOrDefault("VERSION_NAME", "0.0.0")}\""
65+
buildConfigField "String", "SDK_VERSION", "\"1.5.22\""
6966

7067
buildConfigField "String", "GIT_SDK_REVISION", "\"${gitRevision()}\""
7168
buildConfigField "String", "GIT_SDK_REVISION_UNIX_DATE", "\"${gitRevisionUnixDate()}\""
@@ -84,7 +81,7 @@ android {
8481
buildTypes {
8582
debug {
8683
if (project.hasProperty("coverage")) {
87-
testCoverageEnabled = coverage.enableTestCoverage
84+
testCoverageEnabled = coverage == "true"
8885
}
8986
// Set to true to log privacy or sensible data, such as token
9087
buildConfigField "boolean", "LOG_PRIVATE_DATA", project.property("vector.debugPrivateData")

‎matrix-sdk-android/src/androidTest/AndroidManifest.xml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools"
3-
package="org.matrix.android.sdk">
2+
xmlns:tools="http://schemas.android.com/tools">
43

54
<application>
65

‎matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/extensions/MetricsExtensions.kt‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,27 @@ inline fun List<MetricPlugin>.measureMetric(block: () -> Unit) {
4343
}
4444
}
4545

46+
/**
47+
* Executes the given [block] while measuring the transaction.
48+
*
49+
* @param block Action/Task to be executed within this span.
50+
*/
51+
@OptIn(ExperimentalContracts::class)
52+
inline fun List<SpannableMetricPlugin>.measureSpannableMetric(block: List<SpannableMetricPlugin>.() -> Unit) {
53+
contract {
54+
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
55+
}
56+
try {
57+
this.forEach { plugin -> plugin.startTransaction() } // Start the transaction.
58+
block()
59+
} catch (throwable: Throwable) {
60+
this.forEach { plugin -> plugin.onError(throwable) } // Capture if there is any exception thrown.
61+
throw throwable
62+
} finally {
63+
this.forEach { plugin -> plugin.finishTransaction() } // Finally, finish this transaction.
64+
}
65+
}
66+
4667
/**
4768
* Executes the given [block] while measuring a span.
4869
*

‎matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/metrics/SyncDurationMetricPlugin.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ interface SyncDurationMetricPlugin : SpannableMetricPlugin {
2929
override fun logTransaction(message: String?) {
3030
Timber.tag(loggerTag.value).v("## syncResponseHandler() : $message")
3131
}
32+
33+
fun shouldReport(isInitialSync: Boolean, isAfterPause: Boolean): Boolean = true
3234
}

‎matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/Event.kt‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ data class Event(
248248
if (isRedacted()) return "Message removed"
249249
val text = getDecryptedValue() ?: run {
250250
if (isPoll()) {
251-
return getPollQuestion() ?: "created a poll."
251+
return getTextSummaryForPoll()
252252
}
253253
return null
254254
}
@@ -261,13 +261,23 @@ data class Event(
261261
isImageMessage() -> "sent an image."
262262
isVideoMessage() -> "sent a video."
263263
isSticker() -> "sent a sticker."
264-
isPoll() -> getPollQuestion() ?: "created a poll."
264+
isPoll() -> getTextSummaryForPoll()
265265
isLiveLocation() -> "Live location."
266266
isLocationMessage() -> "has shared their location."
267267
else -> text
268268
}
269269
}
270270

271+
private fun getTextSummaryForPoll(): String? {
272+
val pollQuestion = getPollQuestion()
273+
return when {
274+
pollQuestion != null -> pollQuestion
275+
isPollStart() -> "created a poll."
276+
isPollEnd() -> "ended a poll."
277+
else -> null
278+
}
279+
}
280+
271281
private fun Event.isQuote(): Boolean {
272282
if (isReplyRenderedInThread()) return false
273283
return getDecryptedValue("formatted_body")?.contains("<blockquote>") ?: false

‎matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/homeserver/HomeServerCapabilities.kt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ data class HomeServerCapabilities(
7575
* True if the home server supports remote toggle of Pusher for a given device.
7676
*/
7777
val canRemotelyTogglePushNotificationsOfDevices: Boolean = false,
78+
79+
/**
80+
* True if the home server supports event redaction with relations.
81+
*/
82+
var canRedactEventWithRelations: Boolean = false,
7883
) {
7984

8085
enum class RoomCapabilitySupport {

‎matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/PollResponseAggregatedSummary.kt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ data class PollResponseAggregatedSummary(
2323
val nbOptions: Int = 0,
2424
// The list of the eventIDs used to build the summary (might be out of sync if chunked received from message chunk)
2525
val sourceEvents: List<String>,
26-
val localEchos: List<String>
26+
val localEchos: List<String>,
27+
// list of related event ids which are encrypted due to decryption failure
28+
val encryptedRelatedEventIds: List<String>,
2729
)

0 commit comments

Comments
 (0)