Merge branch 'develop' into feature/fga/realm_kotlin

This commit is contained in:
ganfra 2022-07-25 17:44:40 +02:00
commit 9bb53da626
434 changed files with 6206 additions and 4184 deletions

View File

@ -770,7 +770,7 @@ ij_kotlin_align_multiline_extends_list = false
ij_kotlin_align_multiline_method_parentheses = false ij_kotlin_align_multiline_method_parentheses = false
ij_kotlin_align_multiline_parameters = true ij_kotlin_align_multiline_parameters = true
ij_kotlin_align_multiline_parameters_in_calls = false ij_kotlin_align_multiline_parameters_in_calls = false
ij_kotlin_allow_trailing_comma = false ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = false ij_kotlin_allow_trailing_comma_on_call_site = false
ij_kotlin_assignment_wrap = off ij_kotlin_assignment_wrap = off
ij_kotlin_blank_lines_after_class_header = 0 ij_kotlin_blank_lines_after_class_header = 0

48
.github/workflows/nightly.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: Build and release nightly APK
on:
schedule:
# Every nights at 4
- cron: "0 4 * * *"
env:
CI_GRADLE_ARG_PROPERTIES: >
-Porg.gradle.jvmargs=-Xmx4g
-Porg.gradle.parallel=false
--no-daemon
jobs:
nightly:
name: Build and publish nightly Gplay APK to Firebase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install towncrier
run: |
python3 -m pip install towncrier
- name: Prepare changelog file
run: |
mv towncrier.toml towncrier.toml.bak
sed 's/CHANGES\.md/CHANGES_NIGHTLY\.md/' towncrier.toml.bak > towncrier.toml
rm towncrier.toml.bak
yes n | towncrier build --version nightly
- name: Build and upload Gplay Nightly APK
run: |
./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES --stacktrace
env:
ELEMENT_ANDROID_NIGHTLY_KEYID: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYID }}
ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_KEYPASSWORD }}
ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_STOREPASSWORD }}
FIREBASE_TOKEN: ${{ secrets.ELEMENT_ANDROID_NIGHTLY_FIREBASE_TOKEN }}

View File

@ -42,20 +42,13 @@ jobs:
column-name: "Need info" column-name: "Need info"
label-name: "X-Needs-Info" label-name: "X-Needs-Info"
add_priority_design_issues_to_project: add_design_issues_to_project:
name: P1 X-Needs-Design to Design project board name: X-Needs-Design to Design project board
runs-on: ubuntu-latest runs-on: ubuntu-latest
# Skip in forks # Skip in forks
if: > if: >
github.repository == 'vector-im/element-android' && github.repository == 'vector-im/element-android' &&
contains(github.event.issue.labels.*.name, 'X-Needs-Design') && contains(github.event.issue.labels.*.name, 'X-Needs-Design')
(contains(github.event.issue.labels.*.name, 'S-Critical') &&
(contains(github.event.issue.labels.*.name, 'O-Frequent') ||
contains(github.event.issue.labels.*.name, 'O-Occasional')) ||
contains(github.event.issue.labels.*.name, 'S-Major') &&
contains(github.event.issue.labels.*.name, 'O-Frequent') ||
contains(github.event.issue.labels.*.name, 'A11y') &&
contains(github.event.issue.labels.*.name, 'O-Frequent'))
steps: steps:
- uses: octokit/graphql-action@v2.x - uses: octokit/graphql-action@v2.x
id: add_to_project id: add_to_project
@ -255,9 +248,12 @@ jobs:
# Skip in forks # Skip in forks
if: > if: >
github.repository == 'vector-im/element-android' && github.repository == 'vector-im/element-android' &&
(contains(github.event.issue.labels.*.name, 'Z-ElementX-Alpha') || (contains(github.event.issue.labels.*.name, 'Z-BBQ-Alpha') ||
contains(github.event.issue.labels.*.name, 'Z-ElementX-Beta') || contains(github.event.issue.labels.*.name, 'Z-BBQ-Beta') ||
contains(github.event.issue.labels.*.name, 'Z-ElementX')) contains(github.event.issue.labels.*.name, 'Z-BBQ-Release') ||
contains(github.event.issue.labels.*.name, 'Z-Banquet-Alpha') ||
contains(github.event.issue.labels.*.name, 'Z-Banquet-Beta') ||
contains(github.event.issue.labels.*.name, 'Z-Banquet-Release'))
steps: steps:
- uses: octokit/graphql-action@v2.x - uses: octokit/graphql-action@v2.x
with: with:

View File

@ -24,6 +24,7 @@ buildscript {
classpath libs.gradle.gradlePlugin classpath libs.gradle.gradlePlugin
classpath libs.gradle.kotlinPlugin classpath libs.gradle.kotlinPlugin
classpath libs.gradle.hiltPlugin classpath libs.gradle.hiltPlugin
classpath 'com.google.firebase:firebase-appdistribution-gradle:3.0.2'
classpath 'com.google.gms:google-services:4.3.13' classpath 'com.google.gms:google-services:4.3.13'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.4.0.2513' classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.4.0.2513'
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5' classpath 'com.google.android.gms:oss-licenses-plugin:0.10.5'

1
changelog.d/5115.bugfix Normal file
View File

@ -0,0 +1 @@
Stop using unstable names for withheld codes

1
changelog.d/5546.bugfix Normal file
View File

@ -0,0 +1 @@
ReplyTo are not updated if the original message is edited

1
changelog.d/5687.feature Normal file
View File

@ -0,0 +1 @@
Adds settings screen to change app font scale or enable using system setting

1
changelog.d/5733.misc Normal file
View File

@ -0,0 +1 @@
Communities/Groups are removed completely

1
changelog.d/5733.sdk Normal file
View File

@ -0,0 +1 @@
Communities/Groups are removed completely

1
changelog.d/6200.bugfix Normal file
View File

@ -0,0 +1 @@
Fixes room not being in space after upgrade

1
changelog.d/6213.bugfix Normal file
View File

@ -0,0 +1 @@
Fixes wrong voice message being displayed and played on the timeline.

1
changelog.d/6314.misc Normal file
View File

@ -0,0 +1 @@
Improves performance on search screen by replacing flattenParents with directParentName in RoomSummary

1
changelog.d/6341.bugfix Normal file
View File

@ -0,0 +1 @@
Fixed issues with reporting sync state events from different threads

1
changelog.d/6395.bugfix Normal file
View File

@ -0,0 +1 @@
Display specific message when verification QR code is malformed

1
changelog.d/6437.feature Normal file
View File

@ -0,0 +1 @@
[Location sharing] - Delete action on a live message

1
changelog.d/6478.misc Normal file
View File

@ -0,0 +1 @@
Nightly build publication on Firebase

1
changelog.d/6487.feature Normal file
View File

@ -0,0 +1 @@
[Timeline] - Collapse redacted events

1
changelog.d/6534.bugfix Normal file
View File

@ -0,0 +1 @@
Unwedging could cause the SDK to force creating a new olm session every hour

1
changelog.d/6537.bugfix Normal file
View File

@ -0,0 +1 @@
[Location Share] - Wrong room live location status bar visibility in timeline

1
changelog.d/6538.misc Normal file
View File

@ -0,0 +1 @@
Log durations of DB migration and migration steps.

1
changelog.d/6541.misc Normal file
View File

@ -0,0 +1 @@
[Location Share] - Standardise "Stop" texts for live

1
changelog.d/6546.feature Normal file
View File

@ -0,0 +1 @@
Updates FTUE registration to include username availability check and update copy

1
changelog.d/6547.feature Normal file
View File

@ -0,0 +1 @@
Updates the copy within the FTUE onboarding

1
changelog.d/6548.feature Normal file
View File

@ -0,0 +1 @@
Move initialization of the Session to a background thread. MainActivity is restoring the session now, instead of VectorApplication. Useful when for instance a long migration of a database is required.

1
changelog.d/6549.bugfix Normal file
View File

@ -0,0 +1 @@
Fix infinite loading when opening a DM when the current room is the same DM.

1
changelog.d/6567.feature Normal file
View File

@ -0,0 +1 @@
Share location with other apps

1
changelog.d/6579.bugfix Normal file
View File

@ -0,0 +1 @@
Do not log the live location of the user

1
changelog.d/6584.misc Normal file
View File

@ -0,0 +1 @@
Adds NewAppLayoutEnabled feature flag

1
changelog.d/6585.bugfix Normal file
View File

@ -0,0 +1 @@
Fix backup saving several times the same keys

1
changelog.d/6587.bugfix Normal file
View File

@ -0,0 +1 @@
Check user power level before sharing live location

1
changelog.d/6596.bugfix Normal file
View File

@ -0,0 +1 @@
[Location Share] - Live is considered as ended while still active

1
changelog.d/6607.misc Normal file
View File

@ -0,0 +1 @@
[Location sharing] - Small improvements of UI for live

1
changelog.d/6609.misc Normal file
View File

@ -0,0 +1 @@
Live Location Sharing - Reset zoom level while focusing a user

1
changelog.d/6612.misc Normal file
View File

@ -0,0 +1 @@
Fix a typo in the terms and conditions step during registration.

1
changelog.d/6616.feature Normal file
View File

@ -0,0 +1 @@
Support element call widget

1
changelog.d/6625.misc Normal file
View File

@ -0,0 +1 @@
[Location sharing] - OnTap on the top live status bar, display the expanded map view

View File

@ -13,15 +13,16 @@ ext.versions = [
def gradle = "7.1.3" def gradle = "7.1.3"
// Ref: https://kotlinlang.org/releases.html // Ref: https://kotlinlang.org/releases.html
def kotlin = "1.6.21" def kotlin = "1.6.21"
def kotlinCoroutines = "1.6.3" def kotlinCoroutines = "1.6.4"
def dagger = "2.42" def dagger = "2.42"
def appDistribution = "16.0.0-beta03"
def retrofit = "2.9.0" def retrofit = "2.9.0"
def arrow = "0.8.2" def arrow = "0.8.2"
def markwon = "4.6.2" def markwon = "4.6.2"
def moshi = "1.13.0" def moshi = "1.13.0"
def lifecycle = "2.5.0" def lifecycle = "2.5.0"
def flowBinding = "1.2.0" def flowBinding = "1.2.0"
def flipper = "0.153.0" def flipper = "0.154.0"
def epoxy = "4.6.2" def epoxy = "4.6.2"
def mavericks = "2.7.0" def mavericks = "2.7.0"
def glide = "4.13.2" def glide = "4.13.2"
@ -48,9 +49,7 @@ ext.libs = [
'coroutinesTest' : "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinCoroutines" 'coroutinesTest' : "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinCoroutines"
], ],
androidx : [ androidx : [
'annotation' : "androidx.annotation:annotation:1.4.0",
'activity' : "androidx.activity:activity:1.5.0", 'activity' : "androidx.activity:activity:1.5.0",
'annotations' : "androidx.annotation:annotation:1.3.0",
'appCompat' : "androidx.appcompat:appcompat:1.4.2", 'appCompat' : "androidx.appcompat:appcompat:1.4.2",
'biometric' : "androidx.biometric:biometric:1.1.0", 'biometric' : "androidx.biometric:biometric:1.1.0",
'core' : "androidx.core:core-ktx:1.8.0", 'core' : "androidx.core:core-ktx:1.8.0",
@ -82,7 +81,9 @@ ext.libs = [
'transition' : "androidx.transition:transition:1.2.0", 'transition' : "androidx.transition:transition:1.2.0",
], ],
google : [ google : [
'material' : "com.google.android.material:material:1.6.1" 'material' : "com.google.android.material:material:1.6.1",
'appdistributionApi' : "com.google.firebase:firebase-appdistribution-api-ktx:$appDistribution",
'appdistribution' : "com.google.firebase:firebase-appdistribution:$appDistribution",
], ],
dagger : [ dagger : [
'dagger' : "com.google.dagger:dagger:$dagger", 'dagger' : "com.google.dagger:dagger:$dagger",
@ -96,7 +97,7 @@ ext.libs = [
'flipperNetworkPlugin' : "com.facebook.flipper:flipper-network-plugin:$flipper", 'flipperNetworkPlugin' : "com.facebook.flipper:flipper-network-plugin:$flipper",
], ],
element : [ element : [
'opusencoder' : "io.element.android:opusencoder:1.0.3", 'opusencoder' : "io.element.android:opusencoder:1.0.4",
], ],
squareup : [ squareup : [
'moshi' : "com.squareup.moshi:moshi:$moshi", 'moshi' : "com.squareup.moshi:moshi:$moshi",

54
docs/nightly_build.md Normal file
View File

@ -0,0 +1,54 @@
# Nightly builds
<!--- TOC -->
* [Configuration](#configuration)
* [How to register to get nightly build](#how-to-register-to-get-nightly-build)
* [Build nightly manually](#build-nightly-manually)
<!--- END -->
## Configuration
The nightly build will contain what's on develop, in release mode, for Gplay variant. It is signed using a dedicated signature, and has a dedicated appId (`im.vector.app.nightly`), so it can be installed along with the production version of Element Android. The only other difference compared to Element Android is a different app icon background. We do not want to change the app name since it will also affect some strings in the app, and we do want to do that.
Nightly builds are built and released to Firebase every days, and automatically.
This is recommended to exclusively use this app, with your main account, instead of Element Android, and fallback to Element Android just in case of regression, to discover as soon as possible any regression, and report it to the team. To avoid double notification, you may want to disable the notification from the Element Android production version. Just open Element Android, navigate to `Settings/Notifications` and uncheck `Enable notifications for this session`.
*Note:* Due to a limitation of Firebase, the nightly build is the universal build, which means that the size of the APK is a bit bigger, but this should not have any other side effect.
## How to register to get nightly build
Provide your email to the Android team, who will add it to the list "External testers" on Firebase. You will then receive an invite on the provided email.
Follow the instructions on the email to install the latest nightly build. This is not clear yet if new nightly build will be automatically installed or not.
## Build nightly manually
Nightly build can be built manually from your computer. You will need to retrieved some secrets from Passbolt and add them to your file `~/.gradle/gradle.properties`:
```
signing.element.nightly.storePassword=VALUE_FROM_PASSBOLT
signing.element.nightly.keyId=VALUE_FROM_PASSBOLT
signing.element.nightly.keyPassword=VALUE_FROM_PASSBOLT
```
You will also need to add the environment variable `FIREBASE_TOKEN`:
```sh
export FIREBASE_TOKEN=VALUE_FROM_PASSBOLT
```
Then you can run the following commands (which are also used in the file for [the GitHub action](../.github/workflows/nightly.yml)):
```sh
git checkout develop
mv towncrier.toml towncrier.toml.bak
sed 's/CHANGES\.md/CHANGES_NIGHTLY\.md/' towncrier.toml.bak > towncrier.toml
rm towncrier.toml.bak
yes n | towncrier --version nightly
./gradlew assembleGplayNightly appDistributionUploadGplayNightly $CI_GRADLE_ARG_PROPERTIES --stacktrace
```
Then you can reset the change on the codebase.

View File

@ -1 +1 @@
مُحادثة آمنة لا مركزية و VoIP. حافظ على بياناتك آمنة من الأطراف الثالثة. برنامج المراسلة الجماعية - الرسائل المشفرة والدردشة الجماعية ومكالمات الفيديو

View File

@ -1 +1 @@
Element (Riot.im سابقًا) إيليمنت - تطبيق محادثات أمن

View File

@ -0,0 +1,2 @@
Hlavní změny v této verzi: Podpora UnifiedPush a možnost používat push bez FCM.
Úplný seznam změn: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Hlavní změny v této verzi: Opravy různých chyb a vylepšení stability.
Úplný seznam změn: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Põhilised muutused selles versioonis: võimalus kasutada tõukesõnumite jaoks FCM'i asemel UnifiedPush'i.
Kogu ingliskeelne muudatuste logi: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Põhilised muutused selles versioonis: erinevate vigade parandused ja stabiilsust edendavad kohendused.
Kogu ingliskeelne muudatuste logi: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
تغییرات عمده در این نگارش: استفاده از UnifiedPush و اجازه به کاربر برای داشتن آگاهی‌های ارسالی بدون FCM.
گزارش دگرگونی کامل: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
تغییرات عمده در این نگارش: رفع اشکال‌های مختلف و بهبودهای پایداری.
گزارش دگرگونی کامل: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Principaux changements pour cette version : Utilisation de UnifiedPush qui permet aux utilisateur dutiliser « push » sans FCM.
Intégralité des changements : https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Principaux changements pour cette version : Plusieurs corrections de bogues et daméliorations de stabilité.
Intégralité des changements : https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Principais cambios nesta versión: melloras na xestión das mensaxes cifradas. Varios arranxos e melloras na estabilidade.
Rexistro completo dos cambios: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Principais cambios nesta versión: varios arranxos e melloras na estabilidade.
Rexistro completo dos cambios: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Principais cambios nesta versión: varios arranxos e melloras na estabilidade.
Rexistro completo dos cambios: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Principais cambios nesta versión: varios arranxos e melloras na estabilidade.
Rexistro completo dos cambios: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Principais cambios nesta versión: varios arranxos e melloras na estabilidade.
Rexistro completo dos cambios: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Principais cambios nesta versión: varios arranxos e melloras na estabilidade.
Rexistro completo dos cambios: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Principais cambios nesta versión: varios arranxos e melloras na estabilidade.
Rexistro completo dos cambios: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Principais cambios nesta versión: varios arranxos e melloras na estabilidade.
Rexistro completo dos cambios: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Principais cambios nesta versión: Utiliza UnifiedPush e permite á usuaria obter notificacións sen FCM.
Rexistro completo dos cambios: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Principais cambios nesta versión: varios arranxos e melloras na estabilidade.
Rexistro completo dos cambios: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,42 @@
Element é tanto unha mensaxería segura e unha app de productividade para o traballo en equipo, perfecta para conversas de grupos con traballo remoto. Esta app de chat usa cifrado de extremo-a-extremo para proporcionar video conferencias seguras, compartición de ficheiros e chamadas de voz.
<b>Características de Element incluídas:</b>
- Ferramentas avanzadas para a comunicación en liña
- Mensaxes completamente cifradas para permitir a comunicación corporativa, incluso para traballo remoto
- Chat descentralizado baseado no sistema de código aberto Matrix
- Compartición segura de ficheiros con datos cifrados na xestión de proxectos
- Chats de vídeo con Voz sobre IP en compartición de pantalla
- Integración doada con outras ferramentas de colaboración en liña, ferramentas de xestión de proxectos, servizos VoIP e outras apps de mensaxería para equipos
Element é completamente diferente a outras apps de mensaxería e traballo en equipo. Funciona grazas a Matrix, unha rede aberta para mensaxería segura e descentralizada. Permite a hospedaxe na infraestructura propia para proporcionar o maior grao de propiedade e control sobre os teus datos e mensaxes.
<b>Mensaxería privada e cifrada</b>
Element protéxete da publicidade non solicitada, minería de datos e burbullas de contido. Tamén protexe os teus datos, chamadas de vídeo e voz cifradas de extremo-a-extremo así como verificación con sinatura dos dispositivos.
Element pon baixo o teu control a túa privacidade permitíndoche comunicarte de xeito seguro con calquera a través da rede Matrix, ou en outras ferramentas de colaboración para empresas ao estar integrada en apps como Slack.
<b>Element na túa infraestructura</b>
Para un maior control sobre os teus datos sensibles e comunicacións, podes hospedar Element ou elexir calquera hóspede baseado en Matrix - un estándar para comunicación descentralizado e de código aberto. Element proporciona privacidade e seguridade así como flexibilidade para a integración.
<b>Os teus datos</b>
Ti decides onde gardas os teus datos e mensaxes. Sen o risco da minería de datos ou acceso por terceiras partes.
Element ponte ao mando de varios xeitos:
1. Consigue unha conta gratuíta no servidor público matrix.org hospedado polos desenvolvedores de Matrix, ou elixe entre miles de servidores públicos xestionados por voluntarias
2. Hospeda a túa conta na túa propia infraestructura IT
3. Crea unha conta nun servidor personalizado simplemente subscribíndote á plataforma de hospedaxe Element Matrix Services
<b>Mensaxería e Colaboración abertas</b>
Podes conversar con calquera na rede Matrix, tanto se usan Element ou outra app Matrix ou incluso unha mensaxería diferente.
<b>Super segura</b>
Cifrado real de extremo-a-extremo (só quen participa na conversa pode descifrar as mensaxes), e verificación con sinatura cruzada dos dispositivos.
<b>Comunicación e integración completas</b>
Mensaxería, chamadas de voz e vídeo, compartición de ficheiros, compartición de pantalla e moitas máis integracións, bots e widgets. Crea salas, comunidades, mantén o contacto e saca adiante o traballo.
<b>Continúa onde o deixaches</b>
Sigue en contacto alá onde estés grazas ao historial sincronizado de mensaxería entre tódolos dispositivos e na web https://app.element.io
<b>Código aberto</b>
Element Android é un proxecto de código aberto, hospedado en GitHub. Informa de fallos e/ou contribúe ao seu desenvolvemento en https://github.com/vector-im/element-android

View File

@ -0,0 +1 @@
Mensaxería en grupo - mensaxería cifrada, chat en grupo e videochamadas

View File

@ -0,0 +1 @@
Element - Mensaxería Segura

View File

@ -0,0 +1,2 @@
Perubahan utama dalam versi ini: Dukungan UnifiedPush, memungkinkan pengguna untuk diberitahukan tanpa FCM.
Catatan perubahan lanjutan: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Perubahan utama dalam versi ini: Banyak perbaikan kutu dan perbaikan stabilitas.
Catatan perubahan lanjutan: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Modifiche principali in questa versione: utilizza UnifiedPush e consente all'utente di avere notifiche push senza FCM.
Cronologia completa: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Modifiche principali in questa versione: varie correzioni di errori e miglioramenti della stabilità.
Cronologia completa: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Hlavné zmeny v tejto verzii: Použitie UnifiedPush a umožňuje používateľovi používať push bez FCM.
Úplný zoznam zmien: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Hlavné zmeny v tejto verzii: Rôzne opravy chýb a vylepšenia stability.
Úplný zoznam zmien: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Huvudsakliga ändringar i den här versionen: Använd UnifiedPush och tillåt användare att ha push utan FCM.
Full ändringslogg: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Huvudsakliga ändringar i den här versionen: Diverse buggfixar och stabilitetsförbättringar.
Full ändringslogg: https://github.com/vector-im/element-android/releases

View File

@ -1,2 +1,2 @@
Основні зміни в цій версії: поліпшення VoIP (аудіо та відео дзвінки в DM) та виправлення помилок! Основні зміни в цій версії: поліпшення VoIP (аудіо та відеовиклики у ПП) та виправлення помилок!
Повний журнал змін: https://github.com/vector-im/element-android/releases/tag/v1.1.0 Повний журнал змін: https://github.com/vector-im/element-android/releases/tag/v1.1.0

View File

@ -0,0 +1,2 @@
Основні зміни в цій версії: Застосовано UnifiedPush і дозволено користувачам отримувати push-сповіщення без FCM.
Перелік усіх змін: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
Основні зміни в цій версії: Усунуто різні вади й поліпшено стабільність.
Перелік усіх змін: https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
此版本中的主要變動:使用 UnifiedPush 並允許使用者在沒有 FCM 的情況下推送。
完整的變更紀錄https://github.com/vector-im/element-android/releases

View File

@ -0,0 +1,2 @@
此版本中的主要變動:多個臭蟲修復與穩定性改善。
完整的變更紀錄https://github.com/vector-im/element-android/releases

View File

@ -35,3 +35,8 @@ signing.element.keyPassword=Secret
# This belongs here as it's the only way to share the version number between the plugin and the library. # This belongs here as it's the only way to share the version number between the plugin and the library.
realmKotlinVersion = 1.0.1 realmKotlinVersion = 1.0.1
# Dummy values for signing secrets / nightly
signing.element.nightly.storePassword=Secret
signing.element.nightly.keyId=Secret
signing.element.nightly.keyPassword=Secret

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionSha256Sum=e6d864e3b5bc05cc62041842b306383fc1fefcec359e70cebb1d470a6094ca82 distributionSha256Sum=97a52d145762adc241bad7fd18289bf7f6801e08ece6badf80402fe2b9f250b1
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

6
gradlew vendored
View File

@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \ org.gradle.wrapper.GradleWrapperMain \
"$@" "$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args. # Use "xargs" to parse quoted args.
# #
# With -n1 it outputs one arg per line, with the quotes and backslashes removed. # With -n1 it outputs one arg per line, with the quotes and backslashes removed.

10
gradlew.bat vendored
View File

@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute if %ERRORLEVEL% equ 0 goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd if %ERRORLEVEL% equ 0 goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 set EXIT_CODE=%ERRORLEVEL%
exit /b 1 if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/color_primary_alpha25" android:state_checked="true" android:state_enabled="false" />
<item android:color="?colorPrimary" android:state_checked="true" android:state_enabled="true" />
<item android:color="?vctr_content_quaternary"/>
</selector>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="?vctr_content_quaternary" android:state_enabled="false" />
<item android:color="?vctr_content_primary"/>
</selector>

View File

@ -5,8 +5,11 @@
<item name="android:foreground">?selectableItemBackground</item> <item name="android:foreground">?selectableItemBackground</item>
<item name="android:background">@android:color/transparent</item> <item name="android:background">@android:color/transparent</item>
<item name="android:textSize">12sp</item> <item name="android:textSize">12sp</item>
<item name="android:padding">0dp</item>
<item name="android:gravity">center</item> <item name="android:gravity">center</item>
<item name="android:padding">0dp</item>
<item name="android:minWidth">0dp</item>
<item name="android:insetRight">8dp</item>
<item name="android:insetLeft">8dp</item>
</style> </style>
<style name="Widget.Vector.Button.Text.LocationLive"> <style name="Widget.Vector.Button.Text.LocationLive">
@ -14,8 +17,11 @@
<item name="android:background">@android:color/transparent</item> <item name="android:background">@android:color/transparent</item>
<item name="android:textAppearance">@style/TextAppearance.Vector.Body.Medium</item> <item name="android:textAppearance">@style/TextAppearance.Vector.Body.Medium</item>
<item name="android:textColor">?colorError</item> <item name="android:textColor">?colorError</item>
<item name="android:padding">0dp</item>
<item name="android:gravity">center</item> <item name="android:gravity">center</item>
<item name="android:padding">0dp</item>
<item name="android:minWidth">0dp</item>
<item name="android:insetRight">12dp</item>
<item name="android:insetLeft">12dp</item>
</style> </style>
<style name="TextAppearance.Vector.Body.BottomSheetDisplayName"> <style name="TextAppearance.Vector.Body.BottomSheetDisplayName">
@ -36,8 +42,11 @@
<item name="android:background">@android:color/transparent</item> <item name="android:background">@android:color/transparent</item>
<item name="android:textAppearance">@style/TextAppearance.Vector.Body.Medium</item> <item name="android:textAppearance">@style/TextAppearance.Vector.Body.Medium</item>
<item name="android:textColor">?colorError</item> <item name="android:textColor">?colorError</item>
<item name="android:padding">0dp</item>
<item name="android:gravity">center</item> <item name="android:gravity">center</item>
<item name="android:padding">0dp</item>
<item name="android:minWidth">0dp</item>
<item name="android:insetRight">16dp</item>
<item name="android:insetLeft">16dp</item>
</style> </style>
<style name="Widget.Vector.TextView.Nano.Copyright"> <style name="Widget.Vector.TextView.Nano.Copyright">

View File

@ -26,8 +26,6 @@ import org.matrix.android.sdk.api.session.crypto.crosssigning.MXCrossSigningInfo
import org.matrix.android.sdk.api.session.crypto.crosssigning.PrivateKeysInfo import org.matrix.android.sdk.api.session.crypto.crosssigning.PrivateKeysInfo
import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo import org.matrix.android.sdk.api.session.crypto.model.CryptoDeviceInfo
import org.matrix.android.sdk.api.session.crypto.model.DeviceInfo import org.matrix.android.sdk.api.session.crypto.model.DeviceInfo
import org.matrix.android.sdk.api.session.group.GroupSummaryQueryParams
import org.matrix.android.sdk.api.session.group.model.GroupSummary
import org.matrix.android.sdk.api.session.identity.ThreePid 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.pushers.Pusher
import org.matrix.android.sdk.api.session.room.RoomSortOrder import org.matrix.android.sdk.api.session.room.RoomSortOrder
@ -59,13 +57,6 @@ class FlowSession(private val session: Session) {
} }
} }
fun liveGroupSummaries(queryParams: GroupSummaryQueryParams): Flow<List<GroupSummary>> {
return session.groupService().getGroupSummariesLive(queryParams).asFlow()
.startWith(session.coroutineDispatchers.io) {
session.groupService().getGroupSummaries(queryParams)
}
}
fun liveSpaceSummaries(queryParams: SpaceSummaryQueryParams): Flow<List<RoomSummary>> { fun liveSpaceSummaries(queryParams: SpaceSummaryQueryParams): Flow<List<RoomSummary>> {
return session.spaceService().getSpaceSummariesLive(queryParams).asFlow() return session.spaceService().getSpaceSummariesLive(queryParams).asFlow()
.startWith(session.coroutineDispatchers.io) { .startWith(session.coroutineDispatchers.io) {

View File

@ -204,7 +204,7 @@ dependencies {
implementation libs.apache.commonsImaging implementation libs.apache.commonsImaging
// Phone number https://github.com/google/libphonenumber // Phone number https://github.com/google/libphonenumber
implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.51' implementation 'com.googlecode.libphonenumber:libphonenumber:8.12.52'
testImplementation libs.tests.junit testImplementation libs.tests.junit
// Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281 // Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281

View File

@ -21,7 +21,6 @@ import org.amshove.kluent.shouldBe
import org.junit.Assert import org.junit.Assert
import org.junit.Before import org.junit.Before
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.MethodSorters import org.junit.runners.MethodSorters
@ -60,7 +59,6 @@ import kotlin.coroutines.resume
*/ */
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM) @FixMethodOrder(MethodSorters.JVM)
@Ignore
class UnwedgingTest : InstrumentedTest { class UnwedgingTest : InstrumentedTest {
private lateinit var messagesReceivedByBob: List<TimelineEvent> private lateinit var messagesReceivedByBob: List<TimelineEvent>

View File

@ -21,7 +21,6 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest import androidx.test.filters.LargeTest
import org.junit.Assert import org.junit.Assert
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Rule import org.junit.Rule
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
@ -47,7 +46,6 @@ import org.matrix.android.sdk.mustFail
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM) @FixMethodOrder(MethodSorters.JVM)
@LargeTest @LargeTest
@Ignore
class WithHeldTests : InstrumentedTest { class WithHeldTests : InstrumentedTest {
@get:Rule val rule = RetryTestRule(3) @get:Rule val rule = RetryTestRule(3)

View File

@ -24,7 +24,6 @@ import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull import org.junit.Assert.assertNull
import org.junit.Assert.assertTrue import org.junit.Assert.assertTrue
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Rule import org.junit.Rule
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
@ -56,7 +55,6 @@ import java.util.concurrent.CountDownLatch
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
@FixMethodOrder(MethodSorters.JVM) @FixMethodOrder(MethodSorters.JVM)
@LargeTest @LargeTest
@Ignore
class KeysBackupTest : InstrumentedTest { class KeysBackupTest : InstrumentedTest {
@get:Rule val rule = RetryTestRule(3) @get:Rule val rule = RetryTestRule(3)

View File

@ -22,6 +22,7 @@ import org.amshove.kluent.internal.assertEquals
import org.amshove.kluent.shouldBeFalse import org.amshove.kluent.shouldBeFalse
import org.amshove.kluent.shouldBeTrue import org.amshove.kluent.shouldBeTrue
import org.junit.FixMethodOrder import org.junit.FixMethodOrder
import org.junit.Ignore
import org.junit.Test import org.junit.Test
import org.junit.runner.RunWith import org.junit.runner.RunWith
import org.junit.runners.JUnit4 import org.junit.runners.JUnit4
@ -52,6 +53,7 @@ class TimelineForwardPaginationTest : InstrumentedTest {
* This test ensure that if we click to permalink, we will be able to go back to the live * This test ensure that if we click to permalink, we will be able to go back to the live
*/ */
@Test @Test
@Ignore("Ignoring this test until it's fixed since it blocks the CI.")
fun forwardPaginationTest() = runCryptoTest(context()) { cryptoTestHelper, commonTestHelper -> fun forwardPaginationTest() = runCryptoTest(context()) { cryptoTestHelper, commonTestHelper ->
val numberOfMessagesToSend = 90 val numberOfMessagesToSend = 90
val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceInARoom(false) val cryptoTestData = cryptoTestHelper.doE2ETestWithAliceInARoom(false)

View File

@ -610,4 +610,82 @@ class SpaceHierarchyTest : InstrumentedTest {
} }
} }
} }
@Test
fun testDirectParentNames() = runSessionTest(context()) { commonTestHelper ->
val aliceSession = commonTestHelper.createAccount("Alice", SessionTestParams(true))
val spaceAInfo = createPublicSpace(
commonTestHelper,
aliceSession, "SpaceA",
listOf(
Triple("A1", true /*auto-join*/, true/*canonical*/),
Triple("A2", true, true)
)
)
val spaceBInfo = createPublicSpace(
commonTestHelper,
aliceSession, "SpaceB",
listOf(
Triple("B1", true /*auto-join*/, true/*canonical*/),
Triple("B2", true, true),
Triple("B3", true, true)
)
)
// also add B1 in space A
val B1roomId = spaceBInfo.roomIds.first()
val viaServers = listOf(aliceSession.sessionParams.homeServerHost ?: "")
val spaceA = aliceSession.spaceService().getSpace(spaceAInfo.spaceId)
val spaceB = aliceSession.spaceService().getSpace(spaceBInfo.spaceId)
commonTestHelper.runBlockingTest {
spaceA!!.addChildren(B1roomId, viaServers, null, true)
}
commonTestHelper.waitWithLatch { latch ->
commonTestHelper.retryPeriodicallyWithLatch(latch) {
val roomSummary = aliceSession.getRoomSummary(B1roomId)
roomSummary != null &&
roomSummary.directParentNames.size == 2 &&
roomSummary.directParentNames.contains(spaceA!!.spaceSummary()!!.name) &&
roomSummary.directParentNames.contains(spaceB!!.spaceSummary()!!.name)
}
}
commonTestHelper.waitWithLatch { latch ->
commonTestHelper.retryPeriodicallyWithLatch(latch) {
val roomSummary = aliceSession.getRoomSummary(spaceAInfo.roomIds.first())
roomSummary != null &&
roomSummary.directParentNames.size == 1 &&
roomSummary.directParentNames.contains(spaceA!!.spaceSummary()!!.name)
}
}
val newAName = "FooBar"
commonTestHelper.runBlockingTest {
spaceA!!.asRoom().stateService().updateName(newAName)
}
commonTestHelper.waitWithLatch { latch ->
commonTestHelper.retryPeriodicallyWithLatch(latch) {
val roomSummary = aliceSession.getRoomSummary(B1roomId)
roomSummary != null &&
roomSummary.directParentNames.size == 2 &&
roomSummary.directParentNames.contains(newAName) &&
roomSummary.directParentNames.contains(spaceB!!.spaceSummary()!!.name)
}
}
commonTestHelper.waitWithLatch { latch ->
commonTestHelper.retryPeriodicallyWithLatch(latch) {
val roomSummary = aliceSession.getRoomSummary(spaceAInfo.roomIds.first())
roomSummary != null &&
roomSummary.directParentNames.size == 1 &&
roomSummary.directParentNames.contains(newAName)
}
}
}
} }

View File

@ -156,6 +156,20 @@ object MatrixPatterns {
return matrixId?.substringAfter(":", missingDelimiterValue = "")?.takeIf { it.isNotEmpty() } return matrixId?.substringAfter(":", missingDelimiterValue = "")?.takeIf { it.isNotEmpty() }
} }
/**
* Extract user name from a matrix id.
*
* @param matrixId
* @return null if the input is not a valid matrixId
*/
fun extractUserNameFromId(matrixId: String): String? {
return if (isUserId(matrixId)) {
matrixId.removePrefix("@").substringBefore(":", missingDelimiterValue = "")
} else {
null
}
}
/** /**
* Orders which are not strings, or do not consist solely of ascii characters in the range \x20 (space) to \x7E (~), * Orders which are not strings, or do not consist solely of ascii characters in the range \x20 (space) to \x7E (~),
* or consist of more than 50 characters, are forbidden and the field should be ignored if received. * or consist of more than 50 characters, are forbidden and the field should be ignored if received.

View File

@ -33,7 +33,6 @@ import org.matrix.android.sdk.api.session.crypto.CryptoService
import org.matrix.android.sdk.api.session.events.EventService import org.matrix.android.sdk.api.session.events.EventService
import org.matrix.android.sdk.api.session.file.ContentDownloadStateTracker import org.matrix.android.sdk.api.session.file.ContentDownloadStateTracker
import org.matrix.android.sdk.api.session.file.FileService import org.matrix.android.sdk.api.session.file.FileService
import org.matrix.android.sdk.api.session.group.GroupService
import org.matrix.android.sdk.api.session.homeserver.HomeServerCapabilitiesService import org.matrix.android.sdk.api.session.homeserver.HomeServerCapabilitiesService
import org.matrix.android.sdk.api.session.identity.IdentityService import org.matrix.android.sdk.api.session.identity.IdentityService
import org.matrix.android.sdk.api.session.integrationmanager.IntegrationManagerService import org.matrix.android.sdk.api.session.integrationmanager.IntegrationManagerService
@ -154,11 +153,6 @@ interface Session {
*/ */
fun roomDirectoryService(): RoomDirectoryService fun roomDirectoryService(): RoomDirectoryService
/**
* Returns the GroupService associated with the session.
*/
fun groupService(): GroupService
/** /**
* Returns the UserService associated with the session. * Returns the UserService associated with the session.
*/ */

View File

@ -202,7 +202,7 @@ data class Event(
* It will return a decrypted text message or an empty string otherwise. * It will return a decrypted text message or an empty string otherwise.
*/ */
fun getDecryptedTextSummary(): String? { fun getDecryptedTextSummary(): String? {
if (isRedacted()) return "Message Deleted" if (isRedacted()) return "Message removed"
val text = getDecryptedValue() ?: run { val text = getDecryptedValue() ?: run {
if (isPoll()) { if (isPoll()) {
return getPollQuestion() ?: "created a poll." return getPollQuestion() ?: "created a poll."
@ -371,6 +371,8 @@ fun Event.isPoll(): Boolean = getClearType() in EventType.POLL_START || getClear
fun Event.isSticker(): Boolean = getClearType() == EventType.STICKER fun Event.isSticker(): Boolean = getClearType() == EventType.STICKER
fun Event.isLiveLocation(): Boolean = getClearType() in EventType.STATE_ROOM_BEACON_INFO
fun Event.getRelationContent(): RelationDefaultContent? { fun Event.getRelationContent(): RelationDefaultContent? {
return if (isEncrypted()) { return if (isEncrypted()) {
content.toModel<EncryptedEventContent>()?.relatesTo content.toModel<EncryptedEventContent>()?.relatesTo

View File

@ -87,7 +87,10 @@ object EventType {
// Key share events // Key share events
const val ROOM_KEY_REQUEST = "m.room_key_request" const val ROOM_KEY_REQUEST = "m.room_key_request"
const val FORWARDED_ROOM_KEY = "m.forwarded_room_key" const val FORWARDED_ROOM_KEY = "m.forwarded_room_key"
const val ROOM_KEY_WITHHELD = "org.matrix.room_key.withheld" val ROOM_KEY_WITHHELD = StableUnstableId(
stable = "m.room_key.withheld",
unstable = "org.matrix.room_key.withheld"
)
const val REQUEST_SECRET = "m.secret.request" const val REQUEST_SECRET = "m.secret.request"
const val SEND_SECRET = "m.secret.send" const val SEND_SECRET = "m.secret.send"

View File

@ -0,0 +1,24 @@
/*
* Copyright (c) 2022 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.api.session.events.model
data class StableUnstableId(
val stable: String,
val unstable: String,
) {
val values = listOf(stable, unstable)
}

View File

@ -1,31 +0,0 @@
/*
* Copyright 2020 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.api.session.group
/**
* This interface defines methods to interact within a group.
*/
interface Group {
val groupId: String
/**
* 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.
* @return a Cancelable to be able to cancel requests.
*/
suspend fun fetchGroupData()
}

View File

@ -1,51 +0,0 @@
/*
* Copyright 2020 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.api.session.group
import androidx.lifecycle.LiveData
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.
* @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.
* @param groupId the groupId to look for.
* @return the groupSummary with groupId or null
*/
fun getGroupSummary(groupId: String): GroupSummary?
/**
* Get a list of group summaries. This list is a snapshot of the data.
* @return the list of [GroupSummary]
*/
fun getGroupSummaries(groupSummaryQueryParams: GroupSummaryQueryParams): List<GroupSummary>
/**
* Get a live list of group summaries. This list is refreshed as soon as the data changes.
* @return the [LiveData] of [GroupSummary]
*/
fun getGroupSummariesLive(groupSummaryQueryParams: GroupSummaryQueryParams): LiveData<List<GroupSummary>>
}

View File

@ -1,44 +0,0 @@
/*
* Copyright 2020 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.api.session.group
import org.matrix.android.sdk.api.query.QueryStringValue
import org.matrix.android.sdk.api.session.room.model.Membership
fun groupSummaryQueryParams(init: (GroupSummaryQueryParams.Builder.() -> Unit) = {}): GroupSummaryQueryParams {
return GroupSummaryQueryParams.Builder().apply(init).build()
}
/**
* This class can be used to filter group summaries.
*/
data class GroupSummaryQueryParams(
val displayName: QueryStringValue,
val memberships: List<Membership>
) {
class Builder {
var displayName: QueryStringValue = QueryStringValue.IsNotEmpty
var memberships: List<Membership> = Membership.all()
fun build() = GroupSummaryQueryParams(
displayName = displayName,
memberships = memberships
)
}
}

View File

@ -1,33 +0,0 @@
/*
* Copyright 2020 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.api.session.group.model
import org.matrix.android.sdk.api.session.room.model.Membership
/**
* This class holds some data of a group.
* It can be retrieved through [org.matrix.android.sdk.api.session.group.GroupService]
*/
data class GroupSummary(
val groupId: String,
val membership: Membership,
val displayName: String = "",
val shortDescription: String = "",
val avatarUrl: String = "",
val roomIds: List<String> = emptyList(),
val userIds: List<String> = emptyList()
)

View File

@ -54,7 +54,5 @@ sealed class PermalinkData {
data class UserLink(val userId: String) : PermalinkData() data class UserLink(val userId: String) : PermalinkData()
data class GroupLink(val groupId: String) : PermalinkData() data class FallbackLink(val uri: Uri, val isLegacyGroupLink: Boolean = false) : PermalinkData()
data class FallbackLink(val uri: Uri) : PermalinkData()
} }

View File

@ -61,27 +61,29 @@ object PermalinkParser {
val params = safeFragment val params = safeFragment
.split(MatrixPatterns.SEP_REGEX) .split(MatrixPatterns.SEP_REGEX)
.filter { it.isNotEmpty() } .filter { it.isNotEmpty() }
.map { URLDecoder.decode(it, "UTF-8") }
.take(2) .take(2)
val decodedParams = params
.map { URLDecoder.decode(it, "UTF-8") }
val identifier = params.getOrNull(0) val identifier = params.getOrNull(0)
val extraParameter = params.getOrNull(1) val decodedIdentifier = decodedParams.getOrNull(0)
val extraParameter = decodedParams.getOrNull(1)
return when { return when {
identifier.isNullOrEmpty() -> PermalinkData.FallbackLink(uri) identifier.isNullOrEmpty() || decodedIdentifier.isNullOrEmpty() -> PermalinkData.FallbackLink(uri)
MatrixPatterns.isUserId(identifier) -> PermalinkData.UserLink(userId = identifier) MatrixPatterns.isUserId(decodedIdentifier) -> PermalinkData.UserLink(userId = decodedIdentifier)
MatrixPatterns.isGroupId(identifier) -> PermalinkData.GroupLink(groupId = identifier) MatrixPatterns.isRoomId(decodedIdentifier) -> {
MatrixPatterns.isRoomId(identifier) -> { handleRoomIdCase(fragment, decodedIdentifier, matrixToUri, extraParameter, viaQueryParameters)
handleRoomIdCase(fragment, identifier, matrixToUri, extraParameter, viaQueryParameters)
} }
MatrixPatterns.isRoomAlias(identifier) -> { MatrixPatterns.isRoomAlias(decodedIdentifier) -> {
PermalinkData.RoomLink( PermalinkData.RoomLink(
roomIdOrAlias = identifier, roomIdOrAlias = decodedIdentifier,
isRoomAlias = true, isRoomAlias = true,
eventId = extraParameter.takeIf { !it.isNullOrEmpty() && MatrixPatterns.isEventId(it) }, eventId = extraParameter.takeIf { !it.isNullOrEmpty() && MatrixPatterns.isEventId(it) },
viaParameters = viaQueryParameters viaParameters = viaQueryParameters
) )
} }
else -> PermalinkData.FallbackLink(uri) else -> PermalinkData.FallbackLink(uri, MatrixPatterns.isGroupId(identifier))
} }
} }

Some files were not shown because too many files have changed in this diff Show More