diff --git a/.idea/dictionaries/bmarty.xml b/.idea/dictionaries/bmarty.xml index 4585842153..8299f1c4de 100644 --- a/.idea/dictionaries/bmarty.xml +++ b/.idea/dictionaries/bmarty.xml @@ -37,6 +37,7 @@ threepid unpublish unwedging + vctr \ No newline at end of file diff --git a/CHANGES.md b/CHANGES.md index 1849bde397..4dd4fd0cfd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -44,6 +44,9 @@ Other changes: - Add documentation on LoginWizard and RegistrationWizard (#3303) - Setup towncrier tool (#3293) + Security: + - Element Android shares name of E2EE files with homeserver (#3387) + Changes in Element 1.1.7 (2021-05-12) =================================================== diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b61777d3f..7e1758077b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,7 @@ To install the template (to be done only once): To create a new screen: - First create a new package in your code. -- Then right click on the package, and select `New/New Vector/RiotX Feature`. +- Then right click on the package, and select `New/New Vector/Element Feature`. - Follow the Wizard, especially replace `Main` by something more relevant to your feature. - Click on `Finish`. - Remaining steps are described as TODO in the generated files, or will be pointed out by the compiler, or at runtime :) diff --git a/attachment-viewer/build.gradle b/attachment-viewer/build.gradle index 0f3817d983..c9814171d9 100644 --- a/attachment-viewer/build.gradle +++ b/attachment-viewer/build.gradle @@ -55,7 +55,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation 'androidx.core:core-ktx:1.5.0' implementation 'androidx.appcompat:appcompat:1.3.0' - implementation "androidx.recyclerview:recyclerview:1.2.0" + implementation "androidx.recyclerview:recyclerview:1.2.1" implementation 'com.google.android.material:material:1.3.0' } \ No newline at end of file diff --git a/docs/color_migration_guide.md b/docs/color_migration_guide.md new file mode 100644 index 0000000000..31a531d124 --- /dev/null +++ b/docs/color_migration_guide.md @@ -0,0 +1,85 @@ +# Color migration + +### Changes + +- use colors defined in https://www.figma.com/file/X4XTH9iS2KGJ2wFKDqkyed/Compound?node-id=557%3A0 +- remove unused resources and code (ex: PercentView) +- split some resource files into smaller file +- rework the theme files +- ensure material theme is used everywhere in the theme and in the layout +- add default style for some views in the theme (ex: Toolbar, etc.) +- add some debug screen in the debug menu, to test the themes and the button style +- rework the button style to use `materialThemeOverlay` attribute +- custom tint icon for menu management has been removed +- comment with `riotx` has been updated + +### Main change for developers + +- Read migration guide: https://github.com/vector-im/element-android/pull/3459/files#diff-f0e52729d5e4f6eccbcf72246807aa34ed19c4ef5625ca669df998cd1022874b +- Use MaterialAlertDialogBuilder instead of AlertDialog.Builder +- some Epoxy Item included a divider. This has been removed. Use a `dividerItem` or `bottomSheetDividerItem` Epoxy items to add a divider +- RecyclerView.configureWith now take a divider drawable instead of a divider color + +### Remaining work + +- Cleanup some vector drawables and ensure a tint is always used instead of hard coded color. + +### Migration guide + +Some colors and color attribute has been removed, here is the list and what has to be used now. + +It can help Element Android forks maintainers to migrate their code. + +- riotx_text_primary -> ?vctr_content_primary +- riotx_text_secondary -> ?vctr_content_secondary +- riotx_text_tertiary -> ?vctr_content_tertiary + +- ?riotx_background -> ?android:colorBackground +- riotx_background_light -> element_background_light +- riotx_background_dark -> element_background_dark +- riotx_background_black -> element_background_black + +- riotx_accent -> ?colorPrimary +- riotx_positive_accent -> ?colorPrimary +- riotx_accent_alpha25 -> color_primary_alpha25 +- riotx_notice -> ?colorError +- riotx_destructive_accent -> ?colorError +- vector_error_color -> ?colorError +- vector_warning_color -> ?colorError + +- riotx_bottom_sheet_background -> ?colorSurface +- riotx_alerter_background -> ?colorSurface + +- riotx_username_1 -> element_name_01 +- riotx_username_2 -> element_name_02 +- riotx_username_3 -> element_name_03 +- riotx_username_4 -> element_name_04 +- riotx_username_5 -> element_name_05 +- riotx_username_6 -> element_name_06 +- riotx_username_7 -> element_name_07 +- riotx_username_8 -> element_name_08 + +- riotx_avatar_fill_1 -> element_room_01 +- riotx_avatar_fill_2 -> element_room_02 +- riotx_avatar_fill_3 -> element_room_03 + +- white -> @android:color/white +- black -> @android:color/black or emoji_color + +- riotx_list_header_background_color -> ?vctr_header_background +- riotx_header_panel_background -> ?vctr_header_background +- riotx_list_bottom_sheet_divider_color -> ?vctr_list_separator_on_surface +- riotx_list_divider_color -> ?vctr_list_separator +- list_divider_color -> ?vctr_list_separator +- riotx_header_panel_border_mobile -> ?vctr_list_separator +- riotx_bottom_nav_background_border_color -> ?vctr_list_separator +- riotx_header_panel_text_secondary -> ?vctr_content_primary + +- link_color_light -> element_link_light +- link_color_dark -> element_link_dark + +- riotx_toolbar_primary_text_color -> vctr_content_primary +- riotx_toolbar_secondary_text_color -> vctr_content_primary +- riot_primary_text_color -> vctr_content_primary + +- riotx_android_secondary -> vctr_content_secondary diff --git a/fastlane/metadata/android/cs/full_description.txt b/fastlane/metadata/android/cs/full_description.txt index f9c1f2ad0c..d169c077e1 100644 --- a/fastlane/metadata/android/cs/full_description.txt +++ b/fastlane/metadata/android/cs/full_description.txt @@ -1,30 +1,39 @@ -Element je nový typ aplikace pro výměnu zpráv a spolupráci, která: +Element je zabezpečený komunikátor a zároveň aplikace pro týmovou spolupráci, která je ideální pro skupinové chaty při práci na dálku. Tato chatovací aplikace využívá end-to-end šifrování a poskytuje výkonné videokonference, sdílení souborů a hlasové hovory. -1. Vám dá kontrolu nad ochranou vašeho soukromí -2. Umožní vám komunikovat s kýmkoli v síti Matrix a dokonce i mimo ni pomocí integrací s aplikacemi, jako je Slack -3. Ochrání vás před inzercí, dataminingem a uzavřenými zahradami -4. Zabezpečí vás end-to-end šifrováním s křížovým podpisem pro ověření ostatních +Mezi funkce aplikace Element patří: +- Pokročilé nástroje pro online komunikaci +- Plně šifrované zprávy umožňující bezpečnější firemní komunikaci i pro pracovníky na dálku +- Decentralizovaný chat založený na open source frameworku Matrix +- Bezpečné sdílení souborů se šifrovanými daty při správě projektů +- Videochaty s funkcí Voice over IP a sdílením obrazovky +- Snadná integrace s oblíbenými nástroji pro online spolupráci, nástroji pro správu projektů, službami VoIP a dalšími aplikacemi pro týmovou komunikaci -Element je zcela odlišný od ostatních aplikací pro zasílání zpráv a spolupráci, protože je decentralizovaný a otevřený. +Element se zcela liší od ostatních aplikací pro zasílání zpráv a spolupráci. Funguje na platformě Matrix, otevřené síti pro bezpečné zasílání zpráv a decentralizovanou komunikaci. Umožňuje vlastní hostování, aby uživatelé měli maximální vlastnictví a kontrolu nad svými daty a zprávami. -Element vám umožňuje použít vlastní domovský server - nebo si vybrat hostitele - abyste měli soukromí, vlastnictví a kontrolu nad svými daty a konverzacemi. Poskytuje vám přístup k otevřené síti; takže nejste zaseknuti jen při konverzaci s ostatními uživateli Elementu. A je velmi bezpečný. +Soukromí a šifrované zprávy +Element vás chrání před nežádoucími reklamami, vytěžováním dat a tzv. walled gardens. Zabezpečuje také všechna vaše data, video a hlasovou komunikaci jeden na jednoho prostřednictvím šifrování end-to-end a křížového ověřování zařízení. -Element je toho všeho schopen, protože pracuje na Matrixu - standardu otevřené, decentralizované komunikace. +Element vám dává kontrolu nad vaším soukromím a zároveň vám umožňuje bezpečně komunikovat s kýmkoli v síti Matrix nebo s dalšími nástroji pro firemní spolupráci díky integraci s aplikacemi, jako je Slack. -Element vám dává kontrolu nad tím, že si můžete vybrat, kdo bude hostovat vaše konverzace. Z aplikace Element si můžete vybrat hostování různými způsoby: +Element lze hostovat samostatně +Abyste měli větší kontrolu nad svými citlivými daty a konverzacemi, může být Element hostován na vlastním hardwaru nebo si můžete vybrat libovolného hostitele založeného na systému Matrix - standardu pro decentralizovanou komunikaci s otevřeným zdrojovým kódem. Element vám poskytuje soukromí, soulad se zásadami bezpečnosti a flexibilitu integrace. -1. Získejte zdarma účet na veřejném serveru matrix.org hostovaném vývojáři Matrixu, nebo si vyberte z tisíců veřejných serverů hostovaných dobrovolníky -2. Hostujte svůj účet spuštěním serveru na svém vlastním hardwaru -3. Zaregistrujte si účet na vlastním serveru jednoduchým přihlášením k hostitelské platformě Element Matrix Services +Vlastněte svá data +Sami rozhodujete, kde budou vaše data a zprávy uloženy. Bez rizika vytěžování dat nebo přístupu třetích stran. -Proč zvolit Element? +Element vám dává kontrolu různými způsoby: +1. Získejte bezplatný účet na veřejném serveru matrix.org, který hostují vývojáři Matrixu, nebo si vyberte z tisíců veřejných serverů hostovaných dobrovolníky. +2. Vlastní hostování účtu spuštěním serveru na vlastní IT infrastruktuře. +3. Zaregistrujte si účet na vlastním serveru tak, že si jednoduše předplatíte hostingovou platformu Element Matrix Services. -VLASTNĚTE SVÁ DATA: Vy rozhodnete, kde svá data a zprávy ponecháte. Vlastníte je a jsou pod vaší kontrolou, ne nějaký MEGACORP, který těží vaše data nebo poskytuje přístup třetím stranám. +Otevřené zasílání zpráv a spolupráce +Můžete chatovat s kýmkoli v síti Matrix, ať už používá aplikaci Element, jinou aplikaci podporující protokol Matrix nebo dokonce i když používá jinou aplikaci pro zasílání zpráv. -ZPRÁVY A SPOLUPRÁCE: Můžete chatovat s kýmkoli v síti Matrix, ať už používá Element nebo jinou aplikaci, a to i v případě, že používají jiný systém zasílání zpráv, jako je Slack, IRC nebo XMPP. +Superbezpečné +Skutečné end-to-end šifrování (zprávy mohou dešifrovat pouze účastníci konverzace) a křížové ověřování zařízení. -MAXIMÁLNĚ BEZPEČNÉ: Skutečné šifrování typu end-to-end (pouze ti v konverzaci mohou dešifrovat zprávy) a křížové podepisování k ověření zařízení účastníků konverzace. +Kompletní komunikace a integrace +Zprávy, hlasové a videohovory, sdílení souborů, sdílení obrazovky a celá řada integrací, botů a widgetů. Vytvářejte místnosti, komunity, zůstaňte v kontaktu a spolupracujte. -KOMPLETNÍ KOMUNIKACE: Zprávy, hlasové hovory a videohovory, sdílení souborů, sdílení obrazovky a celá řada integrací, robotů a widgetů. Budujte místnosti, komunity, zůstaňte v kontaktu a spolupracujte. - -KDEKOLIV JSTE: Zůstaňte v kontaktu, ať jste kdekoli, s plně synchronizovanou historií zpráv na všech vašich zařízeních a na webu na adrese https://app.element.io. +Navažte tam, kde jste skončili +Zůstaňte v kontaktu, ať jste kdekoli, díky plně synchronizované historii zpráv ve všech zařízeních a na webu https://app.element.io diff --git a/fastlane/metadata/android/de/changelogs/40101070.txt b/fastlane/metadata/android/de/changelogs/40101070.txt new file mode 100644 index 0000000000..757475a44d --- /dev/null +++ b/fastlane/metadata/android/de/changelogs/40101070.txt @@ -0,0 +1,2 @@ +Hauptänderungen in dieser Version: Mit Spaces kannst du deine Räume gruppieren (Beta). Videos können vor dem Senden komprimiert werden. +Die vollständige Änderungsliste gibt es hier: https://github.com/vector-im/element-android/releases/tag/v1.1.7 diff --git a/fastlane/metadata/android/de/full_description.txt b/fastlane/metadata/android/de/full_description.txt index 1334adf554..30eb153ee9 100644 --- a/fastlane/metadata/android/de/full_description.txt +++ b/fastlane/metadata/android/de/full_description.txt @@ -1,9 +1,9 @@ -Element ist einerseits ein sicherer Messenger, andererseits ideal geeignet für die produktive Zusammenarbeit mit dem Team im Homeoffice. Mit eingebauter Ende-zu-Ende-Verschlüsselung ermöglicht Element umfangreiche und sichere Videokonferenzen, das Teilen von Dateien sowie Sprachanrufe. +Element ist ein sicherer Messenger und ideal für die produktive Zusammenarbeit mit Ihrem Team im Homeoffice. Mit eingebauter Ende-zu-Ende-Verschlüsselung ermöglicht Element auch umfangreiche und sichere Videokonferenzen, das Teilen von Dateien, Sprachanrufe und vieles mehr. Element bietet folgende Funktionen: - Fortschrittliche Werkzeuge für die Online-Kommunikation - Vollständig verschlüsselte Nachrichten, um eine sichere Kommunikation innerhalb und außerhalb von Unternehmen zu ermöglichen -- Dezentralisierte Chats, basierend auf dem quelloffenen Matrix-Framework +- Dezentralisierte Chats, basierend auf dem quelloffenen Matrix-Protokoll - Sichere und kontrollierte Dateifreigabe durch verschlüsselte Daten beim Verwalten von Projekten - Videochats mit VoIP und Bildschirmübertragung - Einfache Einbindung in Ihre bevorzugten Online-Kollaborations- und Projektverwaltungswerkzeuge, VoIP-Dienste und andere Kommunikationsapps für Ihr Team @@ -11,29 +11,29 @@ Element ist einerseits ein sicherer Messenger, andererseits ideal geeignet für Element unterscheidet sich grundlegend von anderen Kommunikations- und Kollaborationsapps. Es läuft auf Matrix, einem offenen Netzwerk für sichere und dezentralisierte Kommunikation. Es erlaubt Nutzern ihre eigene Infrastruktur zu betreiben und gibt ihnen damit vollständige Kontrolle und Besitz über ihre eigenen Daten und Nachrichten. Privatsphäre/Datenschutz und verschlüsselte Kommunikation -Element schützt Sie vor unerwünschter Werbung, dem Datenschürfen und abgeschlossenen Plattformen. Auch schützt es all Ihre Daten, Ihre Video- und Sprachkommunikation unter vier Augen, durch Ende-zu-Ende-Verschlüsselung und durch das Quersignieren von Geräten zur Verifizierung. +Element schützt Sie vor unerwünschter Werbung, dem Datensammeln und geschlossenen Plattformen. Auch schützt es all Ihre Daten, Ihre Video- und Sprachkommunikation mittels Ende-zu-Ende-Verschlüsselung und durch das Quersignieren von Geräten zur Verifizierung. -Element gibt Ihnen die Kontrolle über Ihre Privatsphäre und ermöglicht es Ihnen zugleich, mit jedem im Matrix-Netzwerk sicher zu kommunizieren - oder auch auf anderen geschäftlichen Kollaborationswerkzeugen, zum Beispiel durch das Einbinden von Apps wie Slack. +Element gibt Ihnen volle Kontrolle über Ihre Privatsphäre und ermöglicht es Ihnen zugleich, mit jedem im Matrix-Netzwerk sicher zu kommunizieren - oder auch auf anderen geschäftlichen Kollaborationswerkzeugen, zum Beispiel durch das Einbinden von Apps wie Slack. Element kann man selber betreiben Um mehr Kontrolle über Ihre sensiblen Daten und Konversationen zu ermöglichen, kann man Element selbst betreiben, oder Sie wählen irgendeinen Matrix-basierten Dienst - der Standard für quelloffene, dezentralisierte Kommunikation. Element gibt Ihnen Privatsphäre, Sicherheitskonformität und Flexibilität für Integrationen. Besitzen Sie Ihre Daten -Sie entscheiden, wo Sie Ihre Daten und Nachrichten aufbewahren - ohne das Datenschürfen oder den Zugriff Dritter zu riskieren. +Sie entscheiden, wo Sie Ihre Daten und Nachrichten aufbewahren - ohne das Datensammeln oder den Zugriff Dritter zu riskieren. -Element gibt Ihnen auf verschiedene Arten die Kontrolle: -1. Kostenlos auf dem öffentlichen matrix.org-Server registrieren, der von den Matrix-Entwicklern gehostet wird, oder wählen Sie aus Tausenden von öffentlichen Servern, die von Freiwilligen betrieben werden -2. Ein Konto auf einem eigenen Server in der eigenen IT-Infrastruktur betreiben -3. Einen Konto auf einem maßgeschneiderten Server erstellen, zum Beispiel durch ein Abonnement der Element Matrix Services (kurz EMS) +Element gibt Ihnen auf verschiedene Arten Kontrolle: +1. Sie können sich kostenlos auf dem öffentlichen matrix.org-Server registrieren, der von den Matrix-Entwicklern gehostet wird, oder einen von Tausenden öffentlichen Servern, die von Freiwilligen betrieben werden, auswählen +2. Sie haben die Möglichkeit, ein Konto auf einem eigenen Server in der eigenen IT-Infrastruktur betreiben +3. Außerdem können Sie durch ein Abonnement der Element Matrix Services ein Konto auf einem für Sie maßgeschneiderten Server erstellen Offene Kommunikation und Zusammenarbeit Sie können mit jedem im Matrix-Netzwerk chatten, egal ob ihr Kontakt Element, eine andere Matrix-App oder sogar eine völlig andere Anwendung nutzt. Super sicher -Echte Ende-zu-Ende-Verschlüsselung (nur die Personen in der Unterhaltung können die Nachrichten entschüsseln), sowie die Quersignierung von Geräten zur Verifizierung. +Durch Ende-zu-Ende-Verschlüsselung können nur die Personen, die in der Unterhaltung sind, die Nachrichten lesen. Außerdem stellt die Verifizierung mittels Quersignierung sicher, dass Sie wirklich mit dem Chatten, mit dem Sie glauben - und niemand Anderem. Vollständige Kommunikation und Integration -Kurznachrichten, Sprach- und Videoanrufe, Dateifreigaben, Bildschirmübertragungen und eine ganze Reihe an Integrationen, Bots and Widgets. Schaffen Sie Räume, Communities, bleiben Sie auf dem Laufenden und erledigen Sie Sachen. +Kurznachrichten, Sprach- und Videoanrufe, Dateifreigaben, Bildschirmübertragungen und einer Menge an Integrationen, Bots und Widgets. Schaffen Sie Räume und Communities, bleiben Sie auf dem Laufenden und erledigen Sie Sachen. Da Weitermachen, wo Sie aufgehört haben Bleiben Sie in Kontakt, egal wo Sie sind, mit vollständig synchronisiertem Nachrichtenverlauf quer über all Ihre Geräte und im Netz auf https://app.element.io diff --git a/fastlane/metadata/android/et/changelogs/40101070.txt b/fastlane/metadata/android/et/changelogs/40101070.txt new file mode 100644 index 0000000000..8ef65a7396 --- /dev/null +++ b/fastlane/metadata/android/et/changelogs/40101070.txt @@ -0,0 +1,2 @@ +Põhilised muudatused selles versioonis: beeta-versioon kogukonnakeskustest ja videofailide pakkimine enne üleslaadimist. +Kogu ingliskeelne muudatuste logi: https://github.com/vector-im/element-android/releases/tag/v1.1.7 diff --git a/fastlane/metadata/android/hu/changelogs/40100130.txt b/fastlane/metadata/android/hu/changelogs/40100130.txt index e1b044f4e5..47ce2690f4 100644 --- a/fastlane/metadata/android/hu/changelogs/40100130.txt +++ b/fastlane/metadata/android/hu/changelogs/40100130.txt @@ -1,2 +1,2 @@ Főbb változtatások ebben a verzióban: URL előnézet, új emoji billentyűzet, új szoba beállitási lehetőségek, és hó karácsonyra! -Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.0.12 +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.0.13 diff --git a/fastlane/metadata/android/hu/changelogs/40100140.txt b/fastlane/metadata/android/hu/changelogs/40100140.txt new file mode 100644 index 0000000000..1b86da9ab1 --- /dev/null +++ b/fastlane/metadata/android/hu/changelogs/40100140.txt @@ -0,0 +1,2 @@ +Fő változás ebben a verzióban: Szoba jogosultságok szerkesztése, automatikus sötét/világos téma és sok hibajavítás. +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.0.14 diff --git a/fastlane/metadata/android/hu/changelogs/40100150.txt b/fastlane/metadata/android/hu/changelogs/40100150.txt new file mode 100644 index 0000000000..b48fd6a0d7 --- /dev/null +++ b/fastlane/metadata/android/hu/changelogs/40100150.txt @@ -0,0 +1,2 @@ +Fő változás ebben a verzióban: Közösségi hálózatos bejelentkezés támogatása +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.0.15 diff --git a/fastlane/metadata/android/hu/changelogs/40100160.txt b/fastlane/metadata/android/hu/changelogs/40100160.txt new file mode 100644 index 0000000000..bb983ed5e8 --- /dev/null +++ b/fastlane/metadata/android/hu/changelogs/40100160.txt @@ -0,0 +1,2 @@ +Fő változás ebben a verzióban: Közösségi hálózatos bejelentkezés +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.0.15 and https://github.com/vector-im/element-android/releases/tag/v1.0.16 diff --git a/fastlane/metadata/android/hu/changelogs/40100170.txt b/fastlane/metadata/android/hu/changelogs/40100170.txt new file mode 100644 index 0000000000..806470d74e --- /dev/null +++ b/fastlane/metadata/android/hu/changelogs/40100170.txt @@ -0,0 +1,2 @@ +Fő változás ebben a verzióban: Hibajavítás! +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.0.17 diff --git a/fastlane/metadata/android/hu/changelogs/40101000.txt b/fastlane/metadata/android/hu/changelogs/40101000.txt new file mode 100644 index 0000000000..0bc4f5d49f --- /dev/null +++ b/fastlane/metadata/android/hu/changelogs/40101000.txt @@ -0,0 +1,2 @@ +Fő változás ebben a verzióban: VoIP (hang és videóhívás közvetlen beszélgetésekben) fejlesztés és hibajavítás +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.0 diff --git a/fastlane/metadata/android/hu/changelogs/40101010.txt b/fastlane/metadata/android/hu/changelogs/40101010.txt new file mode 100644 index 0000000000..503fc0ab2f --- /dev/null +++ b/fastlane/metadata/android/hu/changelogs/40101010.txt @@ -0,0 +1,2 @@ +Fő változás ebben a verzióban: sebesség javítás és hibajavítás +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.1 diff --git a/fastlane/metadata/android/hu/changelogs/40101020.txt b/fastlane/metadata/android/hu/changelogs/40101020.txt new file mode 100644 index 0000000000..04d67ac5ae --- /dev/null +++ b/fastlane/metadata/android/hu/changelogs/40101020.txt @@ -0,0 +1,2 @@ +Fő változás ebben a verzióban: sebesség javítás és hibajavítás +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.2 diff --git a/fastlane/metadata/android/hu/changelogs/40101030.txt b/fastlane/metadata/android/hu/changelogs/40101030.txt new file mode 100644 index 0000000000..4d0e46739e --- /dev/null +++ b/fastlane/metadata/android/hu/changelogs/40101030.txt @@ -0,0 +1,2 @@ +Fő változás ebben a verzióban: sebesség javítás és hibajavítás +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.3 diff --git a/fastlane/metadata/android/hu/changelogs/40101040.txt b/fastlane/metadata/android/hu/changelogs/40101040.txt new file mode 100644 index 0000000000..1c6921f0d5 --- /dev/null +++ b/fastlane/metadata/android/hu/changelogs/40101040.txt @@ -0,0 +1,2 @@ +Fő változás ebben a verzióban: sebesség javítás és hibajavítás +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.4 diff --git a/fastlane/metadata/android/hu/changelogs/40101050.txt b/fastlane/metadata/android/hu/changelogs/40101050.txt new file mode 100644 index 0000000000..c937bb9215 --- /dev/null +++ b/fastlane/metadata/android/hu/changelogs/40101050.txt @@ -0,0 +1,2 @@ +Fő változás ebben a verzióban: javítás az 1.1.4 verzióhoz +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.5 diff --git a/fastlane/metadata/android/hu/changelogs/40101060.txt b/fastlane/metadata/android/hu/changelogs/40101060.txt new file mode 100644 index 0000000000..a9b37e66a9 --- /dev/null +++ b/fastlane/metadata/android/hu/changelogs/40101060.txt @@ -0,0 +1,2 @@ +Fő változás ebben a verzióban: javítás az 1.1.5 verzióhoz +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.6 diff --git a/fastlane/metadata/android/hu/changelogs/40101070.txt b/fastlane/metadata/android/hu/changelogs/40101070.txt new file mode 100644 index 0000000000..4acfbea1ea --- /dev/null +++ b/fastlane/metadata/android/hu/changelogs/40101070.txt @@ -0,0 +1,2 @@ +Fő változás ebben a verzióban: béta állapotú Tér támogatás. Videó tömörítés küldés előtt. +Teljes változásnapló: https://github.com/vector-im/element-android/releases/tag/v1.1.7 diff --git a/fastlane/metadata/android/hu/full_description.txt b/fastlane/metadata/android/hu/full_description.txt index b75f259d02..032346ccb8 100644 --- a/fastlane/metadata/android/hu/full_description.txt +++ b/fastlane/metadata/android/hu/full_description.txt @@ -1,30 +1,40 @@ -Az Element egy új üzenetküldő, és csapatmunka alkalmazás, amivel +Element egy biztonságos üzenetküldő és csapatmunka támogató alkalmazás ami ideális távoli munkavégzés közben csoportos csevegéshez. Az alkalmazás végpontok közötti titkosítást használ videó konferenciához, fájl megosztáshoz és videó hivásokhoz. -1. A te kezedben van az irányítás a saját adataid fölött, hogy megőrizhesd a magánszférádat -2. Akárkivel beszélgethetsz a Matrix hálózatban, sőt még azon kívül is, például olyan alkalmazások integrálásával, mint a Slack -3. Megvédheted magad a hirdetésektől, adatbányászattól, és a nagy cégek megoldásaiba való bezártságtól -4. Biztonságosan beszélgethetsz, a végpontok közötti titkosításnak köszönhetően, az eszközök megbízhatóságát az eszköz-közti hitelesítéssel garantálva +Element tulajdonságai: +- Fejlett online kommunikációs eszköz +- Teljesen titkosított üzenetküldés biztonságos céges kommunikációt kínál még a távdolgozóknak is +- Elosztott csevegés a Matrix nyílt forráskódú keretrendszer felhasználásával +- Bizontságos fájl megosztás titkosítottan projektek kezeléséhez +- Videó hívás VoIP-pal és képernyőmegosztással +- Könnyen integrálható a kedvenc online kollaborációs eszközöddel, projekt menedzsment eszközzel, VoIP szolgáltatással vagy más csoport üzenetküldő alkalmazással -Az Element teljesen más, mint a többi üzenetküldő és csapatmunka alkalmazás, mert nyílt forráskódú, és decentralizált (nem központilag irányított). +Element teljesen más mint a többi üzenetküldő alkalmazás. Matrixot használ, egy nyílt hálózatot a decentralizált biztonságos kommunikációhoz. Lehetőséget ad saját szerver üzemeltetésére ami maximális tulajdont és kontrollt biztosít az adatok fölött. -Az Element lehetővé teszi, hogy saját szervert futtass - vagy válassz egy szolgáltatót - így te birtoklod az adataidat, ezáltal megőrizve a magánszférád és a biztonságod. Egy nyitott hálózathoz ad hozzáférést, így nem csak a többi Element felhasználóval tudsz beszélgetni, hanem másokkal is. Ráadásul nagyon biztonságos. +Magánélet védelme és titkosított üzenetküldés +Element megóv a kéretlen hirdetésektől, adatbányászattól és a különböző szigetszerű megoldásoktól. Minden adatot biztonságba helyez, egy az egybe videó és hang kommunikáció végpontok között titkosítva ahol az eszközök hitelesítve vannak. -Az Element-tel azért válik mindez lehetővé, mert a Matrix hálózatra épül - egy nyílt, decentralizált kommunikációs szabványra. +Element a kezedbe adja az adatvédelmi irányítást miközben bárkivel kommunikálhatsz a Matrix hálózatban vagy más üzleti kollaborációs eszközzel ami integrálva van, mint amilyen a Slack. -Az Element a te kezedbe adja az irányítást azáltal, hogy eldöntheted, ki tárolja a beszélgetéseidet. Az Element alkalmazásból több féle szolgáltatót is választhatsz: +Element futtatható saját szerveren -1. Regisztrálhatsz ingyen egy fiókot a matrix.org nyilvános szerveren, amit a Matrix fejlesztői üzemeltetnek, vagy választhatsz a több ezer, ingyenes szerver közül, amit önkéntesek üzemeltetnek -2. A saját számítógépeden is futtathatsz szervert -3. Előfizethetsz egy saját szerverre az Element Matrix Szolgáltatások platformon +Azért, hogy az érzékeny adatok és beszélgetések minnél inkább az irányításod alatt lehessen az Elementet saját magadnak üzemeltetheted vagy választhatsz bármely Matrixon alapuló - szabványos nyílt forráskódú és decentralizált kommunikáció - szoláltató közül. Element adatvédelmet, biztonságot és rugalmas integrációkat biztosít. -Miért jó az Element-et választani? +A te adatod a tiéd +Te döntöd el, hogy hol tárolod az adataidat és üzeneteidet. Adatbányászat vagy harmadik fél hozzáférésének kockázata nélkül. -ADATAID MEGVÉDÉSE: Eldöntheted, hol tárold az adataid és üzeneteid. A te tulajdonodban van, nem valami megacégnél, ami bányássza az adataid, vagy továbbadja másoknak. +Element többféle képpen adja vissza az irányítást: +1. Szerezz egy ingyenes hozzáférést a matrix.org nyilvános szerverre amit a Matrix fejlesztők üzemeltetnek vagy válassz a több ezer önkéntesek által üzemeltetett nyilvános szerverből +2. Üzemeltess szerver magadnak a saját infrastruktúrádon +3. Iratkozz fel egy egyedi szerverre az Element Matrix Services platformon -NYÍLT BESZÉLGETÉS, ÉS CSAPATMUNKA: Akárkivel cseveghetsz a Matrix hálózatban, akár az Element-et használják, akár valamilyen másik Matrix alkalmazást, de még akkor is, ha egy másik csevegő hálózatot használnak, olyat, mint például a Slack, IRC, vagy az XMPP. +Nyílt üzenetküldés és kollaboráció +Bárkivel beszélgethetsz a Matrix hálózaton, akár az Elementet használja akár egy másik Matrix alkalmazást használ vagy akár egy eltérő üzenetküldőt. -SZUPER-BIZTONSÁGOS: Valódi, végpontok közötti titkosítás (csak a beszélgetés résztvevői tudják elolvasni az üzeneteket), és eszköz-közti hitelesítés, hogy ellenőrizhesd a résztvevők eszközeit. +Fantasztikusan biztonságos +Igazi végpontok között titkosítás (csak a beszélgetésben résztvevők tudják visszafejteni) és hitelesítés eszközök közötti aláírásokkal. -TELJES KOMMUNIKÁCIÓ: Üzenetküldés, hang- és videóhívások, fájlmegosztás, képernyőmegosztás, és egy rakás integráció, bot, és widget. Hozz létre szobákat, közösségeket, maradj elérhető, és végezzétek el a feladatokat. +Teljes kommunikáció és integráció +Üzenetküldés, hang és videóhívás, fájl megosztás, képernyő megosztás és egy csomó integráció, botok és kisalkalmazások. Építs szobákat, közösségeket, maradj kapcsolatban és végezz el dolgokat. -AKÁRHOL, AHOL CSAK SZÜKSÉG VAN RÁ: Akárhol is vagy, maradj elérhető, a teljes mértékben szinkronizált beszélgetésekkel az összes eszközödön, és a weben a https://app.element.io oldalon. +Vedd fel a fonalat +Maradj kapcsolatban bárhol minden eszközödön a szinkronizált üzenetekkel és a weben a https://app.element.io oldallal diff --git a/fastlane/metadata/android/hu/short_description.txt b/fastlane/metadata/android/hu/short_description.txt index 89f7c13f54..2dfe14c516 100644 --- a/fastlane/metadata/android/hu/short_description.txt +++ b/fastlane/metadata/android/hu/short_description.txt @@ -1 +1 @@ -Biztonságos, decentralizált chat és VoIP. Tartsd az adataid biztonságban. +Csoportos üzenetküldő - titkosított üzenetek, videó hívások diff --git a/fastlane/metadata/android/hu/title.txt b/fastlane/metadata/android/hu/title.txt index 8e493d2d08..c463dea393 100644 --- a/fastlane/metadata/android/hu/title.txt +++ b/fastlane/metadata/android/hu/title.txt @@ -1 +1 @@ -Element (régebben Riot.im) +Element - Biztonságos üzenetküldő diff --git a/fastlane/metadata/android/it/changelogs/40101070.txt b/fastlane/metadata/android/it/changelogs/40101070.txt new file mode 100644 index 0000000000..6f7ffcd958 --- /dev/null +++ b/fastlane/metadata/android/it/changelogs/40101070.txt @@ -0,0 +1,2 @@ +Modifiche principali in questa versione: supporto beta per gli Spazi. Compressione video prima dell'invio. +Cronologia completa: https://github.com/vector-im/element-android/releases/tag/v1.1.7 diff --git a/fastlane/metadata/android/sv/changelogs/40101070.txt b/fastlane/metadata/android/sv/changelogs/40101070.txt new file mode 100644 index 0000000000..4756a2d028 --- /dev/null +++ b/fastlane/metadata/android/sv/changelogs/40101070.txt @@ -0,0 +1,2 @@ +Huvudsakliga ändringar i den här versionen: betastöd för utrymmen. Komprimera video innan den skickas. +Full ändringslogg: https://github.com/vector-im/element-android/releases/tag/v1.1.7 diff --git a/fastlane/metadata/android/uk/changelogs/40101070.txt b/fastlane/metadata/android/uk/changelogs/40101070.txt new file mode 100644 index 0000000000..4d60bb1704 --- /dev/null +++ b/fastlane/metadata/android/uk/changelogs/40101070.txt @@ -0,0 +1,2 @@ +Основні зміни в цій версії: бета-підтримка Spaces. Стиснення відео перед надсиланням. +Повний журнал змін: https://github.com/vector-im/element-android/releases/tag/v1.1.7 diff --git a/fastlane/metadata/android/uk/full_description.txt b/fastlane/metadata/android/uk/full_description.txt index 026ae4162a..df06315754 100644 --- a/fastlane/metadata/android/uk/full_description.txt +++ b/fastlane/metadata/android/uk/full_description.txt @@ -1,30 +1,39 @@ -Element — це застосунок для спілкування та співпраці нового типу, який: +Element — це і безпечний месенджер, і застосунок для співпраці команди, який ідеально підходить для групових бесід під час віддаленої роботи. Цей застосунок для спілкування застосовує наскрізне шифрування для забезпечення відеоконференцій, обміну файлами та голосових викликів. -1. Надає вам повний контроль за своєю конфіденційністю -2. Дозволяє спілкування з будь-ким у мережі Matrix та поза нею, інтегруючись із такими застосунками, як Slack -3. Убезпечує вас від реклами, збору даних та штучних обмежень -4. Захищає ваше спілкування наскрізним шифруванням із перехресним підписуванням для звірення інших осіб +Можливості Element включають: +- Розширені засоби спілкування в Інтернеті +- Повністю зашифровані повідомлення для надання можливості безпечнішого корпоративного спілкування, навіть для віддалених працівників +- Децентралізований чат на основі відкритого коду Matrix +- Безпечний обмін файлами із зашифрованими даними для керування проєктами +- Відеочати з передачею голосу через IP та показом екрану іншим +- Проста інтеграція з вашими улюбленими інструментами для онлайн-співпраці, інструментами керування проєктами, послугами VoIP та іншими застосунками обміну повідомленнями для команд -Element ґрунтовно відрізняється від інших застосунків для спілкування та співпраці тому що він є децентралізованим та відкритоджерельним. +Element цілковито відрізняється від інших застосунків обміну повідомленнями та спільної роботи. Він працює на Matrix, відкритій мережі для безпечного обміну повідомленнями та децентралізованого зв'язку. Це дозволяє самостійне розгортання, щоб надати користувачам якнайбільше володіння та контролю над їх даними та повідомленнями. -Element дозволяє вам розміщувати сервер в себе або обирати будь-якого з надавачів послуг, таким чином забезпечуючи вам конфіденційність і можливість володіти власними даними й бесідами та контролювати їх. Він надає вам доступ до відкритої мережі, тож ви не є обмеженими спілкуванням виключно з користувачами Element. І він є дуже надійним та безпечним. +Приватність та обмін зашифрованими повідомленнями +Element захищає вас від небажаної реклами, збору даних та обмежень. Він також захищає всі ваші дані, відео та голосовий зв'язок віч-на-віч за допомогою наскрізного шифрування та взаємного підписування пристроїв. -Element здатен забезпечити усе це завдяки тому, що він заснований на протоколі Matrix — стандарті для відкритого та децентралізованого спілкування. +Element дає вам можливість контролювати вашу приватність, одночасно дозволяючи вам безпечно спілкуватися з будь-ким у мережі Matrix або через інші інструменти ділової співпраці, інтегрувавшись із такими програмами, як Slack. -Element надає вам повний контроль, дозволяючи обирати з-поміж надавачів послуг, що обслуговують сервери з вашими бесідами. Ви вільні обрати будь-який спосіб розміщення прямо з застосунку Element: +Element можна розгортати самостійно +Щоб забезпечити більше контролю над вашими приватними даними та розмовами, Element можна самостійно розміщувати або ви можете вибрати будь-який вузол на основі Matrix — стандарт для децентралізованого спілкування з відкритим кодом. Element надає вам приватність, відповідність безпеці та гнучкість інтеграції. -1. Отримати безкоштовний обліковий запис на загальнодоступному сервері matrix.org, який обслуговують розробники Matrix, чи на одному з тисяч публічних серверів, які обслуговують волонтери -2. Розмістити свій обліковий запис на власному сервері -3. Зареєструватись на індивідуальному сервері, просто підписавшись на послуги платформи Element Matrix Services +Ваші дані +Ви вирішуєте, де зберігати свої дані та повідомлення. Без ризику видобутку даних або стороннього доступу. -Чому я маю обрати Element? +Element надає такі можливості на вибір: +1. Отримайте безплатний обліковий запис на загальнодоступному сервері matrix.org, розміщеному розробниками Matrix, або виберіть серед тисяч загальнодоступних серверів, розміщених волонтерами +2. Самостійно розмістіть свій обліковий запис, запустивши сервер на власній ІТ-інфраструктурі +3. Зареєструйте обліковий запис на власному сервері, просто підписавшись на хостинг-платформу Element Matrix Services -ВОЛОДІЙТЕ ВАШИМИ ДАНИМИ: Ви вирішуєте де тримати ваші дані та повідомлення. Саме ви володієте ними та контролюєте їх, а не якась Мегакорпорація, що збирає ваші дані та надає стороннім особам доступ до них. +Відкриті обмін повідомленнями та співпраця +Ви можете спілкуватися з усіма у мережі Matrix, незалежно від того, чи користуються вони Element, іншим застосунком Matrix або навіть якщо іншим застосунком для обміну повідомленнями. -ВІДКРИТІ ОБМІН ПОВІДОМЛЕННЯМИ ТА СПІВПРАЦЯ: Ви можете балакати з будь-ким у мережі Matrix, хоч вони користуються Element, хоч іншим застосунком для Matrix, і навіть якщо вони користуються іншою системою обміну повідомленнями на кшталт Slack, IRC чи XMPP. +Надбезпечний +Справжнє наскрізне шифрування (лише учасники бесіди можуть розшифровувати повідомлення) та взаємне підписування пристроїв. -НАДБЕЗПЕЧНІСТЬ: Справжнє наскрізне шифрування (лише ваші співрозмовники здатні дешифровувати повідомлення) та перехресне підписування для звірення пристроїв інших учасників бесіди. +Повноцінні спілкування та інтеграція +Обмін повідомленнями, голосові та відеовиклики, обмін файлами, спільний доступ до екрана та ціла купа інтеграцій, ботів та віджетів. Створюйте кімнати, спільноти, залишайтеся на зв’язку та виконуйте завдання. -ДОВЕРШЕНИЙ ЗВʼЯЗОК: Повідомлення, голосові та відеодзвінки, обмін файлами, розподіл екрану та ціла купа інтеграцій, ботів та знадобів. Створюйте кімнати й спільноти, залишайтесь на зв'язку та завершуйте свої справи. - -ДЕ Б ВИ НЕ БУЛИ: Залишайтесь на зв'язку де б ви не були, разом з синхронізовною історією листувань на усіх ваших пристроях та в Інтернеті на https://app.element.io. +Продовжуйте, де зупинилися +Залишайтеся на зв'язку, де б ви не знаходились, з повністю синхронізованою історією повідомлень на всіх своїх пристроях та в Інтернеті за адресою https://app.element.io diff --git a/fastlane/metadata/android/zh-Hans/changelogs/40101020.txt b/fastlane/metadata/android/zh-Hans/changelogs/40101020.txt new file mode 100644 index 0000000000..0de3f2aed0 --- /dev/null +++ b/fastlane/metadata/android/zh-Hans/changelogs/40101020.txt @@ -0,0 +1,2 @@ +此版本中的主要更新:改进性能和错误修复! +完整的更新记录:https://github.com/vector-im/element-android/releases/tag/v1.1.2 diff --git a/fastlane/metadata/android/zh-Hans/changelogs/40101030.txt b/fastlane/metadata/android/zh-Hans/changelogs/40101030.txt new file mode 100644 index 0000000000..5a7fae92d5 --- /dev/null +++ b/fastlane/metadata/android/zh-Hans/changelogs/40101030.txt @@ -0,0 +1,2 @@ +此版本中的主要更新:改进性能和修复错误! +完整的更新记录:https://github.com/vector-im/element-android/releases/tag/v1.1.3 diff --git a/fastlane/metadata/android/zh-Hans/changelogs/40101040.txt b/fastlane/metadata/android/zh-Hans/changelogs/40101040.txt new file mode 100644 index 0000000000..44a3547b3e --- /dev/null +++ b/fastlane/metadata/android/zh-Hans/changelogs/40101040.txt @@ -0,0 +1,2 @@ +此版本中的主要更新:改进性能和修复错误! +完整的更新记录:https://github.com/vector-im/element-android/releases/tag/v1.1.4 diff --git a/fastlane/metadata/android/zh-Hans/changelogs/40101050.txt b/fastlane/metadata/android/zh-Hans/changelogs/40101050.txt new file mode 100644 index 0000000000..c320815a00 --- /dev/null +++ b/fastlane/metadata/android/zh-Hans/changelogs/40101050.txt @@ -0,0 +1,2 @@ +此版本中的主要更新:1.1.4 的热修复 +完整的更新记录:https://github.com/vector-im/element-android/releases/tag/v1.1.5 diff --git a/fastlane/metadata/android/zh-Hans/changelogs/40101060.txt b/fastlane/metadata/android/zh-Hans/changelogs/40101060.txt new file mode 100644 index 0000000000..193ef8f48e --- /dev/null +++ b/fastlane/metadata/android/zh-Hans/changelogs/40101060.txt @@ -0,0 +1,2 @@ +此版本中的主要更新:1.1.5 的热修复 +完整的更新记录:https://github.com/vector-im/element-android/releases/tag/v1.1.6 diff --git a/fastlane/metadata/android/zh-Hans/changelogs/40101070.txt b/fastlane/metadata/android/zh-Hans/changelogs/40101070.txt new file mode 100644 index 0000000000..ba8e92be9b --- /dev/null +++ b/fastlane/metadata/android/zh-Hans/changelogs/40101070.txt @@ -0,0 +1,2 @@ +此版本中的主要更新:对「空间」的测试版支持。发送前压缩视频。 +完整的更新记录:https://github.com/vector-im/element-android/releases/tag/v1.1.7 diff --git a/fastlane/metadata/android/zh-Hans/full_description.txt b/fastlane/metadata/android/zh-Hans/full_description.txt index 4791c9652b..fa6b00f1e4 100644 --- a/fastlane/metadata/android/zh-Hans/full_description.txt +++ b/fastlane/metadata/android/zh-Hans/full_description.txt @@ -1,30 +1,39 @@ -Element 是一种新型的通讯与协作应用: +Element 不仅是安全的通讯软件,同时也是生产力团队协作应用,非常适合在远端工作时进行群组聊天。此聊天应用使用了端到端加密来提供强大的视频会议、文件分享与语音通话功能。 -1. 使您可以掌控您的隐私 -2. 使您与 Matrix 网络中的任何人交流,甚至可以通过集成功能与如 Slack 之类的其他应用通讯 -3. 保护您免受广告,大数据挖掘和封闭服务的侵害 -4. 通过端到端加密保证安全,通过交叉签名验证其他人 +Element 的功能包含了: +- 进阶的线上通讯工具 +- 完全加密的信息,即使对于远端工作者来说,也可以有更安全的公司通讯 +- 以 Matrix 开放源码框架为基础的去中心化的聊天 +- 在管理项目时通过加密资料安全地分享文件 +- 包含了 VoIP 与画面分享的视频聊天 +- 与你最喜欢的协作工具、项目管理工具、VoIP 服务与其他团队信息应用轻松整合 -Element 与其他通讯与协作应用完全不同,因为它是去中心化且开源的。 +Element 与其他信息传递与协作应用完全不同。它在 Matrix(一个用于安全传递讯息与去中心化通讯的开放网络)上运行。其可以自建,让使用者对他们的资料和信息拥有最大的所有权与控制权。 -Element 允许您自托管——或者选择托管商——因此,您能拥有数据和会话的隐私权,所有权和控制权。它允许您访问开放网络;因此,您可以与 Element 用户以外的人交流。并且它非常安全。 +隐私与加密信息传递 +Element 保护你不受不想要的广告、信息泄露与围城侵扰。其也通过端到端加密与交叉签章装置验证保护了你所有的资料,并提供一对一视频以及语音通讯。 -Element 之所以可以做到这些,是因为它在 Matrix 上运行——开放,去中心化通讯的标准。 +Element 通过与其他商业协作工具,如 Slack 等应用整合,让你可以在控制你的隐私的同时,也可以与 Matrix 网络上的任何人安全地通讯。 -通过让您选择由谁来托管您的会话,Element 让您掌控一切。在 Element 应用中,您可以选择不同的托管方式: +Element 可以自建 +为了可以完整控制你的敏感资料与对话,Element 可以自建,你也可以选择任何以 Matrix 为基础的服务提供商,开放源码、去中心化的通讯标准。Element 为你提供隐私、安全合规与整合灵活性。 -1. 在由 Matrix 开发者托管的 matrix.org 公共服务器上获取免费帐户,或从志愿者托管的上千个公共服务器中选择 -2. 在您自己的硬件上运行服务器,自托管您的会话 -3. 通过订阅 Element Matrix Services 托管平台,简单地在自定义服务器上注册账户 +拥有你的资料 +你可以决定将你的资料与信息储存在何处。没有信息泄露或被第三方爬取的风险。 -为什么选择 Element? +Element 透过不同的方式让你掌控一切: +1. 在 Matrix 开发者架设的 matrix.org 公开服务器上取得免费帐号,或是从数千个由志愿者架设的公开服务器中选择 +2. 在你自己的 IT 基础架构上的服务器自行托管你的帐号 +3. 只要订阅 Element Matrix Services 托管平台就可以在自定义的服务器上注册帐号 -掌控您的数据:您来决定存放您的数据和消息的位置。拥有并控制它的是您,而不是挖掘您的数据或与第三方分享的巨型企业。 +开放信息传递与协作 +你可以与 Matrix 网络上的任何人聊天,不论他们是使用 Element、其他 Matrix 应用或其他通讯应用。 -开放通讯与协作:您可以与 Matrix 网络中的任何人聊天,不论他们使用 Element 还是其他 Matrix 应用,甚至/即使他们在使用不同的通讯系统,例如 Slack,IRC 或 XMPP。 +超级安全 +真正的端到端加密(仅有那些在对话中的可以解密讯息)以及交叉签章装置验证。 -超级安全:支持真正的端到端加密(仅有会话中的人可以解密消息),还有能够验证会话参与方的设备的交叉签名。 +完整的通讯与整合 +信息传递、语音与视频通话、文件分享、画面分享与超多的整合、机器人与挂件。建构聊天室、社群、保持联络并完成工作。 -完善的通讯方式:消息,语音和视频通话,文件共享,屏幕共享和大量集成功能,机器人和小挂件。建立房间与社区,保持联系并完成工作。 - -随时随地:消息历史可在您的全部设备和 https://app.element.io 网页端之间完全同步,无论您在哪里,都可以保持联系。 +从上次离开的地方开始 +无论你身在何处,都可以透过在你所有设备与网页 https://app.element.io 间完全同步的信息历史保持联络 diff --git a/fastlane/metadata/android/zh-Hant/changelogs/40101070.txt b/fastlane/metadata/android/zh-Hant/changelogs/40101070.txt new file mode 100644 index 0000000000..c62c7d5224 --- /dev/null +++ b/fastlane/metadata/android/zh-Hant/changelogs/40101070.txt @@ -0,0 +1,2 @@ +此版本中的主要變動:對「空間」的測試版支援。傳送前壓縮影片。 +完整的變更紀錄:https://github.com/vector-im/element-android/releases/tag/v1.1.7 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 252359193d..58fb760ff5 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 @@ -24,7 +24,7 @@ import kotlinx.coroutines.rx2.rxSingle import org.matrix.android.sdk.api.extensions.orFalse import org.matrix.android.sdk.api.query.QueryStringValue import org.matrix.android.sdk.api.session.Session -import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent +import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent import org.matrix.android.sdk.api.session.crypto.crosssigning.KEYBACKUP_SECRET_SSSS_NAME import org.matrix.android.sdk.api.session.crypto.crosssigning.MASTER_KEY_SSSS_NAME import org.matrix.android.sdk.api.session.crypto.crosssigning.MXCrossSigningInfo @@ -35,6 +35,7 @@ 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.pushers.Pusher import org.matrix.android.sdk.api.session.room.RoomSummaryQueryParams +import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataEvent 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 @@ -177,10 +178,17 @@ class RxSession(private val session: Session) { } } - fun liveUserAccountData(types: Set): Observable> { - return session.userAccountDataService().getLiveAccountDataEvents(types).asObservable() + fun liveUserAccountData(types: Set): Observable> { + return session.accountDataService().getLiveUserAccountDataEvents(types).asObservable() .startWithCallable { - session.userAccountDataService().getAccountDataEvents(types) + session.accountDataService().getUserAccountDataEvents(types) + } + } + + fun liveRoomAccountData(types: Set): Observable> { + return session.accountDataService().getLiveRoomAccountDataEvents(types).asObservable() + .startWithCallable { + session.accountDataService().getRoomAccountDataEvents(types) } } @@ -201,7 +209,7 @@ class RxSession(private val session: Session) { } fun liveSecretSynchronisationInfo(): Observable { - return Observable.combineLatest, Optional, Optional, SecretsSynchronisationInfo>( + return Observable.combineLatest, Optional, Optional, SecretsSynchronisationInfo>( liveUserAccountData(setOf(MASTER_KEY_SSSS_NAME, USER_SIGNING_KEY_SSSS_NAME, SELF_SIGNING_KEY_SSSS_NAME, KEYBACKUP_SECRET_SSSS_NAME)), liveCrossSigningInfo(session.myUserId), liveCrossSigningPrivateKeys(), diff --git a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/ssss/QuadSTests.kt b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/ssss/QuadSTests.kt index 25c22bca57..d14de30c90 100644 --- a/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/ssss/QuadSTests.kt +++ b/matrix-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/ssss/QuadSTests.kt @@ -33,7 +33,7 @@ import org.matrix.android.sdk.common.TestConstants import org.matrix.android.sdk.internal.crypto.SSSS_ALGORITHM_AES_HMAC_SHA2 import org.matrix.android.sdk.internal.crypto.crosssigning.toBase64NoPadding import org.matrix.android.sdk.internal.crypto.secrets.DefaultSharedSecretStorageService -import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent +import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch @@ -73,12 +73,12 @@ class QuadSTests : InstrumentedTest { // Assert Account data is updated val accountDataLock = CountDownLatch(1) - var accountData: AccountDataEvent? = null + var accountData: UserAccountDataEvent? = null val liveAccountData = runBlocking(Dispatchers.Main) { - aliceSession.userAccountDataService().getLiveAccountDataEvent("${DefaultSharedSecretStorageService.KEY_ID_BASE}.$TEST_KEY_ID") + aliceSession.accountDataService().getLiveUserAccountDataEvent("${DefaultSharedSecretStorageService.KEY_ID_BASE}.$TEST_KEY_ID") } - val accountDataObserver = Observer?> { t -> + val accountDataObserver = Observer?> { t -> if (t?.getOrNull()?.type == "${DefaultSharedSecretStorageService.KEY_ID_BASE}.$TEST_KEY_ID") { accountData = t.getOrNull() accountDataLock.countDown() @@ -100,13 +100,13 @@ class QuadSTests : InstrumentedTest { quadS.setDefaultKey(TEST_KEY_ID) } - var defaultKeyAccountData: AccountDataEvent? = null + var defaultKeyAccountData: UserAccountDataEvent? = null val defaultDataLock = CountDownLatch(1) val liveDefAccountData = runBlocking(Dispatchers.Main) { - aliceSession.userAccountDataService().getLiveAccountDataEvent(DefaultSharedSecretStorageService.DEFAULT_KEY_ID) + aliceSession.accountDataService().getLiveUserAccountDataEvent(DefaultSharedSecretStorageService.DEFAULT_KEY_ID) } - val accountDefDataObserver = Observer?> { t -> + val accountDefDataObserver = Observer?> { t -> if (t?.getOrNull()?.type == DefaultSharedSecretStorageService.DEFAULT_KEY_ID) { defaultKeyAccountData = t.getOrNull()!! defaultDataLock.countDown() @@ -206,7 +206,7 @@ class QuadSTests : InstrumentedTest { ) } - val accountDataEvent = aliceSession.userAccountDataService().getAccountDataEvent("my.secret") + val accountDataEvent = aliceSession.accountDataService().getUserAccountDataEvent("my.secret") val encryptedContent = accountDataEvent?.content?.get("encrypted") as? Map<*, *> assertEquals("Content should contains two encryptions", 2, encryptedContent?.keys?.size ?: 0) @@ -275,14 +275,14 @@ class QuadSTests : InstrumentedTest { mTestHelper.signOutAndClose(aliceSession) } - private fun assertAccountData(session: Session, type: String): AccountDataEvent { + private fun assertAccountData(session: Session, type: String): UserAccountDataEvent { val accountDataLock = CountDownLatch(1) - var accountData: AccountDataEvent? = null + var accountData: UserAccountDataEvent? = null val liveAccountData = runBlocking(Dispatchers.Main) { - session.userAccountDataService().getLiveAccountDataEvent(type) + session.accountDataService().getLiveUserAccountDataEvent(type) } - val accountDataObserver = Observer?> { t -> + val accountDataObserver = Observer?> { t -> if (t?.getOrNull()?.type == type) { accountData = t.getOrNull() accountDataLock.countDown() diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt index e888e5d2de..2f981ffbbe 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt @@ -24,7 +24,7 @@ import org.matrix.android.sdk.api.failure.GlobalError import org.matrix.android.sdk.api.federation.FederationService import org.matrix.android.sdk.api.pushrules.PushRuleService import org.matrix.android.sdk.api.session.account.AccountService -import org.matrix.android.sdk.api.session.accountdata.AccountDataService +import org.matrix.android.sdk.api.session.accountdata.SessionAccountDataService import org.matrix.android.sdk.api.session.cache.CacheService import org.matrix.android.sdk.api.session.call.CallSignalingService import org.matrix.android.sdk.api.session.content.ContentUploadStateTracker @@ -239,9 +239,9 @@ interface Session : fun openIdService(): OpenIdService /** - * Returns the user account data service associated with the session + * Returns the account data service associated with the session */ - fun userAccountDataService(): AccountDataService + fun accountDataService(): SessionAccountDataService /** * Add a listener to the session. diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/SessionAccountDataService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/SessionAccountDataService.kt new file mode 100644 index 0000000000..2ffb9112d1 --- /dev/null +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/SessionAccountDataService.kt @@ -0,0 +1,66 @@ +/* + * 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.accountdata + +import androidx.lifecycle.LiveData +import org.matrix.android.sdk.api.session.events.model.Content +import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataEvent +import org.matrix.android.sdk.api.util.Optional + +/** + * This service is attached globally to the session. + */ +interface SessionAccountDataService { + /** + * Retrieve the account data with the provided type or null if not found + */ + fun getUserAccountDataEvent(type: String): UserAccountDataEvent? + + /** + * Observe the account data with the provided type + */ + fun getLiveUserAccountDataEvent(type: String): LiveData> + + /** + * Retrieve the account data with the provided types. The return list can have a different size that + * the size of the types set, because some AccountData may not exist. + * If an empty set is provided, all the AccountData are retrieved + */ + fun getUserAccountDataEvents(types: Set): List + + /** + * Observe the account data with the provided types. If an empty set is provided, all the AccountData are observed + */ + fun getLiveUserAccountDataEvents(types: Set): LiveData> + + /** + * Retrieve the room account data with the provided types. The return list can have a different size that + * the size of the types set, because some AccountData may not exist. + * If an empty set is provided, all the room AccountData are retrieved + */ + fun getRoomAccountDataEvents(types: Set): List + + /** + * Observe the room account data with the provided types. If an empty set is provided, AccountData of every room are observed + */ + fun getLiveRoomAccountDataEvents(types: Set): LiveData> + + /** + * Update the account data with the provided type and the provided account data content + */ + suspend fun updateUserAccountData(type: String, content: Content) +} diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/AccountDataEvent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/UserAccountDataEvent.kt similarity index 91% rename from matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/AccountDataEvent.kt rename to matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/UserAccountDataEvent.kt index e5cbd07aaf..77381a28c4 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/AccountDataEvent.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/UserAccountDataEvent.kt @@ -22,10 +22,10 @@ import org.matrix.android.sdk.api.session.events.model.Content /** * This is a simplified Event with just a type and a content. - * Currently used types are defined in [UserAccountDataTypes]. + * Currently used types are defined in [UserAccountDataTypes] */ @JsonClass(generateAdapter = true) -data class AccountDataEvent( +data class UserAccountDataEvent( @Json(name = "type") val type: String, @Json(name = "content") val content: Content ) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt index 1b7a5243e2..e3f00a24b6 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt @@ -42,7 +42,6 @@ import org.matrix.android.sdk.internal.crypto.model.event.RoomKeyWithHeldContent import org.matrix.android.sdk.internal.crypto.model.rest.DeviceInfo import org.matrix.android.sdk.internal.crypto.model.rest.DevicesListResponse import org.matrix.android.sdk.internal.crypto.model.rest.RoomKeyRequestBody -import kotlin.jvm.Throws interface CryptoService { @@ -82,9 +81,11 @@ interface CryptoService { fun getDeviceTrackingStatus(userId: String): Int - fun importRoomKeys(roomKeysAsArray: ByteArray, password: String, progressListener: ProgressListener?, callback: MatrixCallback) + suspend fun importRoomKeys(roomKeysAsArray: ByteArray, + password: String, + progressListener: ProgressListener?): ImportRoomKeysResult - fun exportRoomKeys(password: String, callback: MatrixCallback) + suspend fun exportRoomKeys(password: String): ByteArray fun setRoomBlacklistUnverifiedDevices(roomId: String) 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 8f8967e8fb..ae546b6cec 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 @@ -35,7 +35,7 @@ interface IdentityService { /** * Check if the identity server is valid * See https://matrix.org/docs/spec/identity_service/latest#status-check - * RiotX SDK only supports identity server API v2 + * Matrix Android SDK2 only supports identity server API v2 */ suspend fun isValidIdentityServer(url: String) 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 41bcbf8ff6..cb04b05a74 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 @@ -17,7 +17,7 @@ package org.matrix.android.sdk.api.session.room import androidx.lifecycle.LiveData -import org.matrix.android.sdk.api.session.accountdata.AccountDataService +import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataService 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 @@ -57,7 +57,7 @@ interface Room : RelationService, RoomCryptoService, RoomPushRuleService, - AccountDataService { + RoomAccountDataService { /** * The roomId of this room diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/accountdata/RoomAccountDataEvent.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/accountdata/RoomAccountDataEvent.kt new file mode 100644 index 0000000000..eb676ab5e7 --- /dev/null +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/accountdata/RoomAccountDataEvent.kt @@ -0,0 +1,29 @@ +/* + * 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.room.accountdata + +import org.matrix.android.sdk.api.session.events.model.Content + +/** + * This is a simplified Event with just a roomId, a type and a content. + * Currently used types are defined in [RoomAccountDataTypes]. + */ +data class RoomAccountDataEvent( + val roomId: String, + val type: String, + val content: Content +) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/AccountDataService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/accountdata/RoomAccountDataService.kt similarity index 81% rename from matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/AccountDataService.kt rename to matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/accountdata/RoomAccountDataService.kt index 77f3eb0cd9..190749c85c 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/accountdata/AccountDataService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/room/accountdata/RoomAccountDataService.kt @@ -14,37 +14,37 @@ * limitations under the License. */ -package org.matrix.android.sdk.api.session.accountdata +package org.matrix.android.sdk.api.session.room.accountdata import androidx.lifecycle.LiveData import org.matrix.android.sdk.api.session.events.model.Content import org.matrix.android.sdk.api.util.Optional /** - * This service can be attached globally to the session so it represents user data or attached to a single room. + * This service is attached to a single room. */ -interface AccountDataService { +interface RoomAccountDataService { /** * Retrieve the account data with the provided type or null if not found */ - fun getAccountDataEvent(type: String): AccountDataEvent? + fun getAccountDataEvent(type: String): RoomAccountDataEvent? /** * Observe the account data with the provided type */ - fun getLiveAccountDataEvent(type: String): LiveData> + fun getLiveAccountDataEvent(type: String): LiveData> /** * Retrieve the account data with the provided types. The return list can have a different size that * the size of the types set, because some AccountData may not exist. * If an empty set is provided, all the AccountData are retrieved */ - fun getAccountDataEvents(types: Set): List + fun getAccountDataEvents(types: Set): List /** * Observe the account data with the provided types. If an empty set is provided, all the AccountData are observed */ - fun getLiveAccountDataEvents(types: Set): LiveData> + fun getLiveAccountDataEvents(types: Set): LiveData> /** * Update the account data with the provided type and the provided account data content diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt index 7f5cfe8df1..d170ae3dd3 100755 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt @@ -388,7 +388,7 @@ internal class DefaultCryptoService @Inject constructor( cryptoStore.close() } - // Aways enabled on RiotX + // Always enabled on Matrix Android SDK2 override fun isCryptoEnabled() = true /** @@ -928,14 +928,10 @@ internal class DefaultCryptoService @Inject constructor( * Export the crypto keys * * @param password the password - * @param callback the exported keys + * @return the exported keys */ - override fun exportRoomKeys(password: String, callback: MatrixCallback) { - cryptoCoroutineScope.launch(coroutineDispatchers.main) { - runCatching { - exportRoomKeys(password, MXMegolmExportEncryption.DEFAULT_ITERATION_COUNT) - }.foldToCallback(callback) - } + override suspend fun exportRoomKeys(password: String): ByteArray { + return exportRoomKeys(password, MXMegolmExportEncryption.DEFAULT_ITERATION_COUNT) } /** @@ -963,42 +959,37 @@ internal class DefaultCryptoService @Inject constructor( * @param roomKeysAsArray the room keys as array. * @param password the password * @param progressListener the progress listener - * @param callback the asynchronous callback. + * @return the result ImportRoomKeysResult */ - override fun importRoomKeys(roomKeysAsArray: ByteArray, - password: String, - progressListener: ProgressListener?, - callback: MatrixCallback) { - cryptoCoroutineScope.launch(coroutineDispatchers.main) { - runCatching { - withContext(coroutineDispatchers.crypto) { - Timber.v("## CRYPTO | importRoomKeys starts") + override suspend fun importRoomKeys(roomKeysAsArray: ByteArray, + password: String, + progressListener: ProgressListener?): ImportRoomKeysResult { + return withContext(coroutineDispatchers.crypto) { + Timber.v("## CRYPTO | importRoomKeys starts") - val t0 = System.currentTimeMillis() - val roomKeys = MXMegolmExportEncryption.decryptMegolmKeyFile(roomKeysAsArray, password) - val t1 = System.currentTimeMillis() + val t0 = System.currentTimeMillis() + val roomKeys = MXMegolmExportEncryption.decryptMegolmKeyFile(roomKeysAsArray, password) + val t1 = System.currentTimeMillis() - Timber.v("## CRYPTO | importRoomKeys : decryptMegolmKeyFile done in ${t1 - t0} ms") + Timber.v("## CRYPTO | importRoomKeys : decryptMegolmKeyFile done in ${t1 - t0} ms") - val importedSessions = MoshiProvider.providesMoshi() - .adapter>(Types.newParameterizedType(List::class.java, MegolmSessionData::class.java)) - .fromJson(roomKeys) + val importedSessions = MoshiProvider.providesMoshi() + .adapter>(Types.newParameterizedType(List::class.java, MegolmSessionData::class.java)) + .fromJson(roomKeys) - val t2 = System.currentTimeMillis() + val t2 = System.currentTimeMillis() - Timber.v("## CRYPTO | importRoomKeys : JSON parsing ${t2 - t1} ms") + Timber.v("## CRYPTO | importRoomKeys : JSON parsing ${t2 - t1} ms") - if (importedSessions == null) { - throw Exception("Error") - } + if (importedSessions == null) { + throw Exception("Error") + } - megolmSessionDataImporter.handle( - megolmSessionsData = importedSessions, - fromBackup = false, - progressListener = progressListener - ) - } - }.foldToCallback(callback) + megolmSessionDataImporter.handle( + megolmSessionsData = importedSessions, + fromBackup = false, + progressListener = progressListener + ) } } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt index a29ac457fb..70d2022299 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt @@ -155,7 +155,7 @@ internal class MXMegolmDecryption(private val userId: String, withHeldInfo.code?.value ?: "", withHeldInfo.reason) } else { - // This is un-used in riotX SDK, not sure if needed + // This is un-used in Matrix Android SDK2, not sure if needed // addEventToPendingList(event, timeline) if (requestKeysOnFail) { requestKeysForEvent(event, false) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/secrets/DefaultSharedSecretStorageService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/secrets/DefaultSharedSecretStorageService.kt index 1f80ce2c81..fb10cf4482 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/secrets/DefaultSharedSecretStorageService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/secrets/DefaultSharedSecretStorageService.kt @@ -18,7 +18,7 @@ package org.matrix.android.sdk.internal.crypto.secrets import org.matrix.android.sdk.api.extensions.orFalse import org.matrix.android.sdk.api.listeners.ProgressListener -import org.matrix.android.sdk.api.session.accountdata.AccountDataService +import org.matrix.android.sdk.api.session.accountdata.SessionAccountDataService import org.matrix.android.sdk.api.session.events.model.toContent import org.matrix.android.sdk.api.session.securestorage.EncryptedSecretContent import org.matrix.android.sdk.api.session.securestorage.IntegrityResult @@ -56,7 +56,7 @@ import kotlin.experimental.and internal class DefaultSharedSecretStorageService @Inject constructor( @UserId private val userId: String, - private val accountDataService: AccountDataService, + private val accountDataService: SessionAccountDataService, private val outgoingGossipingRequestManager: OutgoingGossipingRequestManager, private val coroutineDispatchers: MatrixCoroutineDispatchers, private val cryptoCoroutineScope: CoroutineScope @@ -84,7 +84,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor( ) } ?: storageKeyContent - accountDataService.updateAccountData("$KEY_ID_BASE.$keyId", signedContent.toContent()) + accountDataService.updateUserAccountData("$KEY_ID_BASE.$keyId", signedContent.toContent()) SsssKeyCreationInfo( keyId = keyId, content = storageKeyContent, @@ -113,7 +113,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor( ) } ?: storageKeyContent - accountDataService.updateAccountData( + accountDataService.updateUserAccountData( "$KEY_ID_BASE.$keyId", signedContent.toContent() ) @@ -127,11 +127,11 @@ internal class DefaultSharedSecretStorageService @Inject constructor( } override fun hasKey(keyId: String): Boolean { - return accountDataService.getAccountDataEvent("$KEY_ID_BASE.$keyId") != null + return accountDataService.getUserAccountDataEvent("$KEY_ID_BASE.$keyId") != null } override fun getKey(keyId: String): KeyInfoResult { - val accountData = accountDataService.getAccountDataEvent("$KEY_ID_BASE.$keyId") + val accountData = accountDataService.getUserAccountDataEvent("$KEY_ID_BASE.$keyId") ?: return KeyInfoResult.Error(SharedSecretStorageError.UnknownKey(keyId)) return SecretStorageKeyContent.fromJson(accountData.content)?.let { KeyInfoResult.Success( @@ -143,14 +143,14 @@ internal class DefaultSharedSecretStorageService @Inject constructor( override suspend fun setDefaultKey(keyId: String) { val existingKey = getKey(keyId) if (existingKey is KeyInfoResult.Success) { - accountDataService.updateAccountData(DEFAULT_KEY_ID, mapOf("key" to keyId)) + accountDataService.updateUserAccountData(DEFAULT_KEY_ID, mapOf("key" to keyId)) } else { throw SharedSecretStorageError.UnknownKey(keyId) } } override fun getDefaultKey(): KeyInfoResult { - val accountData = accountDataService.getAccountDataEvent(DEFAULT_KEY_ID) + val accountData = accountDataService.getUserAccountDataEvent(DEFAULT_KEY_ID) ?: return KeyInfoResult.Error(SharedSecretStorageError.UnknownKey(DEFAULT_KEY_ID)) val keyId = accountData.content["key"] as? String ?: return KeyInfoResult.Error(SharedSecretStorageError.UnknownKey(DEFAULT_KEY_ID)) @@ -178,7 +178,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor( } } - accountDataService.updateAccountData( + accountDataService.updateUserAccountData( type = name, content = mapOf("encrypted" to encryptedContents) ) @@ -288,7 +288,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor( } override fun getAlgorithmsForSecret(name: String): List { - val accountData = accountDataService.getAccountDataEvent(name) + val accountData = accountDataService.getUserAccountDataEvent(name) ?: return listOf(KeyInfoResult.Error(SharedSecretStorageError.UnknownSecret(name))) val encryptedContent = accountData.content[ENCRYPTED] as? Map<*, *> ?: return listOf(KeyInfoResult.Error(SharedSecretStorageError.SecretNotEncrypted(name))) @@ -303,7 +303,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor( } override suspend fun getSecret(name: String, keyId: String?, secretKey: SsssKeySpec): String { - val accountData = accountDataService.getAccountDataEvent(name) ?: throw SharedSecretStorageError.UnknownSecret(name) + val accountData = accountDataService.getUserAccountDataEvent(name) ?: throw SharedSecretStorageError.UnknownSecret(name) val encryptedContent = accountData.content[ENCRYPTED] as? Map<*, *> ?: throw SharedSecretStorageError.SecretNotEncrypted(name) val key = keyId?.let { getKey(it) } as? KeyInfoResult.Success ?: getDefaultKey() as? KeyInfoResult.Success ?: throw SharedSecretStorageError.UnknownKey(name) @@ -368,7 +368,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor( } secretNames.forEach { secretName -> - val secretEvent = accountDataService.getAccountDataEvent(secretName) + val secretEvent = accountDataService.getUserAccountDataEvent(secretName) ?: return IntegrityResult.Error(SharedSecretStorageError.UnknownSecret(secretName)) if ((secretEvent.content["encrypted"] as? Map<*, *>)?.get(keyInfo.id) == null) { return IntegrityResult.Error(SharedSecretStorageError.SecretNotEncryptedWithKey(secretName, keyInfo.id)) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/mapper/AccountDataMapper.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/mapper/AccountDataMapper.kt index 4edfdad897..dca0f927ad 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/mapper/AccountDataMapper.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/database/mapper/AccountDataMapper.kt @@ -17,7 +17,8 @@ package org.matrix.android.sdk.internal.database.mapper import com.squareup.moshi.Moshi -import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent +import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent +import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataEvent import org.matrix.android.sdk.api.util.JSON_DICT_PARAMETERIZED_TYPE import org.matrix.android.sdk.internal.database.model.RoomAccountDataEntity import org.matrix.android.sdk.internal.database.model.UserAccountDataEntity @@ -27,15 +28,16 @@ internal class AccountDataMapper @Inject constructor(moshi: Moshi) { private val adapter = moshi.adapter>(JSON_DICT_PARAMETERIZED_TYPE) - fun map(entity: UserAccountDataEntity): AccountDataEvent { - return AccountDataEvent( + fun map(entity: UserAccountDataEntity): UserAccountDataEvent { + return UserAccountDataEvent( type = entity.type ?: "", content = entity.contentStr?.let { adapter.fromJson(it) }.orEmpty() ) } - fun map(entity: RoomAccountDataEntity): AccountDataEvent { - return AccountDataEvent( + fun map(roomId: String, entity: RoomAccountDataEntity): RoomAccountDataEvent { + return RoomAccountDataEvent( + roomId = roomId, type = entity.type ?: "", content = entity.contentStr?.let { adapter.fromJson(it) }.orEmpty() ) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/DefaultLegacySessionImporter.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/DefaultLegacySessionImporter.kt index e0e2f96fa9..4586cfea1e 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/DefaultLegacySessionImporter.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/legacy/DefaultLegacySessionImporter.kt @@ -153,7 +153,7 @@ internal class DefaultLegacySessionImporter @Inject constructor( } private fun importCryptoDb(legacyConfig: LegacyHomeServerConnectionConfig) { - // Here we migrate the DB, we copy the crypto DB to the location specific to RiotX, and we encrypt it. + // Here we migrate the DB, we copy the crypto DB to the location specific to Matrix SDK2, and we encrypt it. val userMd5 = legacyConfig.credentials.userId.md5() val sessionId = legacyConfig.credentials.let { (if (it.deviceId.isNullOrBlank()) it.userId else "${it.userId}|${it.deviceId}").md5() } @@ -177,12 +177,12 @@ internal class DefaultLegacySessionImporter @Inject constructor( Timber.d("Migration: copy DB to encrypted DB") Realm.getInstance(realmConfiguration).use { - // Move the DB to the new location, handled by RiotX + // Move the DB to the new location, handled by Matrix SDK2 it.writeEncryptedCopyTo(File(newLocation, realmConfiguration.realmFileName), realmKeysUtils.getRealmEncryptionKey(keyAlias)) } } - // Delete all the files created by Riot Android which will not be used anymore by RiotX + // Delete all the files created by Riot Android which will not be used anymore by Element private fun clearFileSystem(legacyConfig: LegacyHomeServerConnectionConfig) { val cryptoFolder = legacyConfig.credentials.userId.md5() diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/UserAgentHolder.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/UserAgentHolder.kt index 973c120f59..1a88404128 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/UserAgentHolder.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/UserAgentHolder.kt @@ -36,7 +36,7 @@ internal class UserAgentHolder @Inject constructor(private val context: Context, /** * Create an user agent with the application version. - * Ex: RiotX/1.0.0 (Linux; U; Android 6.0.1; SM-A510F Build/MMB29; Flavour GPlay; MatrixAndroidSDK_X 1.0) + * Ex: Element/1.0.0 (Linux; U; Android 6.0.1; SM-A510F Build/MMB29; Flavour GPlay; MatrixAndroidSDK_X 1.0) * * @param flavorDescription the flavor description */ diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/DefaultSession.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/DefaultSession.kt index 1f47978198..1cf99bbbd7 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/DefaultSession.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/DefaultSession.kt @@ -29,7 +29,7 @@ import org.matrix.android.sdk.api.pushrules.PushRuleService import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.SessionLifecycleObserver import org.matrix.android.sdk.api.session.account.AccountService -import org.matrix.android.sdk.api.session.accountdata.AccountDataService +import org.matrix.android.sdk.api.session.accountdata.SessionAccountDataService import org.matrix.android.sdk.api.session.cache.CacheService import org.matrix.android.sdk.api.session.call.CallSignalingService import org.matrix.android.sdk.api.session.content.ContentUploadStateTracker @@ -74,7 +74,6 @@ import org.matrix.android.sdk.internal.session.identity.DefaultIdentityService import org.matrix.android.sdk.internal.session.sync.SyncTokenStore import org.matrix.android.sdk.internal.session.sync.job.SyncThread import org.matrix.android.sdk.internal.session.sync.job.SyncWorker -import org.matrix.android.sdk.internal.session.user.accountdata.UserAccountDataService import org.matrix.android.sdk.internal.util.createUIHandler import timber.log.Timber import javax.inject.Inject @@ -118,7 +117,7 @@ internal class DefaultSession @Inject constructor( private val contentDownloadStateTracker: ContentDownloadStateTracker, private val initialSyncProgressService: Lazy, private val homeServerCapabilitiesService: Lazy, - private val accountDataService: Lazy, + private val accountDataService: Lazy, private val _sharedSecretStorageService: Lazy, private val accountService: Lazy, private val eventService: Lazy, @@ -293,7 +292,7 @@ internal class DefaultSession @Inject constructor( override fun openIdService(): OpenIdService = openIdService.get() - override fun userAccountDataService(): AccountDataService = accountDataService.get() + override fun accountDataService(): SessionAccountDataService = accountDataService.get() override fun getOkHttpClient(): OkHttpClient { return unauthenticatedWithCertificateOkHttpClient.get() diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/SessionModule.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/SessionModule.kt index 49ce92372e..e6da21315b 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/SessionModule.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/SessionModule.kt @@ -34,7 +34,7 @@ import org.matrix.android.sdk.api.auth.data.sessionId import org.matrix.android.sdk.api.crypto.MXCryptoConfig import org.matrix.android.sdk.api.session.Session import org.matrix.android.sdk.api.session.SessionLifecycleObserver -import org.matrix.android.sdk.api.session.accountdata.AccountDataService +import org.matrix.android.sdk.api.session.accountdata.SessionAccountDataService import org.matrix.android.sdk.api.session.events.EventService import org.matrix.android.sdk.api.session.homeserver.HomeServerCapabilitiesService import org.matrix.android.sdk.api.session.initsync.InitialSyncProgressService @@ -93,7 +93,7 @@ import org.matrix.android.sdk.internal.session.room.send.queue.EventSenderProces import org.matrix.android.sdk.internal.session.room.tombstone.RoomTombstoneEventProcessor import org.matrix.android.sdk.internal.session.securestorage.DefaultSecureStorageService import org.matrix.android.sdk.internal.session.typing.DefaultTypingUsersTracker -import org.matrix.android.sdk.internal.session.user.accountdata.UserAccountDataService +import org.matrix.android.sdk.internal.session.user.accountdata.DefaultSessionAccountDataService import org.matrix.android.sdk.internal.session.widgets.DefaultWidgetURLFormatter import org.matrix.android.sdk.internal.util.md5 import retrofit2.Retrofit @@ -364,7 +364,7 @@ internal abstract class SessionModule { abstract fun bindHomeServerCapabilitiesService(service: DefaultHomeServerCapabilitiesService): HomeServerCapabilitiesService @Binds - abstract fun bindAccountDataService(service: UserAccountDataService): AccountDataService + abstract fun bindSessionAccountDataService(service: DefaultSessionAccountDataService): SessionAccountDataService @Binds abstract fun bindEventService(service: DefaultEventService): EventService diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/integrationmanager/IntegrationManager.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/integrationmanager/IntegrationManager.kt index f79f8084a8..aa82cf9222 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/integrationmanager/IntegrationManager.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/integrationmanager/IntegrationManager.kt @@ -33,7 +33,7 @@ import org.matrix.android.sdk.internal.extensions.observeNotNull import org.matrix.android.sdk.api.session.SessionLifecycleObserver import org.matrix.android.sdk.internal.session.SessionScope import org.matrix.android.sdk.api.session.accountdata.UserAccountDataTypes -import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent +import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent import org.matrix.android.sdk.internal.session.user.accountdata.UserAccountDataDataSource import org.matrix.android.sdk.internal.session.user.accountdata.UpdateUserAccountDataTask import org.matrix.android.sdk.internal.session.widgets.helper.WidgetFactory @@ -240,7 +240,7 @@ internal class IntegrationManager @Inject constructor(matrixConfiguration: Matri ) } - private fun AccountDataEvent.asIntegrationManagerWidgetContent(): WidgetContent? { + private fun UserAccountDataEvent.asIntegrationManagerWidgetContent(): WidgetContent? { return extractWidgetSequence(widgetFactory) .filter { WidgetType.IntegrationManager == it.type diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/DefaultRoom.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/DefaultRoom.kt index 5a2eef7e8a..0d9c106d41 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/DefaultRoom.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/DefaultRoom.kt @@ -17,10 +17,10 @@ package org.matrix.android.sdk.internal.session.room import androidx.lifecycle.LiveData -import org.matrix.android.sdk.api.session.accountdata.AccountDataService import org.matrix.android.sdk.api.session.crypto.CryptoService import org.matrix.android.sdk.api.session.events.model.EventType import org.matrix.android.sdk.api.session.room.Room +import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataService 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.members.MembershipService @@ -42,7 +42,6 @@ import org.matrix.android.sdk.api.session.space.Space import org.matrix.android.sdk.api.util.Optional import org.matrix.android.sdk.internal.crypto.MXCRYPTO_ALGORITHM_MEGOLM import org.matrix.android.sdk.internal.session.permalinks.ViaParameterFinder -import org.matrix.android.sdk.internal.session.room.accountdata.RoomAccountDataService import org.matrix.android.sdk.internal.session.room.state.SendStateTask import org.matrix.android.sdk.internal.session.room.summary.RoomSummaryDataSource import org.matrix.android.sdk.internal.session.search.SearchTask @@ -86,7 +85,7 @@ internal class DefaultRoom(override val roomId: String, RelationService by relationService, MembershipService by roomMembersService, RoomPushRuleService by roomPushRuleService, - AccountDataService by roomAccountDataService { + RoomAccountDataService by roomAccountDataService { override fun getRoomSummaryLive(): LiveData> { return roomSummaryDataSource.getRoomSummaryLive(roomId) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomFactory.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomFactory.kt index 8efbf2360a..9ddb8f1177 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomFactory.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/RoomFactory.kt @@ -19,8 +19,8 @@ package org.matrix.android.sdk.internal.session.room import org.matrix.android.sdk.api.session.crypto.CryptoService import org.matrix.android.sdk.api.session.room.Room import org.matrix.android.sdk.internal.session.SessionScope -import org.matrix.android.sdk.internal.session.room.accountdata.RoomAccountDataService import org.matrix.android.sdk.internal.session.permalinks.ViaParameterFinder +import org.matrix.android.sdk.internal.session.room.accountdata.DefaultRoomAccountDataService import org.matrix.android.sdk.internal.session.room.alias.DefaultAliasService import org.matrix.android.sdk.internal.session.room.call.DefaultRoomCallService import org.matrix.android.sdk.internal.session.room.draft.DefaultDraftService @@ -61,7 +61,7 @@ internal class DefaultRoomFactory @Inject constructor(private val cryptoService: private val relationServiceFactory: DefaultRelationService.Factory, private val membershipServiceFactory: DefaultMembershipService.Factory, private val roomPushRuleServiceFactory: DefaultRoomPushRuleService.Factory, - private val roomAccountDataServiceFactory: RoomAccountDataService.Factory, + private val roomAccountDataServiceFactory: DefaultRoomAccountDataService.Factory, private val sendStateTask: SendStateTask, private val viaParameterFinder: ViaParameterFinder, private val searchTask: SearchTask) : diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/accountdata/RoomAccountDataService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/accountdata/DefaultRoomAccountDataService.kt similarity index 78% rename from matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/accountdata/RoomAccountDataService.kt rename to matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/accountdata/DefaultRoomAccountDataService.kt index 9e9e9dc322..d43c1d3217 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/accountdata/RoomAccountDataService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/accountdata/DefaultRoomAccountDataService.kt @@ -20,34 +20,34 @@ import androidx.lifecycle.LiveData import dagger.assisted.Assisted import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject -import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent -import org.matrix.android.sdk.api.session.accountdata.AccountDataService import org.matrix.android.sdk.api.session.events.model.Content +import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataEvent +import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataService import org.matrix.android.sdk.api.util.Optional -internal class RoomAccountDataService @AssistedInject constructor(@Assisted private val roomId: String, +internal class DefaultRoomAccountDataService @AssistedInject constructor(@Assisted private val roomId: String, private val dataSource: RoomAccountDataDataSource, private val updateRoomAccountDataTask: UpdateRoomAccountDataTask -) : AccountDataService { +) : RoomAccountDataService { @AssistedFactory interface Factory { - fun create(roomId: String): RoomAccountDataService + fun create(roomId: String): DefaultRoomAccountDataService } - override fun getAccountDataEvent(type: String): AccountDataEvent? { + override fun getAccountDataEvent(type: String): RoomAccountDataEvent? { return dataSource.getAccountDataEvent(roomId, type) } - override fun getLiveAccountDataEvent(type: String): LiveData> { + override fun getLiveAccountDataEvent(type: String): LiveData> { return dataSource.getLiveAccountDataEvent(roomId, type) } - override fun getAccountDataEvents(types: Set): List { + override fun getAccountDataEvents(types: Set): List { return dataSource.getAccountDataEvents(roomId, types) } - override fun getLiveAccountDataEvents(types: Set): LiveData> { + override fun getLiveAccountDataEvents(types: Set): LiveData> { return dataSource.getLiveAccountDataEvents(roomId, types) } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/accountdata/RoomAccountDataDataSource.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/accountdata/RoomAccountDataDataSource.kt index 0bcf9d7f38..0e4493846c 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/accountdata/RoomAccountDataDataSource.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/accountdata/RoomAccountDataDataSource.kt @@ -20,14 +20,16 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.MediatorLiveData import androidx.lifecycle.Transformations import com.zhuinden.monarchy.Monarchy -import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent +import io.realm.Realm +import io.realm.RealmQuery +import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataEvent import org.matrix.android.sdk.api.util.Optional import org.matrix.android.sdk.api.util.toOptional import org.matrix.android.sdk.internal.database.RealmSessionProvider import org.matrix.android.sdk.internal.database.mapper.AccountDataMapper import org.matrix.android.sdk.internal.database.model.RoomAccountDataEntityFields import org.matrix.android.sdk.internal.database.model.RoomEntity -import org.matrix.android.sdk.internal.database.query.where +import org.matrix.android.sdk.internal.database.model.RoomEntityFields import org.matrix.android.sdk.internal.di.SessionDatabase import javax.inject.Inject @@ -35,43 +37,62 @@ internal class RoomAccountDataDataSource @Inject constructor(@SessionDatabase pr private val realmSessionProvider: RealmSessionProvider, private val accountDataMapper: AccountDataMapper) { - fun getAccountDataEvent(roomId: String, type: String): AccountDataEvent? { + fun getAccountDataEvent(roomId: String, type: String): RoomAccountDataEvent? { return getAccountDataEvents(roomId, setOf(type)).firstOrNull() } - fun getLiveAccountDataEvent(roomId: String, type: String): LiveData> { + fun getLiveAccountDataEvent(roomId: String, type: String): LiveData> { return Transformations.map(getLiveAccountDataEvents(roomId, setOf(type))) { it.firstOrNull()?.toOptional() } } - fun getAccountDataEvents(roomId: String, types: Set): List { + /** + * @param roomId the roomId to search for account data event. If null will check in every room. + * @param types the types to filter. If empty will return all account data event in given room (or every room if roomId is null) + * + */ + fun getAccountDataEvents(roomId: String?, types: Set): List { return realmSessionProvider.withRealm { realm -> - val roomEntity = RoomEntity.where(realm, roomId).findFirst() ?: return@withRealm emptyList() + val roomEntity = buildRoomQuery(realm, roomId, types).findFirst() ?: return@withRealm emptyList() roomEntity.accountDataEvents(types) } } - fun getLiveAccountDataEvents(roomId: String, types: Set): LiveData> { - val liveRoomEntity = monarchy.findAllManagedWithChanges { RoomEntity.where(it, roomId) } - val resultLiveData = MediatorLiveData>() - resultLiveData.addSource(liveRoomEntity) { - val roomEntity = it.realmResults.firstOrNull() - if (roomEntity == null) { - resultLiveData.postValue(emptyList()) - } else { - val mappedResult = roomEntity.accountDataEvents(types) - resultLiveData.postValue(mappedResult) - } + /** + * @param roomId the roomId to search for account data event. If null will check in every room. + * @param types the types to filter. If empty will return all account data event in the given room (or every room if roomId is null). + * + */ + fun getLiveAccountDataEvents(roomId: String?, types: Set): LiveData> { + val liveRoomEntity = monarchy.findAllManagedWithChanges { + buildRoomQuery(it, roomId, types) + } + val resultLiveData = MediatorLiveData>() + resultLiveData.addSource(liveRoomEntity) { changeSet -> + val mappedResult = changeSet.realmResults.flatMap { it.accountDataEvents(types) } + resultLiveData.postValue(mappedResult) } return resultLiveData } - private fun RoomEntity.accountDataEvents(types: Set): List { + private fun buildRoomQuery(realm: Realm, roomId: String?, types: Set): RealmQuery { + val query = realm.where(RoomEntity::class.java) + if (roomId != null) { + query.equalTo(RoomEntityFields.ROOM_ID, roomId) + } + query.isNotEmpty(RoomEntityFields.ACCOUNT_DATA.`$`) + if (types.isNotEmpty()) { + query.`in`(RoomEntityFields.ACCOUNT_DATA.TYPE, types.toTypedArray()) + } + return query + } + + private fun RoomEntity.accountDataEvents(types: Set): List { val query = accountData.where() if (types.isNotEmpty()) { query.`in`(RoomAccountDataEntityFields.TYPE, types.toTypedArray()) } - return query.findAll().map { accountDataMapper.map(it) } + return query.findAll().map { accountDataMapper.map(roomId, it) } } } diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/DefaultTimeline.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/DefaultTimeline.kt index e230599f8f..8cc5d943b7 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/DefaultTimeline.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/timeline/DefaultTimeline.kt @@ -24,7 +24,6 @@ import io.realm.RealmQuery import io.realm.RealmResults import io.realm.Sort import org.matrix.android.sdk.api.MatrixCallback -import org.matrix.android.sdk.api.NoOpMatrixCallback import org.matrix.android.sdk.api.extensions.orFalse import org.matrix.android.sdk.api.extensions.tryOrNull import org.matrix.android.sdk.api.session.events.model.EventType @@ -168,9 +167,7 @@ internal class DefaultTimeline( timelineEvents.addChangeListener(eventsChangeListener) handleInitialLoad() loadRoomMembersTask - .configureWith(LoadRoomMembersTask.Params(roomId)) { - this.callback = NoOpMatrixCallback() - } + .configureWith(LoadRoomMembersTask.Params(roomId)) .executeBy(taskExecutor) // Ensure ReadReceipt from init sync are loaded diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/typing/DefaultTypingService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/typing/DefaultTypingService.kt index 39b7967bc1..b76829e893 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/typing/DefaultTypingService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/typing/DefaultTypingService.kt @@ -18,13 +18,13 @@ package org.matrix.android.sdk.internal.session.room.typing import android.os.SystemClock import dagger.assisted.Assisted -import dagger.assisted.AssistedInject import dagger.assisted.AssistedFactory -import org.matrix.android.sdk.api.MatrixCallback +import dagger.assisted.AssistedInject +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Job +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch import org.matrix.android.sdk.api.session.room.typing.TypingService -import org.matrix.android.sdk.api.util.Cancelable -import org.matrix.android.sdk.internal.task.TaskExecutor -import org.matrix.android.sdk.internal.task.configureWith import timber.log.Timber /** @@ -35,7 +35,6 @@ import timber.log.Timber */ internal class DefaultTypingService @AssistedInject constructor( @Assisted private val roomId: String, - private val taskExecutor: TaskExecutor, private val sendTypingTask: SendTypingTask ) : TypingService { @@ -44,8 +43,8 @@ internal class DefaultTypingService @AssistedInject constructor( fun create(roomId: String): DefaultTypingService } - private var currentTask: Cancelable? = null - private var currentAutoStopTask: Cancelable? = null + private val coroutineScope = CoroutineScope(Job()) + private var currentTask: Job? = null // What the homeserver knows private var userIsTyping = false @@ -53,26 +52,24 @@ internal class DefaultTypingService @AssistedInject constructor( // Last time the user is typing event has been sent private var lastRequestTimestamp: Long = 0 + /** + * Notify to the server that the user is typing and schedule the auto typing off + */ override fun userIsTyping() { - scheduleAutoStop() - val now = SystemClock.elapsedRealtime() - - if (userIsTyping && now < lastRequestTimestamp + MIN_DELAY_BETWEEN_TWO_USER_IS_TYPING_REQUESTS_MILLIS) { - Timber.d("Typing: Skip start request") - return - } - - Timber.d("Typing: Send start request") - userIsTyping = true - lastRequestTimestamp = now - currentTask?.cancel() - - val params = SendTypingTask.Params(roomId, true) - currentTask = sendTypingTask - .configureWith(params) - .executeBy(taskExecutor) + currentTask = coroutineScope.launch { + if (userIsTyping && now < lastRequestTimestamp + MIN_DELAY_BETWEEN_TWO_USER_IS_TYPING_REQUESTS_MILLIS) { + Timber.d("Typing: Skip start request") + } else { + Timber.d("Typing: Send start request") + lastRequestTimestamp = now + sendRequest(true) + } + delay(MIN_DELAY_TO_SEND_STOP_TYPING_REQUEST_WHEN_NO_USER_ACTIVITY_MILLIS) + Timber.d("Typing: auto stop") + sendRequest(false) + } } override fun userStopsTyping() { @@ -82,35 +79,22 @@ internal class DefaultTypingService @AssistedInject constructor( } Timber.d("Typing: Send stop request") - userIsTyping = false lastRequestTimestamp = 0 - currentAutoStopTask?.cancel() currentTask?.cancel() - - val params = SendTypingTask.Params(roomId, false) - currentTask = sendTypingTask - .configureWith(params) - .executeBy(taskExecutor) + currentTask = coroutineScope.launch { + sendRequest(false) + } } - private fun scheduleAutoStop() { - Timber.d("Typing: Schedule auto stop") - currentAutoStopTask?.cancel() - - val params = SendTypingTask.Params( - roomId, - false, - delay = MIN_DELAY_TO_SEND_STOP_TYPING_REQUEST_WHEN_NO_USER_ACTIVITY_MILLIS) - currentAutoStopTask = sendTypingTask - .configureWith(params) { - callback = object : MatrixCallback { - override fun onSuccess(data: Unit) { - userIsTyping = false - } - } - } - .executeBy(taskExecutor) + private suspend fun sendRequest(isTyping: Boolean) { + try { + sendTypingTask.execute(SendTypingTask.Params(roomId, isTyping)) + userIsTyping = isTyping + } catch (failure: Throwable) { + // Ignore network error, etc... + Timber.w(failure, "Unable to send typing request") + } } companion object { diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/typing/SendTypingTask.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/typing/SendTypingTask.kt index 0b0df74311..0bdceb9ade 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/typing/SendTypingTask.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/room/typing/SendTypingTask.kt @@ -17,11 +17,10 @@ package org.matrix.android.sdk.internal.session.room.typing import org.matrix.android.sdk.internal.di.UserId +import org.matrix.android.sdk.internal.network.GlobalErrorReceiver import org.matrix.android.sdk.internal.network.executeRequest import org.matrix.android.sdk.internal.session.room.RoomAPI import org.matrix.android.sdk.internal.task.Task -import kotlinx.coroutines.delay -import org.matrix.android.sdk.internal.network.GlobalErrorReceiver import javax.inject.Inject internal interface SendTypingTask : Task { @@ -29,9 +28,7 @@ internal interface SendTypingTask : Task { data class Params( val roomId: String, val isTyping: Boolean, - val typingTimeoutMillis: Int? = 30_000, - // Optional delay before sending the request to the homeserver - val delay: Long? = null + val typingTimeoutMillis: Int? = 30_000 ) } @@ -42,8 +39,6 @@ internal class DefaultSendTypingTask @Inject constructor( ) : SendTypingTask { override suspend fun execute(params: SendTypingTask.Params) { - delay(params.delay ?: -1) - executeRequest(globalErrorReceiver) { roomAPI.sendTypingState( params.roomId, diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/UserAccountDataSyncHandler.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/UserAccountDataSyncHandler.kt index 3aebd90ed2..b8d987d500 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/UserAccountDataSyncHandler.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/UserAccountDataSyncHandler.kt @@ -23,7 +23,7 @@ import io.realm.kotlin.where import org.matrix.android.sdk.api.pushrules.RuleScope import org.matrix.android.sdk.api.pushrules.RuleSetKey import org.matrix.android.sdk.api.pushrules.rest.GetPushRulesResponse -import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent +import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent import org.matrix.android.sdk.api.session.accountdata.UserAccountDataTypes import org.matrix.android.sdk.api.session.events.model.Content import org.matrix.android.sdk.api.session.events.model.toModel @@ -113,7 +113,7 @@ internal class UserAccountDataSyncHandler @Inject constructor( } } - private fun handlePushRules(realm: Realm, event: AccountDataEvent) { + private fun handlePushRules(realm: Realm, event: UserAccountDataEvent) { val pushRules = event.content.toModel() ?: return realm.where(PushRulesEntity::class.java) .findAll() @@ -155,7 +155,7 @@ internal class UserAccountDataSyncHandler @Inject constructor( realm.insertOrUpdate(underrides) } - private fun handleDirectChatRooms(realm: Realm, event: AccountDataEvent) { + private fun handleDirectChatRooms(realm: Realm, event: UserAccountDataEvent) { val content = event.content.toModel() ?: return content.forEach { (userId, roomIds) -> roomIds.forEach { roomId -> @@ -181,7 +181,7 @@ internal class UserAccountDataSyncHandler @Inject constructor( } } - private fun handleIgnoredUsers(realm: Realm, event: AccountDataEvent) { + private fun handleIgnoredUsers(realm: Realm, event: UserAccountDataEvent) { val userIds = event.content.toModel()?.ignoredUsers?.keys ?: return realm.where(IgnoredUserEntity::class.java) .findAll() @@ -191,7 +191,7 @@ internal class UserAccountDataSyncHandler @Inject constructor( // TODO If not initial sync, we should execute a init sync } - private fun handleBreadcrumbs(realm: Realm, event: AccountDataEvent) { + private fun handleBreadcrumbs(realm: Realm, event: UserAccountDataEvent) { val recentRoomIds = event.content.toModel()?.recentRoomIds ?: return val entity = BreadcrumbsEntity.getOrCreate(realm) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/model/accountdata/UserAccountDataSync.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/model/accountdata/UserAccountDataSync.kt index ddb71cd19f..05b50ab2c5 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/model/accountdata/UserAccountDataSync.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/model/accountdata/UserAccountDataSync.kt @@ -18,9 +18,9 @@ package org.matrix.android.sdk.internal.session.sync.model.accountdata import com.squareup.moshi.Json import com.squareup.moshi.JsonClass -import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent +import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent @JsonClass(generateAdapter = true) internal data class UserAccountDataSync( - @Json(name = "events") val list: List = emptyList() + @Json(name = "events") val list: List = emptyList() ) diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/parsing/RoomSyncAccountDataHandler.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/parsing/RoomSyncAccountDataHandler.kt index c8aab586a0..8bf9ad5b90 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/parsing/RoomSyncAccountDataHandler.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/parsing/RoomSyncAccountDataHandler.kt @@ -56,7 +56,6 @@ internal class RoomSyncAccountDataHandler @Inject constructor(private val roomTa private fun handleGeneric(roomEntity: RoomEntity, content: JsonDict?, eventType: String) { val existing = roomEntity.accountData.where().equalTo(RoomAccountDataEntityFields.TYPE, eventType).findFirst() if (existing != null) { - // Update current value existing.contentStr = ContentMapper.map(content) } else { val roomAccountData = RoomAccountDataEntity( diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UserAccountDataService.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/DefaultSessionAccountDataService.kt similarity index 55% rename from matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UserAccountDataService.kt rename to matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/DefaultSessionAccountDataService.kt index b15d1d0f8b..ff1750ce8e 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UserAccountDataService.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/DefaultSessionAccountDataService.kt @@ -18,42 +18,53 @@ package org.matrix.android.sdk.internal.session.user.accountdata import androidx.lifecycle.LiveData import com.zhuinden.monarchy.Monarchy -import org.matrix.android.sdk.api.session.accountdata.AccountDataService +import org.matrix.android.sdk.api.session.accountdata.SessionAccountDataService import org.matrix.android.sdk.api.session.events.model.Content import org.matrix.android.sdk.api.util.Optional import org.matrix.android.sdk.internal.di.SessionDatabase import org.matrix.android.sdk.internal.session.sync.UserAccountDataSyncHandler -import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent +import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent +import org.matrix.android.sdk.api.session.room.accountdata.RoomAccountDataEvent +import org.matrix.android.sdk.internal.session.room.accountdata.RoomAccountDataDataSource import org.matrix.android.sdk.internal.task.TaskExecutor import org.matrix.android.sdk.internal.task.configureWith import org.matrix.android.sdk.internal.util.awaitCallback import javax.inject.Inject -internal class UserAccountDataService @Inject constructor( +internal class DefaultSessionAccountDataService @Inject constructor( @SessionDatabase private val monarchy: Monarchy, private val updateUserAccountDataTask: UpdateUserAccountDataTask, private val userAccountDataSyncHandler: UserAccountDataSyncHandler, - private val accountDataDataSource: UserAccountDataDataSource, + private val userAccountDataDataSource: UserAccountDataDataSource, + private val roomAccountDataDataSource: RoomAccountDataDataSource, private val taskExecutor: TaskExecutor -) : AccountDataService { +) : SessionAccountDataService { - override fun getAccountDataEvent(type: String): AccountDataEvent? { - return accountDataDataSource.getAccountDataEvent(type) + override fun getUserAccountDataEvent(type: String): UserAccountDataEvent? { + return userAccountDataDataSource.getAccountDataEvent(type) } - override fun getLiveAccountDataEvent(type: String): LiveData> { - return accountDataDataSource.getLiveAccountDataEvent(type) + override fun getLiveUserAccountDataEvent(type: String): LiveData> { + return userAccountDataDataSource.getLiveAccountDataEvent(type) } - override fun getAccountDataEvents(types: Set): List { - return accountDataDataSource.getAccountDataEvents(types) + override fun getUserAccountDataEvents(types: Set): List { + return userAccountDataDataSource.getAccountDataEvents(types) } - override fun getLiveAccountDataEvents(types: Set): LiveData> { - return accountDataDataSource.getLiveAccountDataEvents(types) + override fun getLiveUserAccountDataEvents(types: Set): LiveData> { + return userAccountDataDataSource.getLiveAccountDataEvents(types) } - override suspend fun updateAccountData(type: String, content: Content) { + override fun getRoomAccountDataEvents(types: Set): List { + return roomAccountDataDataSource.getAccountDataEvents(null, types) + } + + override fun getLiveRoomAccountDataEvents(types: Set): LiveData> { + return roomAccountDataDataSource.getLiveAccountDataEvents(null, types) + } + + override suspend fun updateUserAccountData(type: String, content: Content) { val params = UpdateUserAccountDataTask.AnyParams(type = type, any = content) awaitCallback { callback -> updateUserAccountDataTask.configureWith(params) { diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UserAccountDataDataSource.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UserAccountDataDataSource.kt index f64b1bdd2e..b36bdc80f8 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UserAccountDataDataSource.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/user/accountdata/UserAccountDataDataSource.kt @@ -21,7 +21,7 @@ import androidx.lifecycle.Transformations import com.zhuinden.monarchy.Monarchy import io.realm.Realm import io.realm.RealmQuery -import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent +import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent import org.matrix.android.sdk.api.util.Optional import org.matrix.android.sdk.api.util.toOptional import org.matrix.android.sdk.internal.database.RealmSessionProvider @@ -35,23 +35,23 @@ internal class UserAccountDataDataSource @Inject constructor(@SessionDatabase pr private val realmSessionProvider: RealmSessionProvider, private val accountDataMapper: AccountDataMapper) { - fun getAccountDataEvent(type: String): AccountDataEvent? { + fun getAccountDataEvent(type: String): UserAccountDataEvent? { return getAccountDataEvents(setOf(type)).firstOrNull() } - fun getLiveAccountDataEvent(type: String): LiveData> { + fun getLiveAccountDataEvent(type: String): LiveData> { return Transformations.map(getLiveAccountDataEvents(setOf(type))) { it.firstOrNull()?.toOptional() } } - fun getAccountDataEvents(types: Set): List { + fun getAccountDataEvents(types: Set): List { return realmSessionProvider.withRealm { accountDataEventsQuery(it, types).findAll().map(accountDataMapper::map) } } - fun getLiveAccountDataEvents(types: Set): LiveData> { + fun getLiveAccountDataEvents(types: Set): LiveData> { return monarchy.findAllMappedWithChanges( { accountDataEventsQuery(it, types) }, accountDataMapper::map diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/widgets/WidgetManager.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/widgets/WidgetManager.kt index ca1a129da7..e0f43a11c5 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/widgets/WidgetManager.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/widgets/WidgetManager.kt @@ -23,7 +23,7 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.Transformations import org.matrix.android.sdk.api.query.QueryStringValue import org.matrix.android.sdk.api.session.Session -import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent +import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent import org.matrix.android.sdk.api.session.accountdata.UserAccountDataTypes import org.matrix.android.sdk.api.session.events.model.Content import org.matrix.android.sdk.api.session.events.model.Event @@ -47,7 +47,7 @@ import javax.inject.Inject @SessionScope internal class WidgetManager @Inject constructor(private val integrationManager: IntegrationManager, - private val accountDataDataSource: UserAccountDataDataSource, + private val userAccountDataDataSource: UserAccountDataDataSource, private val stateEventDataSource: StateEventDataSource, private val createWidgetTask: CreateWidgetTask, private val widgetFactory: WidgetFactory, @@ -136,7 +136,7 @@ internal class WidgetManager @Inject constructor(private val integrationManager: widgetTypes: Set? = null, excludedTypes: Set? = null ): LiveData> { - val widgetsAccountData = accountDataDataSource.getLiveAccountDataEvent(UserAccountDataTypes.TYPE_WIDGETS) + val widgetsAccountData = userAccountDataDataSource.getLiveAccountDataEvent(UserAccountDataTypes.TYPE_WIDGETS) return Transformations.map(widgetsAccountData) { it.getOrNull()?.mapToWidgets(widgetTypes, excludedTypes).orEmpty() } @@ -146,12 +146,12 @@ internal class WidgetManager @Inject constructor(private val integrationManager: widgetTypes: Set? = null, excludedTypes: Set? = null ): List { - val widgetsAccountData = accountDataDataSource.getAccountDataEvent(UserAccountDataTypes.TYPE_WIDGETS) ?: return emptyList() + val widgetsAccountData = userAccountDataDataSource.getAccountDataEvent(UserAccountDataTypes.TYPE_WIDGETS) ?: return emptyList() return widgetsAccountData.mapToWidgets(widgetTypes, excludedTypes) } - private fun AccountDataEvent.mapToWidgets(widgetTypes: Set? = null, - excludedTypes: Set? = null): List { + private fun UserAccountDataEvent.mapToWidgets(widgetTypes: Set? = null, + excludedTypes: Set? = null): List { return extractWidgetSequence(widgetFactory) .filter { val widgetType = it.widgetContent.type ?: return@filter false diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/widgets/helper/UserAccountWidgets.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/widgets/helper/UserAccountWidgets.kt index 5aa32d5a31..6f423b38a0 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/widgets/helper/UserAccountWidgets.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/widgets/helper/UserAccountWidgets.kt @@ -19,10 +19,10 @@ package org.matrix.android.sdk.internal.session.widgets.helper import org.matrix.android.sdk.api.session.events.model.Event import org.matrix.android.sdk.api.session.events.model.toModel import org.matrix.android.sdk.api.util.JsonDict -import org.matrix.android.sdk.api.session.accountdata.AccountDataEvent +import org.matrix.android.sdk.api.session.accountdata.UserAccountDataEvent import org.matrix.android.sdk.api.session.widgets.model.Widget -internal fun AccountDataEvent.extractWidgetSequence(widgetFactory: WidgetFactory): Sequence { +internal fun UserAccountDataEvent.extractWidgetSequence(widgetFactory: WidgetFactory): Sequence { return content.asSequence() .mapNotNull { @Suppress("UNCHECKED_CAST") diff --git a/newsfragment/2449.feature b/newsfragment/2449.feature new file mode 100644 index 0000000000..7fca1730b6 --- /dev/null +++ b/newsfragment/2449.feature @@ -0,0 +1 @@ +Migrate DefaultTypingService, KeysImporter and KeysExporter to coroutines \ No newline at end of file diff --git a/newsfragment/3182.feature b/newsfragment/3182.feature new file mode 100644 index 0000000000..83eee3c29c --- /dev/null +++ b/newsfragment/3182.feature @@ -0,0 +1 @@ +Update Message Composer design \ No newline at end of file diff --git a/newsfragment/3435.feature b/newsfragment/3435.feature new file mode 100644 index 0000000000..222092924d --- /dev/null +++ b/newsfragment/3435.feature @@ -0,0 +1 @@ +Cleanup Epoxy items, and debounce all the clicks \ No newline at end of file diff --git a/newsfragment/3459.feature b/newsfragment/3459.feature new file mode 100644 index 0000000000..eedec1dfda --- /dev/null +++ b/newsfragment/3459.feature @@ -0,0 +1,2 @@ +Migrate to new colors and cleanup the style and theme +Ref: https://material.io/blog/migrate-android-material-components \ No newline at end of file diff --git a/newsfragment/3467.misc b/newsfragment/3467.misc new file mode 100644 index 0000000000..b726da2353 --- /dev/null +++ b/newsfragment/3467.misc @@ -0,0 +1 @@ +VoIP: Change hold direction to send-only. \ No newline at end of file diff --git a/newsfragment/3479.removal b/newsfragment/3479.removal new file mode 100644 index 0000000000..f492a13f58 --- /dev/null +++ b/newsfragment/3479.removal @@ -0,0 +1 @@ +Splits SessionAccountDataService and RoomAccountDataService and offers to query RoomAccountDataEvent at the session level. \ No newline at end of file diff --git a/tools/check/forbidden_strings_in_code.txt b/tools/check/forbidden_strings_in_code.txt index 9770ed0d4d..e0645e00b3 100644 --- a/tools/check/forbidden_strings_in_code.txt +++ b/tools/check/forbidden_strings_in_code.txt @@ -136,8 +136,9 @@ android\.R\.id\.home===2 ### Kotlin conversion tools introduce this, but is can be replace by trim() trim \{ it \<\= \' \' \} -### Use AlertDialog form v7 compat lib +### Use MaterialAlertDialogBuilder android\.app\.AlertDialog +androidx\.appcompat\.app\.AlertDialog===4 ### Put the operator at the beginning of next line &&$ diff --git a/tools/check/forbidden_strings_in_resources.txt b/tools/check/forbidden_strings_in_resources.txt index cefeeb6351..92eec6cdfd 100644 --- a/tools/check/forbidden_strings_in_resources.txt +++ b/tools/check/forbidden_strings_in_resources.txt @@ -84,3 +84,22 @@ layout_constraintLeft_ ### Use androidx.recyclerview.widget.RecyclerView because EpoxyRecyclerViews add behavior we do not want to + + + + + diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugBottomSheet.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugBottomSheet.kt new file mode 100644 index 0000000000..0ac9a894ae --- /dev/null +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugBottomSheet.kt @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021 New Vector Ltd + * + * 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 im.vector.app.features.debug + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import com.google.android.material.bottomsheet.BottomSheetDialogFragment +import im.vector.app.databinding.ActivityTestMaterialThemeBinding + +class DebugBottomSheet : BottomSheetDialogFragment() { + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { + // Reuse tha Activity layout + val binding = ActivityTestMaterialThemeBinding.inflate(inflater, container, false) + return binding.root + } +} diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt index 8df1feab1e..de6b981c02 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeActivity.kt @@ -18,9 +18,8 @@ package im.vector.app.features.debug import android.os.Bundle import android.view.Menu -import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AppCompatActivity -import com.google.android.material.bottomsheet.BottomSheetDialogFragment +import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.snackbar.Snackbar import im.vector.app.R import im.vector.app.core.utils.toast @@ -45,7 +44,8 @@ abstract class DebugMaterialThemeActivity : AppCompatActivity() { } views.debugShowDialog.setOnClickListener { - AlertDialog.Builder(this) + MaterialAlertDialogBuilder(this) + .setTitle("Dialog title") .setMessage("Dialog content") .setIcon(R.drawable.ic_settings_x) .setPositiveButton("Positive", null) @@ -55,7 +55,7 @@ abstract class DebugMaterialThemeActivity : AppCompatActivity() { } views.debugShowBottomSheet.setOnClickListener { - BottomSheetDialogFragment().show(supportFragmentManager, "TAG") + DebugBottomSheet().show(supportFragmentManager, "TAG") } } diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkDefaultActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkDefaultActivity.kt new file mode 100644 index 0000000000..7e014577de --- /dev/null +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkDefaultActivity.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2019 New Vector Ltd + * + * 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 im.vector.app.features.debug + +class DebugMaterialThemeDarkDefaultActivity : DebugMaterialThemeActivity() diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkTestActivity.kt similarity index 89% rename from vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkActivity.kt rename to vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkTestActivity.kt index e6e1bf04ee..4a1ed04f6a 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkActivity.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkTestActivity.kt @@ -16,4 +16,4 @@ package im.vector.app.features.debug -class DebugMaterialThemeDarkActivity : DebugMaterialThemeActivity() +class DebugMaterialThemeDarkTestActivity : DebugMaterialThemeActivity() diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkVectorActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkVectorActivity.kt new file mode 100644 index 0000000000..6ac27aed45 --- /dev/null +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeDarkVectorActivity.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2019 New Vector Ltd + * + * 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 im.vector.app.features.debug + +class DebugMaterialThemeDarkVectorActivity : DebugMaterialThemeActivity() diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightDefaultActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightDefaultActivity.kt new file mode 100644 index 0000000000..f6327e363b --- /dev/null +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightDefaultActivity.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2019 New Vector Ltd + * + * 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 im.vector.app.features.debug + +class DebugMaterialThemeLightDefaultActivity : DebugMaterialThemeActivity() diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightTestActivity.kt similarity index 89% rename from vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightActivity.kt rename to vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightTestActivity.kt index d1d3061cad..ae6c1dd68c 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightActivity.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightTestActivity.kt @@ -16,4 +16,4 @@ package im.vector.app.features.debug -class DebugMaterialThemeLightActivity : DebugMaterialThemeActivity() +class DebugMaterialThemeLightTestActivity : DebugMaterialThemeActivity() diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightVectorActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightVectorActivity.kt new file mode 100644 index 0000000000..b4fb3c1cc8 --- /dev/null +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMaterialThemeLightVectorActivity.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2019 New Vector Ltd + * + * 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 im.vector.app.features.debug + +class DebugMaterialThemeLightVectorActivity : DebugMaterialThemeActivity() diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt index 8699b238ec..65a24c9aeb 100644 --- a/vector/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugMenuActivity.kt @@ -71,10 +71,29 @@ class DebugMenuActivity : VectorBaseActivity() { private fun setupViews() { views.debugTestTextViewLink.setOnClickListener { testTextViewLink() } + views.debugOpenButtonStyles.setOnClickListener { + startActivity(Intent(this, DebugVectorButtonStylesActivity::class.java)) + } views.debugShowSasEmoji.setOnClickListener { showSasEmoji() } views.debugTestNotification.setOnClickListener { testNotification() } - views.debugTestMaterialThemeLight.setOnClickListener { testMaterialThemeLight() } - views.debugTestMaterialThemeDark.setOnClickListener { testMaterialThemeDark() } + views.debugTestMaterialThemeLightDefault.setOnClickListener { + startActivity(Intent(this, DebugMaterialThemeLightDefaultActivity::class.java)) + } + views.debugTestMaterialThemeLightTest.setOnClickListener { + startActivity(Intent(this, DebugMaterialThemeLightTestActivity::class.java)) + } + views.debugTestMaterialThemeLightVector.setOnClickListener { + startActivity(Intent(this, DebugMaterialThemeLightVectorActivity::class.java)) + } + views.debugTestMaterialThemeDarkDefault.setOnClickListener { + startActivity(Intent(this, DebugMaterialThemeDarkDefaultActivity::class.java)) + } + views.debugTestMaterialThemeDarkTest.setOnClickListener { + startActivity(Intent(this, DebugMaterialThemeDarkTestActivity::class.java)) + } + views.debugTestMaterialThemeDarkVector.setOnClickListener { + startActivity(Intent(this, DebugMaterialThemeDarkVectorActivity::class.java)) + } views.debugTestCrash.setOnClickListener { testCrash() } views.debugScanQrCode.setOnClickListener { scanQRCode() } } @@ -174,14 +193,6 @@ class DebugMenuActivity : VectorBaseActivity() { ) } - private fun testMaterialThemeLight() { - startActivity(Intent(this, DebugMaterialThemeLightActivity::class.java)) - } - - private fun testMaterialThemeDark() { - startActivity(Intent(this, DebugMaterialThemeDarkActivity::class.java)) - } - private fun testCrash() { throw RuntimeException("Application crashed from user demand") } diff --git a/vector/src/debug/java/im/vector/app/features/debug/DebugVectorButtonStylesActivity.kt b/vector/src/debug/java/im/vector/app/features/debug/DebugVectorButtonStylesActivity.kt new file mode 100644 index 0000000000..783a2a3eb5 --- /dev/null +++ b/vector/src/debug/java/im/vector/app/features/debug/DebugVectorButtonStylesActivity.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2021 New Vector Ltd + * + * 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 im.vector.app.features.debug + +import im.vector.app.core.platform.VectorBaseActivity +import im.vector.app.databinding.ActivityDebugButtonStylesBinding + +class DebugVectorButtonStylesActivity : VectorBaseActivity() { + override fun getBinding() = ActivityDebugButtonStylesBinding.inflate(layoutInflater) +} diff --git a/vector/src/debug/res/layout/activity_debug_button_styles.xml b/vector/src/debug/res/layout/activity_debug_button_styles.xml new file mode 100644 index 0000000000..3973f7cbb6 --- /dev/null +++ b/vector/src/debug/res/layout/activity_debug_button_styles.xml @@ -0,0 +1,131 @@ + + + + + +