diff --git a/.idea/dictionaries/bmarty.xml b/.idea/dictionaries/bmarty.xml
index d13e40248f..5ad39614b7 100644
--- a/.idea/dictionaries/bmarty.xml
+++ b/.idea/dictionaries/bmarty.xml
@@ -31,6 +31,7 @@
ssss
sygnal
threepid
+ unpublish
unwedging
diff --git a/AUTHORS.md b/AUTHORS.md
index 4fb5b8c994..ad20133d83 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -4,7 +4,7 @@ A full developer contributors list can be found [here](https://github.com/vector
Even if we try to be able to work on all the functionalities, we have more knowledge about what we have developed ourselves.
-## Benoit: Android team leader
+## [Benoit](https://github.com/bmarty): Android team leader
[@benoit.marty:matrix.org](https://matrix.to/#/@benoit.marty:matrix.org)
- Android team leader and project leader, Android developer, GitHub community manager.
@@ -12,7 +12,7 @@ Even if we try to be able to work on all the functionalities, we have more knowl
- Reviewing and polishing developed features, code quality manager, PRs reviewer, GitHub community manager.
- Release manager on the Play Store
-## François: Software architect
+## [Ganfra](https://github.com/ganfra) (aka François): Software architect
[@ganfra:matrix.org](https://matrix.to/#/@ganfra:matrix.org)
- Software architect, Android developer
@@ -20,12 +20,17 @@ Even if we try to be able to work on all the functionalities, we have more knowl
- Work mainly on the global architecture of the project.
- Specialist of the timeline, and lots of other features.
-## Valere: Product manager, Android developer
+## [Valere](https://github.com/BillCarsonFr): Product manager, Android developer
[@valere35:matrix.org](https://matrix.to/#/@valere35:matrix.org)
- Product manager, Android developer
- Specialist on the crypto implementation.
+## [Onuray](https://github.com/onurays): Android developer
+
+[@onurays:matrix.org](https://matrix.to/#/@onurays:matrix.org)
+- Android developer
+
# Other contributors
First of all, we thank all contributors who use Element and report problems on this GitHub project or via the integrated rageshake function.
@@ -34,7 +39,7 @@ We do not forget all translators, for their work of translating Element into man
Feel free to add your name below, when you contribute to the project!
-Name | Matrix ID | GitHub
---------|---------------------|--------------------------------------
-gjpower | @gjpower:matrix.org | [gjpower](https://github.com/gjpower)
-
+Name | Matrix ID | GitHub
+----------|-----------------------------|--------------------------------------
+gjpower | @gjpower:matrix.org | [gjpower](https://github.com/gjpower)
+TR_SLimey | @tr_slimey:an-atom-in.space | [TR-SLimey](https://github.com/TR-SLimey)
diff --git a/CHANGES.md b/CHANGES.md
index 26418c75f1..b16a6690bc 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,25 +1,73 @@
-Changes in Element 1.0.11 (2020-XX-XX)
+Changes in Element 1.0.12 (2020-XX-XX)
===================================================
Features ✨:
- -
+ - Add room aliases management, and room directory visibility management in a dedicated screen (#1579, #2428)
+ - Room setting: update join rules and guest access (#2442)
Improvements 🙌:
- - Open an existing DM instead of creating a new one (#2319)
+ - Add Setting Item to Change PIN (#2462)
+ - Improve room history visibility setting UX (#1579)
Bugfix 🐛:
- - Fix issue when updating the avatar of a room (new avatar vanishing)
- - Discard change dialog displayed by mistake when avatar has been updated
+ - Double bottomsheet effect after verify with passphrase
+ - EditText cursor jumps to the start while typing fast (#2469)
Translations 🗣:
-
SDK API changes ⚠️:
- - AccountService now exposes suspendable function instead of using MatrixCallback (#2354). Note: We will incrementally migrate all the SDK API in a near future.
+ -
Build 🧱:
+ - Upgrade some dependencies and Kotlin version
+ - Use fragment-ktx and preference-ktx dependencies (fix lint issue KtxExtensionAvailable)
+
+Test:
-
+Other changes:
+ - Remove "Status.im" theme #2424
+
+Changes in Element 1.0.11 (2020-11-27)
+===================================================
+
+Features ✨:
+ - Create DMs with users by scanning their QR code (#2025)
+ - Add Invite friends quick invite actions (#2348)
+ - Add friend by scanning QR code, show your code to friends (#2025)
+
+Improvements 🙌:
+ - New room creation tile with quick action (#2346)
+ - Open an existing DM instead of creating a new one (#2319)
+ - Use RoomMember instead of User in the context of a Room.
+ - Ask for explicit user consent to send their contact details to the identity server (#2375)
+ - Handle events of type "m.room.server_acl" (#890)
+ - Room creation form: add advanced section to disable federation (#1314)
+ - Move "Enable Encryption" from room setting screen to room profile screen (#2394)
+ - Home empty screens quick design update (#2347)
+ - Improve Invite user screen (seamless search for matrix ID)
+
+Bugfix 🐛:
+ - Fix crash on AttachmentViewer (#2365)
+ - Exclude yourself when decorating rooms which are direct or don't have more than 2 users (#2370)
+ - F-Droid version: ensure timeout of sync request can be more than 60 seconds (#2169)
+ - Fix issue when restoring draft after sharing (#2287)
+ - Fix issue when updating the avatar of a room (new avatar vanishing)
+ - Discard change dialog displayed by mistake when avatar has been updated
+ - Try to fix cropped image in timeline (#2126)
+ - Registration: annoying error message scares every new user when they add an email (#2391)
+ - Fix jitsi integration for those with non-vanilla dialler frameworks
+ - Update profile has no effect if user is in zero rooms
+ - Fix issues with matrix.to deep linking (#2349)
+
+SDK API changes ⚠️:
+ - AccountService now exposes suspendable function instead of using MatrixCallback (#2354).
+ Note: We will incrementally migrate all the SDK API in a near future (#2449)
+
+Test:
+ - Add `allScreensTest` to cover all screens of the app
+
Other changes:
- Upgrade Realm dependency to 10.0.0
@@ -1033,5 +1081,8 @@ SDK API changes ⚠️:
Build 🧱:
-
+Test:
+ -
+
Other changes:
-
diff --git a/attachment-viewer/build.gradle b/attachment-viewer/build.gradle
index 91ddd519df..59ba6c4500 100644
--- a/attachment-viewer/build.gradle
+++ b/attachment-viewer/build.gradle
@@ -66,7 +66,6 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
- implementation "androidx.fragment:fragment:1.3.0-beta01"
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation 'com.google.android.material:material:1.2.1'
diff --git a/build.gradle b/build.gradle
index 0c4b35b060..6dd61a720c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,8 +2,8 @@
buildscript {
// Ref: https://kotlinlang.org/releases.html
- ext.kotlin_version = '1.4.10'
- ext.kotlin_coroutines_version = "1.3.9"
+ ext.kotlin_version = '1.4.20'
+ ext.kotlin_coroutines_version = "1.4.1"
repositories {
google()
jcenter()
@@ -12,7 +12,7 @@ buildscript {
}
}
dependencies {
- classpath 'com.android.tools.build:gradle:4.1.0'
+ classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.google.gms:google-services:4.3.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.7.1'
diff --git a/fastlane/metadata/android/ca/changelogs/40100100.txt b/fastlane/metadata/android/ca/changelogs/40100100.txt
new file mode 100644
index 0000000000..70b786d12e
--- /dev/null
+++ b/fastlane/metadata/android/ca/changelogs/40100100.txt
@@ -0,0 +1 @@
+// TODO
diff --git a/fastlane/metadata/android/ca/full_description.txt b/fastlane/metadata/android/ca/full_description.txt
new file mode 100644
index 0000000000..b45a5488ea
--- /dev/null
+++ b/fastlane/metadata/android/ca/full_description.txt
@@ -0,0 +1,30 @@
+Element és un nou tipus d'aplicació de missatgeria i col·laboració que:
+
+1. Et dóna a tu el control per preservar la teva privadesa
+2. Et permet comunicar-te amb qualsevol persona de la xarxa Matrix i, fins i tot més enllà gràcies a integracions amb altres aplicacions com Slack
+3. Et protegeix de la publicitat, l'obtenció no desitjada de dades i dels navegadors amb accés controlat
+4. T'assegura a tu mitjançant l'encriptació d'extrem a extrem i amb signatures creuades per verificar els altres
+
+Element és completament diferent a les altres aplicacions de missatgeria i col·laboració ja que és descentralitzat i de codi obert.
+
+Element et deixa triar l'allotjament perquè disposis de privadesa, propietat i control de les teves dades i converses. Et dóna accés a una xarxa oberta perquè no et quedis únicament parlant amb els usuaris d'Element.
+
+Element pot fer tot això ja que opera sobre Matrix - l'estàndard per a les comunicacions obertes i descentralitzades.
+
+Element et dóna el control perquè et deixa escollir qui vols que allotgi les teves converses. Des de l'aplicació d'Element, pots triar l'allotjament de diferents maneres:
+
+1. Crea un compte gratuït al servidor públic de matrix.org allotjat pels desenvolupadors de Matrix o tria'n un entre els milers de servidors públics creats per voluntaris
+2. Allotja tu mateix el teu compte en el teu propi servidor
+3. Registra el compte en un servidor personalitzat subscrivint-te a la plataforma d'Element Matrix Services (EMS)
+
+Per què escollir Element?
+
+PROPIETAT DE LES TEVES DADES: Tu decideixes a on desar les teves dades i missatges. Tu les controles i n'ets el propietari, no una mega-corporació que s'aprofita de les teves dades o les cedeix a tercers.
+
+MISSATGERIA I COL·LABORACIÓ OBERTA: Pots parlar amb qualsevol que estigui a la xarxa Matrix, ja sigui amb Element o amb qualsevol altre aplicació Matrix, fins i tot encara que utilitzin sistemes de missatgeria diferents com Slack, IRC o XMPP.
+
+SUPER-SEGUR: Encriptació d'extrem a extrem real (només qui està conversant pot desxifrar els missatges), i amb signatures creuades per a verificar els dispositius dels participants en les converses.
+
+COMUNICACIÓ COMPLETA: Missatgeria, veu i video-trucades, compartició de fitxers, compartició de pantalla i un munt d'integracions, bots i ginys. Crea sales, comunitats, mantén-te en contacte i enllesteix el que et proposes.
+
+A TOT ARREU: Mantingues el contacte des de qualsevol lloc on siguis, amb un historial de missatges totalment sincronitzat entre tots els teus dispositius i també a la web: https://app.element.io.
diff --git a/fastlane/metadata/android/ca/short_description.txt b/fastlane/metadata/android/ca/short_description.txt
new file mode 100644
index 0000000000..1e842ec64e
--- /dev/null
+++ b/fastlane/metadata/android/ca/short_description.txt
@@ -0,0 +1 @@
+Xat i VoIP segurs i descentralitzats. Protegeix les teves dades de tercers.
diff --git a/fastlane/metadata/android/ca/title.txt b/fastlane/metadata/android/ca/title.txt
new file mode 100644
index 0000000000..adc831006a
--- /dev/null
+++ b/fastlane/metadata/android/ca/title.txt
@@ -0,0 +1 @@
+Element (anteriorment Riot.im)
diff --git a/fastlane/metadata/android/de/changelogs/40100100.txt b/fastlane/metadata/android/de/changelogs/40100100.txt
new file mode 100644
index 0000000000..70b786d12e
--- /dev/null
+++ b/fastlane/metadata/android/de/changelogs/40100100.txt
@@ -0,0 +1 @@
+// TODO
diff --git a/fastlane/metadata/android/en-US/changelogs/40100110.txt b/fastlane/metadata/android/en-US/changelogs/40100110.txt
new file mode 100644
index 0000000000..e587003352
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/40100110.txt
@@ -0,0 +1,2 @@
+This new version mainly contains user interface and user experience improvements. Now you can invite friends, and create DM very fast by scanning QR codes.
+Full changelog: https://github.com/vector-im/element-android/releases/tag/v1.0.11
\ No newline at end of file
diff --git a/fastlane/metadata/android/es/changelogs/40100100.txt b/fastlane/metadata/android/es/changelogs/40100100.txt
new file mode 100644
index 0000000000..70b786d12e
--- /dev/null
+++ b/fastlane/metadata/android/es/changelogs/40100100.txt
@@ -0,0 +1 @@
+// TODO
diff --git a/fastlane/metadata/android/es/full_description.txt b/fastlane/metadata/android/es/full_description.txt
index 860a1f19c3..8c9915a735 100644
--- a/fastlane/metadata/android/es/full_description.txt
+++ b/fastlane/metadata/android/es/full_description.txt
@@ -1,30 +1,30 @@
Element es un nuevo tipo de aplicación de mensajería y colaboración que:
-1. Le da el control para preservar su privacidad
-2. Le permite comunicarse con cualquier persona en la red Matrix e incluso más allá al integrarse con aplicaciones como Slack.
-3. Te protege de la publicidad, la minería de datos y los jardines vallados.
-4. Lo protege a través del cifrado de un extremo a otro, con firma cruzada para verificar a otros
+1. Te da el control para preservar su privacidad
+2. Te permite comunicarse con cualquier persona en la red Matrix e incluso más allá al integrarse con aplicaciones como Slack
+3. Te protege de la publicidad, la minería de datos y los jardines vallados
+4. Te protege a través de encriptación de Extremo-a-Extremo, con firma cruzada para verificar a otros
Element es completamente diferente de otras aplicaciones de mensajería y colaboración porque es descentralizado y de código abierto.
-Element le permite autohospedarse, o elegir un host, para que tenga privacidad, propiedad y control de sus datos y conversaciones. Te da acceso a una red abierta; para que no se quede atascado hablando solo con otros usuarios de Element. Y es muy seguro.
+Element te permite tener su propio servidor privado, o elegir uno público, para que tenga privacidad, posesión, y control de sus datos y conversaciones. Te da acceso a una red abierta; para que no se quede atrapado hablando solo con otros usuarios de Element. Y es muy seguro.
Element puede hacer todo esto porque opera en Matrix, el estándar para la comunicación abierta y descentralizada.
-Element te da el control permitiéndote elegir quién aloja tus conversaciones. Desde la aplicación Element, puede elegir hospedar de diferentes maneras:
+Element te da el control permitiéndote elegir quién aloja tus conversaciones. Desde la aplicación Element, puedes elegir hospedar de diferentes maneras:
-1. Obtenga una cuenta gratuita en el servidor público de matrix.org alojado por los desarrolladores de Matrix, o elija entre miles de servidores públicos alojados por voluntarios
-2. Autohospede su cuenta ejecutando un servidor en su propio hardware
-3. Regístrese para obtener una cuenta en un servidor personalizado simplemente suscribiéndose a la plataforma de alojamiento de Element Matrix Services
+1. Obtén una cuenta gratuita en el servidor público de matrix.org alojado por los desarrolladores de Matrix, o elije entre miles de servidores públicos alojados por voluntarios
+2. Autohospeda tu cuenta con un servidor en tu propio hardware
+3. Regístrate para obtener una cuenta en un servidor personalizado simplemente suscribiéndote a la plataforma de alojamiento de Element Matrix Services
¿Por qué elegir Element?
-POSEE SUS DATOS: Tú decides dónde guardar tus datos y mensajes. Usted es el propietario y lo controla, no algún MEGACORP que extraiga sus datos o dé acceso a terceros.
+TOMA POSESIÓN DE TUS DATOS: Tú decides dónde guardar tus datos y mensajes. Tú eres el propietario y quien lo controla, no alguna MEGACORP que extrae tu datos o da acceso a terceros.
-MENSAJERÍA ABIERTA Y COLABORACIÓN: Puede chatear con cualquier otra persona en la red de Matrix, ya sea que estén usando Element u otra aplicación de Matrix, e incluso si están usando un sistema de mensajería diferente como Slack, IRC o XMPP.
+MENSAJERÍA ABIERTA Y COLABORACIÓN: Puede chatear con cualquier otra persona en la red de Matrix, tanto si usan Element u otra aplicación de Matrix, e incluso si están usando un sistema de mensajería diferente como Slack, IRC o XMPP.
-SUPER SEGURO: Cifrado real de extremo a extremo (solo aquellos en la conversación pueden descifrar mensajes) y firma cruzada para verificar los dispositivos de los participantes de la conversación.
+SUPER SEGURO: Encriptación de Extremo-a-Extremo real (solo aquellos en la conversación pueden descifrar mensajes) y firma cruzada para verificar los dispositivos de los participantes de la conversación.
-COMUNICACIÓN COMPLETA: Mensajería, llamadas de voz y video, uso compartido de archivos, uso compartido de pantalla y un montón de integraciones, bots y widgets. Construya salas, comunidades, manténgase en contacto y haga las cosas.
+COMUNICACIÓN COMPLETA: Mensajería, llamadas de voz y video, uso compartido de archivos, uso compartido de pantalla y un montón de integraciones, bots y widgets. Crea salas, comunidades, mantente en contacto y organízate con eficacia.
-EN TODAS PARTES: Manténgase en contacto donde quiera que esté con un historial de mensajes totalmente sincronizado en todos sus dispositivos y en la web en https://app.element.io.
+EN TODAS PARTES: Mantente en contacto donde quiera que estés con un historial de mensajes totalmente sincronizado en todos sus dispositivos y en la web en https://app.element.io.
diff --git a/fastlane/metadata/android/es/short_description.txt b/fastlane/metadata/android/es/short_description.txt
index 0562213351..473228e0df 100644
--- a/fastlane/metadata/android/es/short_description.txt
+++ b/fastlane/metadata/android/es/short_description.txt
@@ -1 +1 @@
-Chat y VoIP descentralizados seguros. Mantenga sus datos a salvo de terceros.
+Chat y VoIP descentralizados y seguros. Mantén tus datos a salvo de terceros.
diff --git a/fastlane/metadata/android/es/title.txt b/fastlane/metadata/android/es/title.txt
index adc831006a..971e5cf146 100644
--- a/fastlane/metadata/android/es/title.txt
+++ b/fastlane/metadata/android/es/title.txt
@@ -1 +1 @@
-Element (anteriorment Riot.im)
+Element (previamente Riot.im)
diff --git a/fastlane/metadata/android/fa/changelogs/40100100.txt b/fastlane/metadata/android/fa/changelogs/40100100.txt
new file mode 100644
index 0000000000..6123bfc7fc
--- /dev/null
+++ b/fastlane/metadata/android/fa/changelogs/40100100.txt
@@ -0,0 +1 @@
+// برای انجام
diff --git a/fastlane/metadata/android/it/changelogs/40100100.txt b/fastlane/metadata/android/it/changelogs/40100100.txt
new file mode 100644
index 0000000000..0c7cc8cc6c
--- /dev/null
+++ b/fastlane/metadata/android/it/changelogs/40100100.txt
@@ -0,0 +1 @@
+// DA FARE
diff --git a/fastlane/metadata/android/nb/short_description.txt b/fastlane/metadata/android/nb/short_description.txt
new file mode 100644
index 0000000000..b7cad4c849
--- /dev/null
+++ b/fastlane/metadata/android/nb/short_description.txt
@@ -0,0 +1 @@
+Sikker desentralisert chat & VoIP. Beskytt dataene dine fra tredjeparter.
diff --git a/fastlane/metadata/android/nb/title.txt b/fastlane/metadata/android/nb/title.txt
new file mode 100644
index 0000000000..aacee5be54
--- /dev/null
+++ b/fastlane/metadata/android/nb/title.txt
@@ -0,0 +1 @@
+Element (tidligere Riot.im)
diff --git a/fastlane/metadata/android/pt_BR/changelogs/40100100.txt b/fastlane/metadata/android/pt_BR/changelogs/40100100.txt
new file mode 100644
index 0000000000..02cfd45a87
--- /dev/null
+++ b/fastlane/metadata/android/pt_BR/changelogs/40100100.txt
@@ -0,0 +1 @@
+// A FAZER
diff --git a/fastlane/metadata/android/sv/changelogs/40100100.txt b/fastlane/metadata/android/sv/changelogs/40100100.txt
new file mode 100644
index 0000000000..6da756aca9
--- /dev/null
+++ b/fastlane/metadata/android/sv/changelogs/40100100.txt
@@ -0,0 +1 @@
+// ATT GÖRA
diff --git a/fastlane/metadata/android/zh_Hant/changelogs/40100100.txt b/fastlane/metadata/android/zh_Hant/changelogs/40100100.txt
new file mode 100644
index 0000000000..3c21bcbeb6
--- /dev/null
+++ b/fastlane/metadata/android/zh_Hant/changelogs/40100100.txt
@@ -0,0 +1 @@
+// 待辦事項
diff --git a/fastlane/metadata/android/zh_Hant/full_description.txt b/fastlane/metadata/android/zh_Hant/full_description.txt
new file mode 100644
index 0000000000..2fdf6fa478
--- /dev/null
+++ b/fastlane/metadata/android/zh_Hant/full_description.txt
@@ -0,0 +1,30 @@
+Element 是一種新型態的即時通訊軟體與協作應用程式:
+
+1. 自己的隱私自己掌控
+2. 讓您與任何在 Matrix 網路中的人通訊,甚至可與如 Slack 等的應用程式整合
+3. 保護您免受廣告、資料採礦與圍牆花園的侵害
+4. 透過端到端加密保護您,並使用交叉簽章來驗證其他人
+
+Element 是去中心化且開放原始碼的應用程式,因此與其他即時通訊與協作軟體完全不同。
+
+Element 讓您可以自架(或是自行選擇服務提供者)所以您擁有您資料與對話的隱私、所有權與控制權。它讓您可以存取開放的網路;因此,您不僅可以與其他 Matrix 使用者聊天。而且非常安全。
+
+Element 能作到這些事情是因為它在 Matrix 上執行,這是一個開放的去中心化通訊的標準。
+
+Element 讓您選擇您要在哪裡託管您的對話來將控制權還給您。在 Element 應用程式中,您可以選擇其他方式來託管:
+
+1. 在由 Matrix 開發者架設的 matrix.org 公開伺服器上取得免費的帳號,或是從數千個由志願者所架設的公開伺服器中選擇
+2. 在您自己的硬體上自行架設伺服器並建立帳號
+3. 訂閱 Element Matrix 服務託管平台並在自訂伺服氣上註冊帳號
+
+為何選擇 Element?
+
+擁有您的資料:您決定您的資料與訊息要放在哪裡。您擁有並控制它,而非某些科技巨頭會挖掘您的資料並將其售予第三方。
+
+開放的即時通訊與協作:您可以與 Matrix 網路中的任何人聊天,不管他們是使用 Element 或其他 Matrix 應用程式都可以,或甚至是其他的訊息系統,如 Slack、IRC 或 XMPP 也都可以。
+
+超級安全:即時的端到端加密(僅有參與對話的人可以解密訊息),以及交叉簽章以驗證對話參與者的裝置。
+
+完整通訊:即時通訊、語音與視訊通話、檔案分享、畫面分享與超多的整合、機器人與小工具。建立聊天室、保持聯繫並完成工作。
+
+無論您身在何處:無論您身在何處,都可以透過 https://app.element.io 來在所有裝置與網路上保持訊息歷史同步。
diff --git a/fastlane/metadata/android/zh_Hant/short_description.txt b/fastlane/metadata/android/zh_Hant/short_description.txt
new file mode 100644
index 0000000000..23bb82c04e
--- /dev/null
+++ b/fastlane/metadata/android/zh_Hant/short_description.txt
@@ -0,0 +1 @@
+安全的去中心化聊天與 VoIP。確保您的資料不受第三方的影響。
diff --git a/fastlane/metadata/android/zh_Hant/title.txt b/fastlane/metadata/android/zh_Hant/title.txt
new file mode 100644
index 0000000000..3be2260b73
--- /dev/null
+++ b/fastlane/metadata/android/zh_Hant/title.txt
@@ -0,0 +1 @@
+Element(曾名為 Riot.im)
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 99d667ccdc..cdc95ef6eb 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionSha256Sum=0080de8491f0918e4f529a6db6820fa0b9e818ee2386117f4394f95feb1d5583
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
+distributionSha256Sum=22449f5231796abd892c98b2a07c9ceebe4688d192cd2d6763f8e3bf8acbedeb
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/matrix-sdk-android-rx/build.gradle b/matrix-sdk-android-rx/build.gradle
index 3d62758065..37f41d0a2a 100644
--- a/matrix-sdk-android-rx/build.gradle
+++ b/matrix-sdk-android-rx/build.gradle
@@ -36,9 +36,9 @@ android {
dependencies {
implementation project(":matrix-sdk-android")
implementation 'androidx.appcompat:appcompat:1.2.0'
- implementation "androidx.fragment:fragment:1.3.0-beta01"
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
+
// Paging
implementation "androidx.paging:paging-runtime-ktx:2.1.2"
diff --git a/matrix-sdk-android-rx/src/main/java/org/matrix/android/sdk/rx/RxCallbackBuilders.kt b/matrix-sdk-android-rx/src/main/java/org/matrix/android/sdk/rx/RxCallbackBuilders.kt
index f6dbe3d160..ec30a31f6d 100644
--- a/matrix-sdk-android-rx/src/main/java/org/matrix/android/sdk/rx/RxCallbackBuilders.kt
+++ b/matrix-sdk-android-rx/src/main/java/org/matrix/android/sdk/rx/RxCallbackBuilders.kt
@@ -21,34 +21,36 @@ import org.matrix.android.sdk.api.util.Cancelable
import io.reactivex.Completable
import io.reactivex.Single
-fun singleBuilder(builder: (callback: MatrixCallback) -> Cancelable): Single = Single.create {
- val callback: MatrixCallback = object : MatrixCallback {
+fun singleBuilder(builder: (MatrixCallback) -> Cancelable): Single = Single.create { emitter ->
+ val callback = object : MatrixCallback {
override fun onSuccess(data: T) {
- it.onSuccess(data)
+ // Add `!!` to fix the warning:
+ // "Type mismatch: type parameter with nullable bounds is used T is used where T was expected. This warning will become an error soon"
+ emitter.onSuccess(data!!)
}
override fun onFailure(failure: Throwable) {
- it.tryOnError(failure)
+ emitter.tryOnError(failure)
}
}
val cancelable = builder(callback)
- it.setCancellable {
+ emitter.setCancellable {
cancelable.cancel()
}
}
-fun completableBuilder(builder: (callback: MatrixCallback) -> Cancelable): Completable = Completable.create {
- val callback: MatrixCallback = object : MatrixCallback {
+fun completableBuilder(builder: (MatrixCallback) -> Cancelable): Completable = Completable.create { emitter ->
+ val callback = object : MatrixCallback {
override fun onSuccess(data: T) {
- it.onComplete()
+ emitter.onComplete()
}
override fun onFailure(failure: Throwable) {
- it.tryOnError(failure)
+ emitter.tryOnError(failure)
}
}
val cancelable = builder(callback)
- it.setCancellable {
+ emitter.setCancellable {
cancelable.cancel()
}
}
diff --git a/matrix-sdk-android-rx/src/main/java/org/matrix/android/sdk/rx/RxRoom.kt b/matrix-sdk-android-rx/src/main/java/org/matrix/android/sdk/rx/RxRoom.kt
index 86f2d26808..bf4bcacc31 100644
--- a/matrix-sdk-android-rx/src/main/java/org/matrix/android/sdk/rx/RxRoom.kt
+++ b/matrix-sdk-android-rx/src/main/java/org/matrix/android/sdk/rx/RxRoom.kt
@@ -35,6 +35,8 @@ import org.matrix.android.sdk.api.util.toOptional
import io.reactivex.Completable
import io.reactivex.Observable
import io.reactivex.Single
+import org.matrix.android.sdk.api.session.room.model.GuestAccess
+import org.matrix.android.sdk.api.session.room.model.RoomJoinRules
class RxRoom(private val room: Room) {
@@ -127,18 +129,14 @@ class RxRoom(private val room: Room) {
room.updateName(name, it)
}
- fun addRoomAlias(alias: String): Completable = completableBuilder {
- room.addRoomAlias(alias, it)
- }
-
- fun updateCanonicalAlias(alias: String): Completable = completableBuilder {
- room.updateCanonicalAlias(alias, it)
- }
-
fun updateHistoryReadability(readability: RoomHistoryVisibility): Completable = completableBuilder {
room.updateHistoryReadability(readability, it)
}
+ fun updateJoinRule(joinRules: RoomJoinRules?, guestAccess: GuestAccess?): Completable = completableBuilder {
+ room.updateJoinRule(joinRules, guestAccess, it)
+ }
+
fun updateAvatar(avatarUri: Uri, fileName: String): Completable = completableBuilder {
room.updateAvatar(avatarUri, fileName, it)
}
diff --git a/matrix-sdk-android-rx/src/main/java/org/matrix/android/sdk/rx/RxSession.kt b/matrix-sdk-android-rx/src/main/java/org/matrix/android/sdk/rx/RxSession.kt
index 03df708c0c..0e5b88adb2 100644
--- a/matrix-sdk-android-rx/src/main/java/org/matrix/android/sdk/rx/RxSession.kt
+++ b/matrix-sdk-android-rx/src/main/java/org/matrix/android/sdk/rx/RxSession.kt
@@ -35,6 +35,7 @@ import org.matrix.android.sdk.api.session.identity.ThreePid
import org.matrix.android.sdk.api.session.pushers.Pusher
import org.matrix.android.sdk.api.session.room.RoomSummaryQueryParams
import org.matrix.android.sdk.api.session.room.members.ChangeMembershipState
+import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary
import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.room.model.create.CreateRoomParams
import org.matrix.android.sdk.api.session.sync.SyncState
@@ -92,6 +93,13 @@ class RxSession(private val session: Session) {
}
}
+ fun liveRoomMember(userId: String, roomId: String): Observable> {
+ return session.getRoomMemberLive(userId, roomId).asObservable()
+ .startWithCallable {
+ session.getRoomMember(userId, roomId).toOptional()
+ }
+ }
+
fun liveUsers(): Observable> {
return session.getUsersLive().asObservable()
}
diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle
index 05408080ea..18b0410167 100644
--- a/matrix-sdk-android/build.gradle
+++ b/matrix-sdk-android/build.gradle
@@ -125,7 +125,6 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version"
implementation "androidx.appcompat:appcompat:1.2.0"
- implementation "androidx.fragment:fragment:1.3.0-beta01"
implementation "androidx.core:core-ktx:1.3.2"
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
@@ -146,7 +145,7 @@ dependencies {
implementation "ru.noties.markwon:core:$markwon_version"
// Image
- implementation 'androidx.exifinterface:exifinterface:1.3.0'
+ implementation 'androidx.exifinterface:exifinterface:1.3.1'
// Database
implementation 'com.github.Zhuinden:realm-monarchy:0.7.1'
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 1a9165ade4..cbb22daf0f 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
@@ -68,8 +68,8 @@ class CryptoTestHelper(private val mTestHelper: CommonTestHelper) {
if (encryptedRoom) {
val room = aliceSession.getRoom(roomId)!!
- mTestHelper.doSync {
- room.enableEncryption(callback = it)
+ mTestHelper.runBlockingTest {
+ room.enableEncryption()
}
}
diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/search/SearchMessagesTest.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/search/SearchMessagesTest.kt
index 7db159cd0b..ae300c936d 100644
--- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/search/SearchMessagesTest.kt
+++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/session/search/SearchMessagesTest.kt
@@ -71,38 +71,27 @@ class SearchMessagesTest : InstrumentedTest {
commonTestHelper.await(lock)
lock = CountDownLatch(1)
- aliceSession
- .searchService()
- .search(
- searchTerm = "lore",
- limit = 10,
- includeProfile = true,
- afterLimit = 0,
- beforeLimit = 10,
- orderByRecent = true,
- nextBatch = null,
- roomId = aliceRoomId,
- callback = object : MatrixCallback {
- override fun onSuccess(data: SearchResult) {
- super.onSuccess(data)
- assertTrue(data.results?.size == 2)
- assertTrue(
- data.results
- ?.all {
- (it.event.content?.get("body") as? String)?.startsWith(MESSAGE).orFalse()
- }.orFalse()
- )
- lock.countDown()
- }
-
- override fun onFailure(failure: Throwable) {
- super.onFailure(failure)
- fail(failure.localizedMessage)
- lock.countDown()
- }
- }
- )
- lock.await(TestConstants.timeOutMillis, TimeUnit.MILLISECONDS)
+ val data = commonTestHelper.runBlockingTest {
+ aliceSession
+ .searchService()
+ .search(
+ searchTerm = "lore",
+ limit = 10,
+ includeProfile = true,
+ afterLimit = 0,
+ beforeLimit = 10,
+ orderByRecent = true,
+ nextBatch = null,
+ roomId = aliceRoomId
+ )
+ }
+ assertTrue(data.results?.size == 2)
+ assertTrue(
+ data.results
+ ?.all {
+ (it.event.content?.get("body") as? String)?.startsWith(MESSAGE).orFalse()
+ }.orFalse()
+ )
aliceTimeline.removeAllListeners()
cryptoTestData.cleanUp(commonTestHelper)
diff --git a/matrix-sdk-android/src/debug/java/org/matrix/android/sdk/internal/network/interceptors/FormattedJsonHttpLogger.kt b/matrix-sdk-android/src/debug/java/org/matrix/android/sdk/internal/network/interceptors/FormattedJsonHttpLogger.kt
index 5c03e8a855..630f6f1e29 100644
--- a/matrix-sdk-android/src/debug/java/org/matrix/android/sdk/internal/network/interceptors/FormattedJsonHttpLogger.kt
+++ b/matrix-sdk-android/src/debug/java/org/matrix/android/sdk/internal/network/interceptors/FormattedJsonHttpLogger.kt
@@ -66,9 +66,9 @@ class FormattedJsonHttpLogger : HttpLoggingInterceptor.Logger {
}
private fun logJson(formattedJson: String) {
- val arr = formattedJson.split("\n".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
- for (s in arr) {
- Timber.v(s)
- }
+ formattedJson
+ .lines()
+ .dropLastWhile { it.isEmpty() }
+ .forEach { Timber.v(it) }
}
}
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 645fb55bb9..48705ee7b7 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
@@ -27,7 +27,7 @@ interface LoginWizard {
* @param password the password field
* @param deviceName the initial device name
* @param callback the matrix callback on which you'll receive the result of authentication.
- * @return return a [Cancelable]
+ * @return a [Cancelable]
*/
fun login(login: String,
password: String,
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 a17e65b8e0..e264843ea4 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
@@ -22,3 +22,8 @@ fun CharSequence.ensurePrefix(prefix: CharSequence): CharSequence {
else -> "$prefix$this"
}
}
+
+/**
+ * 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/pushrules/PushRuleService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/pushrules/PushRuleService.kt
index 880a7be9ac..4da1662681 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/pushrules/PushRuleService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/pushrules/PushRuleService.kt
@@ -15,11 +15,9 @@
*/
package org.matrix.android.sdk.api.pushrules
-import org.matrix.android.sdk.api.MatrixCallback
import org.matrix.android.sdk.api.pushrules.rest.PushRule
import org.matrix.android.sdk.api.pushrules.rest.RuleSet
import org.matrix.android.sdk.api.session.events.model.Event
-import org.matrix.android.sdk.api.util.Cancelable
interface PushRuleService {
/**
@@ -29,13 +27,13 @@ interface PushRuleService {
fun getPushRules(scope: String = RuleScope.GLOBAL): RuleSet
- fun updatePushRuleEnableStatus(kind: RuleKind, pushRule: PushRule, enabled: Boolean, callback: MatrixCallback): Cancelable
+ suspend fun updatePushRuleEnableStatus(kind: RuleKind, pushRule: PushRule, enabled: Boolean)
- fun addPushRule(kind: RuleKind, pushRule: PushRule, callback: MatrixCallback): Cancelable
+ suspend fun addPushRule(kind: RuleKind, pushRule: PushRule)
- fun updatePushRuleActions(kind: RuleKind, oldPushRule: PushRule, newPushRule: PushRule, callback: MatrixCallback): Cancelable
+ suspend fun updatePushRuleActions(kind: RuleKind, oldPushRule: PushRule, newPushRule: PushRule)
- fun removePushRule(kind: RuleKind, pushRule: PushRule, callback: MatrixCallback): Cancelable
+ suspend fun removePushRule(kind: RuleKind, pushRule: PushRule)
fun addPushRuleListener(listener: PushRuleListener)
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 4e24a17047..19549a338e 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
@@ -16,9 +16,6 @@
package org.matrix.android.sdk.api.raw
-import org.matrix.android.sdk.api.MatrixCallback
-import org.matrix.android.sdk.api.util.Cancelable
-
/**
* Useful methods to fetch raw data from the server. The access token will not be used to fetched the data
*/
@@ -26,17 +23,15 @@ interface RawService {
/**
* Get a URL, either from cache or from the remote server, depending on the cache strategy
*/
- fun getUrl(url: String,
- rawCacheStrategy: RawCacheStrategy,
- matrixCallback: MatrixCallback): Cancelable
+ suspend fun getUrl(url: String, rawCacheStrategy: RawCacheStrategy): String
/**
* Specific case for the well-known file. Cache validity is 8 hours
*/
- fun getWellknown(userId: String, matrixCallback: MatrixCallback): Cancelable
+ suspend fun getWellknown(userId: String): String
/**
* Clear all the cache data
*/
- fun clearCache(matrixCallback: MatrixCallback): Cancelable
+ suspend fun clearCache()
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/EventType.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/EventType.kt
index b291f087ef..85ba3100b0 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/EventType.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/events/model/EventType.kt
@@ -49,6 +49,12 @@ object EventType {
const val STATE_ROOM_JOIN_RULES = "m.room.join_rules"
const val STATE_ROOM_GUEST_ACCESS = "m.room.guest_access"
const val STATE_ROOM_POWER_LEVELS = "m.room.power_levels"
+
+ /**
+ * Note that this Event has been deprecated, see
+ * - https://matrix.org/docs/spec/client_server/r0.6.1#historical-events
+ * - https://github.com/matrix-org/matrix-doc/pull/2432
+ */
const val STATE_ROOM_ALIASES = "m.room.aliases"
const val STATE_ROOM_TOMBSTONE = "m.room.tombstone"
const val STATE_ROOM_CANONICAL_ALIAS = "m.room.canonical_alias"
@@ -56,6 +62,7 @@ object EventType {
const val STATE_ROOM_RELATED_GROUPS = "m.room.related_groups"
const val STATE_ROOM_PINNED_EVENT = "m.room.pinned_events"
const val STATE_ROOM_ENCRYPTION = "m.room.encryption"
+ const val STATE_ROOM_SERVER_ACL = "m.room.server_acl"
// Call Events
const val CALL_INVITE = "m.call.invite"
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/group/Group.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/group/Group.kt
index a4186b5a32..25c69e5025 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/group/Group.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/group/Group.kt
@@ -16,9 +16,6 @@
package org.matrix.android.sdk.api.session.group
-import org.matrix.android.sdk.api.MatrixCallback
-import org.matrix.android.sdk.api.util.Cancelable
-
/**
* This interface defines methods to interact within a group.
*/
@@ -28,8 +25,7 @@ interface Group {
/**
* This methods allows you to refresh data about this group. It will be reflected on the GroupSummary.
* The SDK also takes care of refreshing group data every hour.
- * @param callback : the matrix callback to be notified of success or failure
* @return a Cancelable to be able to cancel requests.
*/
- fun fetchGroupData(callback: MatrixCallback): Cancelable
+ suspend fun fetchGroupData()
}
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 537104a084..aedb813735 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
@@ -92,9 +92,29 @@ interface IdentityService {
/**
* 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.
*/
fun lookUp(threePids: List, callback: MatrixCallback>): Cancelable
+ /**
+ * Return the current user consent for the current identity server, which has been stored using [setUserConsent].
+ * If [setUserConsent] has not been called, the returned value will be false.
+ * Note that if the identity server is changed, the user consent is reset to false.
+ * @return the value stored using [setUserConsent] or false if [setUserConsent] has never been called, or if the identity server
+ * has been changed
+ */
+ fun getUserConsent(): Boolean
+
+ /**
+ * Set the user consent to the provided value. Application MUST explicitly ask for the user consent to send their private data
+ * (email and phone numbers) to the identity server.
+ * Please see https://support.google.com/googleplay/android-developer/answer/9888076?hl=en for more details.
+ * @param newValue true if the user explicitly give their consent, false if the user wants to revoke their consent.
+ */
+ 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
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/IdentityServiceError.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/IdentityServiceError.kt
index 72bb72cc2c..42fdb97643 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/IdentityServiceError.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/identity/IdentityServiceError.kt
@@ -24,6 +24,7 @@ sealed class IdentityServiceError : Failure.FeatureFailure() {
object NoIdentityServerConfigured : IdentityServiceError()
object TermsNotSignedException : IdentityServiceError()
object BulkLookupSha256NotSupported : IdentityServiceError()
+ object UserConsentNotProvided : IdentityServiceError()
object BindingError : IdentityServiceError()
object NoCurrentBindingError : IdentityServiceError()
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/integrationmanager/IntegrationManagerService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/integrationmanager/IntegrationManagerService.kt
index e27d81edb7..60af93888e 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/integrationmanager/IntegrationManagerService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/integrationmanager/IntegrationManagerService.kt
@@ -16,9 +16,6 @@
package org.matrix.android.sdk.api.session.integrationmanager
-import org.matrix.android.sdk.api.MatrixCallback
-import org.matrix.android.sdk.api.util.Cancelable
-
/**
* This is the entry point to manage integration. You can grab an instance of this service through an active session.
*/
@@ -80,19 +77,17 @@ interface IntegrationManagerService {
/**
* Offers to enable or disable the integration.
* @param enable the param to change
- * @param callback the matrix callback to listen for result.
* @return Cancelable
*/
- fun setIntegrationEnabled(enable: Boolean, callback: MatrixCallback): Cancelable
+ suspend fun setIntegrationEnabled(enable: Boolean)
/**
* Offers to allow or disallow a widget.
* @param stateEventId the eventId of the state event defining the widget.
* @param allowed the param to change
- * @param callback the matrix callback to listen for result.
* @return Cancelable
*/
- fun setWidgetAllowed(stateEventId: String, allowed: Boolean, callback: MatrixCallback): Cancelable
+ suspend fun setWidgetAllowed(stateEventId: String, allowed: Boolean)
/**
* Returns true if the widget is allowed, false otherwise.
@@ -105,7 +100,7 @@ interface IntegrationManagerService {
* @param widgetType the widget type to check for
* @param domain the domain to check for
*/
- fun setNativeWidgetDomainAllowed(widgetType: String, domain: String, allowed: Boolean, callback: MatrixCallback): Cancelable
+ suspend fun setNativeWidgetDomainAllowed(widgetType: String, domain: String, allowed: Boolean)
/**
* Returns true if the widget domain is allowed, false otherwise.
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixLinkify.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixLinkify.kt
index 7f264c6228..5e9f3e1eb9 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixLinkify.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/MatrixLinkify.kt
@@ -17,6 +17,7 @@
package org.matrix.android.sdk.api.session.permalinks
import android.text.Spannable
+import org.matrix.android.sdk.api.MatrixPatterns
/**
* MatrixLinkify take a piece of text and turns all of the
@@ -35,7 +36,7 @@ object MatrixLinkify {
* I disable it because it mess up with pills, and even with pills, it does not work correctly:
* The url is not correct. Ex: for @user:matrix.org, the url will be @user:matrix.org, instead of a matrix.to
*/
- /*
+
// sanity checks
if (spannable.isEmpty()) {
return false
@@ -48,14 +49,21 @@ object MatrixLinkify {
val startPos = match.range.first
if (startPos == 0 || text[startPos - 1] != '/') {
val endPos = match.range.last + 1
- val url = text.substring(match.range)
+ var url = text.substring(match.range)
+ if (MatrixPatterns.isUserId(url)
+ || MatrixPatterns.isRoomAlias(url)
+ || MatrixPatterns.isRoomId(url)
+ || MatrixPatterns.isGroupId(url)
+ || MatrixPatterns.isEventId(url)) {
+ url = PermalinkService.MATRIX_TO_URL_BASE + url
+ }
val span = MatrixPermalinkSpan(url, callback)
spannable.setSpan(span, startPos, endPos, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
}
}
}
return hasMatch
- */
- return false
+
+// return false
}
}
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 dc47c81a5f..347a3bb531 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
@@ -44,13 +44,12 @@ object PermalinkParser {
if (fragment.isNullOrEmpty()) {
return PermalinkData.FallbackLink(uri)
}
- val indexOfQuery = fragment.indexOf("?")
- val safeFragment = if (indexOfQuery != -1) fragment.substring(0, indexOfQuery) else fragment
+ val safeFragment = fragment.substringBefore('?')
val viaQueryParameters = fragment.getViaParameters()
// we are limiting to 2 params
val params = safeFragment
- .split(MatrixPatterns.SEP_REGEX.toRegex())
+ .split(MatrixPatterns.SEP_REGEX)
.filter { it.isNotEmpty() }
.take(2)
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/Room.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/Room.kt
index 837bda031b..cb6690b5c5 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/Room.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/Room.kt
@@ -18,6 +18,7 @@ package org.matrix.android.sdk.api.session.room
import androidx.lifecycle.LiveData
import org.matrix.android.sdk.api.MatrixCallback
+import org.matrix.android.sdk.api.session.room.alias.AliasService
import org.matrix.android.sdk.api.session.room.call.RoomCallService
import org.matrix.android.sdk.api.session.room.crypto.RoomCryptoService
import org.matrix.android.sdk.api.session.room.members.MembershipService
@@ -46,6 +47,7 @@ interface Room :
DraftService,
ReadService,
TypingService,
+ AliasService,
TagsService,
MembershipService,
StateService,
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomDirectoryService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomDirectoryService.kt
index dc5b3d55f5..61970ce848 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomDirectoryService.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/RoomDirectoryService.kt
@@ -17,6 +17,7 @@
package org.matrix.android.sdk.api.session.room
import org.matrix.android.sdk.api.MatrixCallback
+import org.matrix.android.sdk.api.session.room.model.RoomDirectoryVisibility
import org.matrix.android.sdk.api.session.room.model.roomdirectory.PublicRoomsParams
import org.matrix.android.sdk.api.session.room.model.roomdirectory.PublicRoomsResponse
import org.matrix.android.sdk.api.session.room.model.thirdparty.ThirdPartyProtocol
@@ -39,4 +40,14 @@ interface RoomDirectoryService {
* Includes both the available protocols and all fields required for queries against each protocol.
*/
fun getThirdPartyProtocol(callback: MatrixCallback