forked from matrix-org/matrix-android-sdk2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/develop' into gk-changes
# Conflicts: # README.md # matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/content/ContentAttachmentData.kt # matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/model/message/MessageAudioContent.kt # matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/state/DefaultStateService.kt
- Loading branch information
Showing
250 changed files
with
4,052 additions
and
1,176 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,29 @@ vector.httpLogLevel=NONE | |
# Note: to debug, you can put and uncomment the following lines in the file ~/.gradle/gradle.properties to override the value above | ||
#vector.debugPrivateData=true | ||
#vector.httpLogLevel=BODY | ||
|
||
# Maven publication | ||
# Ref: https://github.com/vanniktech/gradle-maven-publish-plugin | ||
GROUP=org.matrix.android | ||
POM_ARTIFACT_ID=matrix-android-sdk2 | ||
VERSION_NAME=1.2.2 | ||
|
||
POM_PACKAGING=aar | ||
|
||
POM_NAME=Matrix Android SDK 2 | ||
POM_DESCRIPTION=An Android SDK to connect to a Matrix homeserver. | ||
POM_INCEPTION_YEAR=2021 | ||
POM_URL=https://github.com/matrix-org/matrix-android-sdk2 | ||
|
||
POM_LICENSE_NAME=The Apache Software License, Version 2.0 | ||
POM_LICENCE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt | ||
POM_LICENCE_DIST=repo | ||
|
||
POM_SCM_URL=https://github.com/matrix-org/matrix-android-sdk2 | ||
POM_SCM_CONNECTION=scm:git:git://github.com/matrix-org/matrix-android-sdk2.git | ||
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/matrix-org/matrix-android-sdk2.git | ||
|
||
POM_DEVELOPER_ID=matrixdev | ||
POM_DEVELOPER_NAME=matrixdev | ||
POM_DEVELOPER_URL=https://github.com/matrix-org/ | ||
POM_DEVELOPER_EMAIL=[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionSha256Sum=13bf8d3cf8eeeb5770d19741a59bde9bd966dd78d17f1bbad787a05ef19d1c2d | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip | ||
distributionSha256Sum=9bb8bc05f562f2d42bdf1ba8db62f6b6fa1c3bf6c392228802cc7cb0578fe7e0 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="org.matrix.android.sdk"> | ||
|
||
<application> | ||
|
||
<!-- | ||
This is mandatory to run integration tests | ||
--> | ||
<provider | ||
android:name="androidx.work.impl.WorkManagerInitializer" | ||
android:authorities="${applicationId}.workmanager-init" | ||
android:exported="false" | ||
tools:node="remove" /> | ||
|
||
</application> | ||
|
||
</manifest> |
60 changes: 60 additions & 0 deletions
60
matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/PermalinkParserTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2021 The Matrix.org Foundation C.I.C. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.matrix.android.sdk | ||
|
||
import org.junit.Assert | ||
import org.junit.FixMethodOrder | ||
import org.junit.Test | ||
import org.junit.runners.MethodSorters | ||
import org.matrix.android.sdk.api.session.permalinks.PermalinkData | ||
import org.matrix.android.sdk.api.session.permalinks.PermalinkParser | ||
|
||
@FixMethodOrder(MethodSorters.JVM) | ||
class PermalinkParserTest { | ||
|
||
@Test | ||
fun testParseEmailInvite() { | ||
val rawInvite = """ | ||
https://app.element.io/#/room/%21MRBNLPtFnMAazZVPMO%3Amatrix.org?email=bob%2Bspace%40example.com&signurl=https%3A%2F%2Fvector.im%2F_matrix%2Fidentity%2Fapi%2Fv1%2Fsign-ed25519%3Ftoken%3DXmOwRZnSFabCRhTywFbJWKXWVNPysOpXIbroMGaUymqkJSvHeVKRsjHajwjCYdBsvGSvHauxbKfJmOxtXldtyLnyBMLKpBQCMzyYggrdapbVIceWZBtmslOQrXLABRoe%26private_key%3DT2gq0c3kJB_8OroXVxl1pBnzHsN7V6Xn4bEBSeW1ep4&room_name=Team2&room_avatar_url=&inviter_name=hiphop5&guest_access_token=&guest_user_id= | ||
""".trimIndent() | ||
.replace("https://app.element.io/#/room/", "https://matrix.to/#/") | ||
|
||
val parsedLink = PermalinkParser.parse(rawInvite) | ||
Assert.assertTrue("Should be parsed as email invite but was ${parsedLink::class.java}", parsedLink is PermalinkData.RoomEmailInviteLink) | ||
parsedLink as PermalinkData.RoomEmailInviteLink | ||
Assert.assertEquals("!MRBNLPtFnMAazZVPMO:matrix.org", parsedLink.roomId) | ||
Assert.assertEquals("XmOwRZnSFabCRhTywFbJWKXWVNPysOpXIbroMGaUymqkJSvHeVKRsjHajwjCYdBsvGSvHauxbKfJmOxtXldtyLnyBMLKpBQCMzyYggrdapbVIceWZBtmslOQrXLABRoe", parsedLink.token) | ||
Assert.assertEquals("vector.im", parsedLink.identityServer) | ||
Assert.assertEquals("Team2", parsedLink.roomName) | ||
Assert.assertEquals("hiphop5", parsedLink.inviterName) | ||
} | ||
|
||
@Test | ||
fun testParseLinkWIthEvent() { | ||
val rawInvite = "https://matrix.to/#/!OGEhHVWSdvArJzumhm:matrix.org/\$xuvJUVDJnwEeVjPx029rAOZ50difpmU_5gZk_T0jGfc?via=matrix.org&via=libera.chat&via=matrix.example.io" | ||
|
||
val parsedLink = PermalinkParser.parse(rawInvite) | ||
Assert.assertTrue("Should be parsed as room link", parsedLink is PermalinkData.RoomLink) | ||
parsedLink as PermalinkData.RoomLink | ||
Assert.assertEquals("!OGEhHVWSdvArJzumhm:matrix.org", parsedLink.roomIdOrAlias) | ||
Assert.assertEquals("\$xuvJUVDJnwEeVjPx029rAOZ50difpmU_5gZk_T0jGfc", parsedLink.eventId) | ||
Assert.assertEquals(3, parsedLink.viaParameters.size) | ||
Assert.assertTrue(parsedLink.viaParameters.contains("matrix.example.io")) | ||
Assert.assertTrue(parsedLink.viaParameters.contains("matrix.org")) | ||
Assert.assertTrue(parsedLink.viaParameters.contains("matrix.example.io")) | ||
} | ||
} |
Oops, something went wrong.