Compare commits
479 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| deb4e356bd | |||
| 88d6992a9e | |||
| 5e6b09031a | |||
| 115ebf52b6 | |||
| 86451a00ff | |||
| c45a47e53c | |||
| a07723d515 | |||
| 02d7a6fb1f | |||
| d62e8fa864 | |||
| a03fd337ef | |||
| 27c0f45430 | |||
| a0f1232261 | |||
| 5640d31080 | |||
| 1542fc67ca | |||
| a99a4ec85b | |||
| fa17b134cf | |||
| 6898a37704 | |||
| 45b6a5c565 | |||
| 7330e6ba39 | |||
| 8f405914a2 | |||
| 6d09a6f318 | |||
| b349a7e601 | |||
| 0d610895d2 | |||
| a65c677ecc | |||
| db93aeacc0 | |||
| 09ff0d888b | |||
| b9c5e741e8 | |||
| 620d86c903 | |||
| 14e31650e7 | |||
| 9848cb5847 | |||
| bf7db005ef | |||
| aa032dbb37 | |||
| 9e1b9775e2 | |||
| fcd16d9e32 | |||
| 2a4bd2a001 | |||
| eacd089c8f | |||
| 9ed355efd1 | |||
| d1bb25004d | |||
| 8d1b010d1b | |||
| 8a9b76af3a | |||
| 4bbd9428e3 | |||
| 83646003b6 | |||
| 947887f335 | |||
| 69631cd857 | |||
| 0722426425 | |||
| 98d54bbe6a | |||
| c1dc0cf127 | |||
| 44a1ce42f0 | |||
| a0c6cef0fa | |||
| f96e89956c | |||
| ce9ded9d8b | |||
| cb2d9f16ac | |||
| c2a13ae9dd | |||
| f8c2403e61 | |||
| 616b495426 | |||
| a22baa7fc3 | |||
| 0b9bb9ff76 | |||
| ef96192d8b | |||
| 13c34d9480 | |||
| 610f4cebc2 | |||
| d4d15eee7c | |||
| ee3886285b | |||
| a32c20473f | |||
| db956d93cf | |||
| 6a5a75131e | |||
| a676a47ed4 | |||
| 2067122d2c | |||
| 8a0fe892f4 | |||
| 29a6f4eb31 | |||
| f610592bff | |||
| 898008e2a1 | |||
| 9eaa3ca182 | |||
| c98818e5cf | |||
| 7643ecd90a | |||
| e4993bd302 | |||
| 32ee198128 | |||
| ab0d33b3c0 | |||
| 2c8b781817 | |||
| e59655c456 | |||
| 2ce7e5a3c7 | |||
| 79c7419b71 | |||
| 2efaf1df93 | |||
| 814ac7d976 | |||
| b0e5c1c634 | |||
| bae998f811 | |||
| 1b0d3f8583 | |||
| d81cb238df | |||
| 220ae351ee | |||
| 4b09158535 | |||
| e3c423cdd4 | |||
| 7840f5c577 | |||
| 87091c4214 | |||
| 4996ca9d93 | |||
| 9b8511b7f2 | |||
| a66fc7bf10 | |||
| 75cad1ab9c | |||
| be974b3fc8 | |||
| 777ef609ff | |||
| 224964db95 | |||
| 5bfc91de1b | |||
| b9d1aa4338 | |||
| e296dad260 | |||
| 4e372511fb | |||
| e0a71d0fff | |||
| 5bcdd4cf16 | |||
| 68b0b365da | |||
| 227046a739 | |||
| f9127341e7 | |||
| 184da9c20e | |||
| 96b5cabeb6 | |||
| 4a8706b9e3 | |||
| 94a10afac2 | |||
| a0660faf07 | |||
| 26170fc147 | |||
| 8d6147761b | |||
| 9d6abfd979 | |||
| 46f4324478 | |||
| bfeab57744 | |||
| 2e99926e82 | |||
| c28148b843 | |||
| b6b3fe12b6 | |||
| 56c00a7c43 | |||
| 4803bcccdd | |||
| 92f17d5156 | |||
| 5310c41694 | |||
| a54f3ed1a2 | |||
| 8ceb12370f | |||
| 0a7839fb7d | |||
| 76e4c59119 | |||
| 33b69b9f3a | |||
| b4f5e2d124 | |||
| 6853d797f2 | |||
| fa7a3c9c32 | |||
| a70c76f7f3 | |||
| 87a6a12367 | |||
| 9bcdcd918e | |||
| 7454454b63 | |||
| 69a5e42640 | |||
| 1e86ed225d | |||
| 4cd7977ced | |||
| 8d0f1a6602 | |||
| 0ce10cbb35 | |||
| 7decf02fd3 | |||
| 114731f722 | |||
| 2a7025ef17 | |||
| 257003ba09 | |||
| ca110c6d74 | |||
| 09f66caadc | |||
| 4a73ac19c2 | |||
| 9c3281e182 | |||
| a84e17635a | |||
| af7d915d14 | |||
| f679376445 | |||
| 4f32b994fa | |||
| dbb9115024 | |||
| af640044c9 | |||
| bece13d75e | |||
| 1b9c619739 | |||
| ccd8df85e4 | |||
| 1195945637 | |||
| 2e77ae8f4d | |||
| c8fefca916 | |||
| 6acb2203ef | |||
| 46c627dde1 | |||
| 1366bc3571 | |||
| 20c487be7a | |||
| ef674746d9 | |||
| e65268979c | |||
| e289432a09 | |||
| 8509049791 | |||
| d1b490a02d | |||
| 64d33bebbd | |||
| 0a44d00451 | |||
| 353b2c0488 | |||
| 85c68d0485 | |||
| 12c2237e00 | |||
| 68f9533392 | |||
| e93efa318a | |||
| fbc01ff0a2 | |||
| b0ca48740a | |||
| fa795dd149 | |||
| 0a4f1ded54 | |||
| b2e88d50fd | |||
| 2a54867724 | |||
| 210e5c7fbc | |||
| a5818c7cba | |||
| 059d517d0d | |||
| 5c3eb0ac82 | |||
| efa04fce18 | |||
| fb9771adde | |||
| 2930d0dc2d | |||
| e6e85ed812 | |||
| 7837a99e7b | |||
| 8c546dc358 | |||
| f0c75ec3c6 | |||
| 658283c4e8 | |||
| 0ef4d645df | |||
| 91713911ee | |||
| 1c0a54d75e | |||
| 0f82b3ca93 | |||
| 1a80187c07 | |||
| e315d0505c | |||
| 10b966a7c8 | |||
| 3c65408f25 | |||
| 1e31b479e8 | |||
| 6f1f446aa8 | |||
| e5149ac255 | |||
| 403539da35 | |||
| 443501112d | |||
| bea2effb89 | |||
| b2d875cc61 | |||
| e94f571744 | |||
| cf91468f65 | |||
| 69c6fdd070 | |||
| 1b9bfc37ad | |||
| 8cb1c195b1 | |||
| 41f963332c | |||
| dc6dee6a1a | |||
| 35becfc63b | |||
| 6c31d8cf85 | |||
| f6c25a2015 | |||
| 4c8d27f4bb | |||
| 87c49dc680 | |||
| f0d5695729 | |||
| be01c3b14f | |||
| bf435f4303 | |||
| 0289f47adc | |||
| 1f455c435f | |||
| db8d4b5daf | |||
| 5ac7f9ee11 | |||
| 6c80f85290 | |||
| 744bca93e8 | |||
| 601a65a1cb | |||
| 9f2523da21 | |||
| c936d51bac | |||
| b77862c290 | |||
| c495c3936b | |||
| a5a5819eec | |||
| 429c3fb57c | |||
| 0c9bec1d3d | |||
| 51771669d3 | |||
| f32651cd9d | |||
| 07a2663591 | |||
| fe9ee4c484 | |||
| 1425815467 | |||
| eea4a1b124 | |||
| 72c7772e89 | |||
| c4f0dc2f2d | |||
| 2d0645465e | |||
| 5031993289 | |||
| 8e944552b3 | |||
| 342b071189 | |||
| 32248b4635 | |||
| 89b4be49c8 | |||
| b3230abd68 | |||
| e26ac3d264 | |||
| fcc98e81d5 | |||
| bd4fa0b032 | |||
| d4675f25ec | |||
| a2a440e57b | |||
| f24b2e2540 | |||
| f8d2cd7bf3 | |||
| 1ff99ddbe4 | |||
| 13bf0d6f9f | |||
| d24f53895e | |||
| 66e8fa9d9e | |||
| 230fb79584 | |||
| 9181a9c398 | |||
| 2f05b20b0f | |||
| 115ffae588 | |||
| 7455e56f11 | |||
| d4b8e4bafa | |||
| 67a2e3fcd9 | |||
| f12d6855e9 | |||
| 56459e7e7a | |||
| d5244f5f96 | |||
| c8722ddcc6 | |||
| 5874001ec2 | |||
| b94a4cbe8b | |||
| 5d0b5f7947 | |||
| a193ee6cdf | |||
| ff438731d8 | |||
| 08913a5e76 | |||
| e7d2656613 | |||
| f3210f2626 | |||
| 0b1fa7c7d1 | |||
| 6b6d48f5da | |||
| 3b9e989195 | |||
| 4af065aad9 | |||
| b0e918caab | |||
| a6384dc679 | |||
| 838db45a74 | |||
| 44328f1086 | |||
| 2064a2f0ea | |||
| 6b066d9428 | |||
| d68508c0cf | |||
| 5f5f303a93 | |||
| 71bb0105ab | |||
| 796c81af61 | |||
| 329c7a52a7 | |||
| b19d39b794 | |||
| b4d8f1e04f | |||
| febf2cb105 | |||
| ef00e04638 | |||
| 1042f4b4f8 | |||
| 0180d63821 | |||
| 8b8c6b6bbb | |||
| fe8ad85f89 | |||
| c938c4dcd9 | |||
| 35f6a06406 | |||
| db7365c3b3 | |||
| 51d7e5df62 | |||
| 28f7fbf806 | |||
| d6d3dd8930 | |||
| 83571ba0bf | |||
| 34fc888c5e | |||
| 0a7be040c3 | |||
| 448334a8a2 | |||
| 5141116f38 | |||
| 310500b8d7 | |||
| 7bc0ab858a | |||
| ca438ca3a3 | |||
| 2a2cb7c26e | |||
| 9e5a2d30ed | |||
| 5b8c0db287 | |||
| 08864ae250 | |||
| ea6bd9283c | |||
| 83dfca249d | |||
| c7d41d1b84 | |||
| b09838f033 | |||
| 10164032f0 | |||
| 7829ff0a83 | |||
| aaa8a07511 | |||
| cd2aedcc6b | |||
| 553610cfa4 | |||
| ceea00e2cc | |||
| ef512b0f14 | |||
| 83a7e4df3f | |||
| d4aa90cc0c | |||
| 342d820095 | |||
| 18d9c00d13 | |||
| 8df792a8e3 | |||
| 0693f8ad60 | |||
| c6ff66ba51 | |||
| eaa6a68e4f | |||
| 6cf044d7c9 | |||
| 174170ee4f | |||
| 3ee2c3f0be | |||
| 339ab13f64 | |||
| 777e6f40cb | |||
| 577ec92c53 | |||
| d41679f2c0 | |||
| 2bfb2ae58f | |||
| ca56ca2dd1 | |||
| ca35a0635b | |||
| 127f29a17e | |||
| 9f40d84a51 | |||
| 21eab6dfe9 | |||
| d8ea2ad273 | |||
| a66b4d8923 | |||
| 3c9a289e2d | |||
| 29daa1ee89 | |||
| 769a07449f | |||
| 0993745c33 | |||
| f1d9ddeed6 | |||
| 2218ae91e0 | |||
| 21a8ba9674 | |||
| 153fe5f1e7 | |||
| ec49ac8eb6 | |||
| da1e71b2d2 | |||
| 00027ad8f3 | |||
| 81e7f37d61 | |||
| 4e6c1e3eaf | |||
| 77eda90923 | |||
| 0a7b9e7ea2 | |||
| 718bf0d74b | |||
| 82c963c38f | |||
| 999a33e77c | |||
| e96b4db126 | |||
| 118d4f864f | |||
| d6259f112e | |||
| f9eb55170d | |||
| 2bb104a234 | |||
| b75b29cf08 | |||
| 2a3934cbd7 | |||
| 9a6abed1e4 | |||
| baf5f97e96 | |||
| 3426d9cb37 | |||
| 53f401caf5 | |||
| 4950d0be55 | |||
| 57ac9d6b91 | |||
| 8723adbfcd | |||
| 8c5038c20f | |||
| 6518c22b79 | |||
| 0027e2c93b | |||
| 0b8eaad68a | |||
| 16738f053a | |||
| bed9a4d8d4 | |||
| 1ee3d40f37 | |||
| 1c6e9fc391 | |||
| 31c8e8d46b | |||
| ff6e0d9fbf | |||
| a92ccd6d43 | |||
| 32bdce147a | |||
| 1e6d1ed917 | |||
| 0f9e378923 | |||
| 5aaa11a445 | |||
| e77f266da5 | |||
| dc1be8e07b | |||
| d9daae7f41 | |||
| b30ae06dde | |||
| 488ba08e05 | |||
| 7a1db99daa | |||
| 8450349e19 | |||
| 50a6389b75 | |||
| aa4b65dbb0 | |||
| 96154422c1 | |||
| bc82f56353 | |||
| 1d9c9bb1b6 | |||
| 037a468332 | |||
| df41fa7cba | |||
| a48f595cf7 | |||
| f221321e6c | |||
| bf9842e414 | |||
| 0ee54460ba | |||
| 83a6fc531a | |||
| 8989737c71 | |||
| 56f89af121 | |||
| 97ee01eac1 | |||
| 8c7e430d4d | |||
| 2b36b69251 | |||
| acf8f10f76 | |||
| e5b890a765 | |||
| 3da97acdfd | |||
| 75fc7c48e9 | |||
| 7bdefeab37 | |||
| f71097f2d2 | |||
| 90e2229543 | |||
| e8e9987eb3 | |||
| 68b5383dc4 | |||
| 5ab215489a | |||
| 8f401e2a09 | |||
| 572932e92d | |||
| f924a407b3 | |||
| adcbf118b6 | |||
| 0e185eff4c | |||
| ad5df50eb9 | |||
| 22921e72e9 | |||
| 199881e3b2 | |||
| 12ec74e835 | |||
| 42d0a40f58 | |||
| 68e8b64b47 | |||
| a06f77b5f8 | |||
| b809fc007b | |||
| 334893071b | |||
| 306064e260 | |||
| 85f679c69f | |||
| f23e3d4e22 | |||
| 59d4c8fbd8 | |||
| 5f33c8a56d | |||
| 45ba604820 | |||
| 780df4df46 | |||
| 01ac637142 | |||
| 147de536f7 | |||
| 9f0596de0a | |||
| 750fbaa6cc | |||
| c623343b04 | |||
| b216274b37 | |||
| 843e813593 | |||
| 9eb0608c89 | |||
| 560a993972 | |||
| 8701c72d43 | |||
| 454f8a4628 | |||
| 03cc658e7e | |||
| e12081642d | |||
| 9cbdd8d553 | |||
| 65b1d93c70 | |||
| 085eace0cf | |||
| 552f6e2975 |
@@ -0,0 +1,175 @@
|
||||
# GitHub Copilot Instructions for ArcaneChat Android
|
||||
|
||||
## Project Overview
|
||||
|
||||
ArcaneChat is a Delta Chat Android client built on top of the official Delta Chat client with several improvements. It is a messenger app that uses email infrastructure for secure communication.
|
||||
|
||||
**Technology Stack:**
|
||||
- **Language:** Java (Java 8 compatibility)
|
||||
- **Build System:** Gradle with Android Gradle Plugin 8.11.1
|
||||
- **Min SDK:** 21 (Android 5.0)
|
||||
- **Target SDK:** 35 (Android 15)
|
||||
- **NDK Version:** 27.0.12077973
|
||||
- **Native Components:** Rust (deltachat-core-rust submodule)
|
||||
- **UI Framework:** Android SDK, Material Design Components
|
||||
- **Testing:** JUnit 4, Espresso, Mockito, PowerMock, AssertJ
|
||||
|
||||
## Repository Structure
|
||||
|
||||
- `src/main/` - Main application source code
|
||||
- `src/androidTest/` - Instrumented tests (UI tests, benchmarks)
|
||||
- `src/gplay/` - Google Play flavor-specific code
|
||||
- `src/foss/` - F-Droid/FOSS flavor-specific code
|
||||
- `jni/deltachat-core-rust/` - Native Rust core library (submodule)
|
||||
- `scripts/` - Build and helper scripts
|
||||
- `docs/` - Documentation
|
||||
- `fastlane/` - App store metadata and screenshots
|
||||
|
||||
## Build Instructions
|
||||
|
||||
### Prerequisites
|
||||
|
||||
1. **Initialize submodules:**
|
||||
```bash
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
2. **Build native libraries:**
|
||||
```bash
|
||||
scripts/ndk-make.sh
|
||||
```
|
||||
Note: First run may take significant time as it builds for all architectures (armeabi-v7a, arm64-v8a, x86, x86_64)
|
||||
|
||||
3. **Build APK:**
|
||||
```bash
|
||||
./gradlew assembleDebug
|
||||
```
|
||||
|
||||
### Build Flavors
|
||||
|
||||
- **gplay:** Google Play version with Firebase Cloud Messaging (applicationId: `com.github.arcanechat`)
|
||||
- **foss:** F-Droid version without proprietary services (applicationId: `chat.delta.lite`)
|
||||
|
||||
### Build Outputs
|
||||
|
||||
- Debug APKs: `build/outputs/apk/gplay/debug/` and `build/outputs/apk/fat/debug/`
|
||||
- Release APKs require signing configuration in `~/.gradle/gradle.properties`
|
||||
|
||||
## Testing
|
||||
|
||||
### Running Unit Tests
|
||||
|
||||
```bash
|
||||
./gradlew test
|
||||
```
|
||||
|
||||
### Running Instrumented Tests
|
||||
|
||||
1. **Disable animations** on your device/emulator:
|
||||
- Developer Options → Set "Window animation scale", "Transition animation scale", and "Animator duration scale" to 0x
|
||||
|
||||
2. **Run tests:**
|
||||
```bash
|
||||
./gradlew connectedAndroidTest
|
||||
```
|
||||
|
||||
### Online Tests
|
||||
|
||||
Some tests require real email credentials. Configure in `~/.gradle/gradle.properties`:
|
||||
```properties
|
||||
TEST_ADDR=youraccount@yourdomain.org
|
||||
TEST_MAIL_PW=yourpassword
|
||||
```
|
||||
|
||||
### UI Tests and Benchmarks
|
||||
|
||||
- Located in `src/androidTest/java/com/b44t/messenger/`
|
||||
- Test categories: `uitests/online/`, `uitests/offline/`, `uibenchmarks/`
|
||||
- Run via Android Studio: Run → Edit Configurations → Android Instrumented Test
|
||||
|
||||
## Coding Conventions
|
||||
|
||||
### General Guidelines
|
||||
|
||||
1. **Embrace existing style:** Match the coding style of the file you're editing
|
||||
2. **Minimize changes:** Don't refactor or rename in the same PR as bug fixes/features
|
||||
3. **Readable over paradigmatic:** Favor readability over strict Java patterns
|
||||
4. **Avoid premature optimization:** Keep things simple and on point
|
||||
5. **No excessive abstraction:** Avoid unnecessary factories, one-liner functions, or abstraction layers
|
||||
6. **Comments:** Only add comments if they match existing style or explain complex logic
|
||||
|
||||
### Architecture
|
||||
|
||||
- **UI/Model Separation:** Delta Chat Core (Rust) handles the model layer
|
||||
- **High-level interface:** Core provides data in UI-ready form; avoid additional transformations in UI layer
|
||||
- **Direct approach:** Prefer direct implementation over excessive class hierarchies
|
||||
|
||||
### Key Principles
|
||||
|
||||
- Work hard to avoid options and up-front choices
|
||||
- Avoid speaking about keys/encryption in primary UI
|
||||
- App must work offline and with poor network
|
||||
- Users don't read much text
|
||||
- Consistency matters
|
||||
- Primary UI should only show highly useful features
|
||||
|
||||
## Common Development Tasks
|
||||
|
||||
### Adding New Features
|
||||
|
||||
1. Consider the UX philosophy (minimal options, offline-first, simplicity)
|
||||
2. Check if core library changes are needed before implementing in UI
|
||||
3. Match existing code style in modified files
|
||||
4. Add instrumented tests for UI changes when appropriate
|
||||
5. Update relevant documentation
|
||||
|
||||
### Modifying Core Integration
|
||||
|
||||
- Core library is in `jni/deltachat-core-rust/` submodule
|
||||
- Java bindings are in `src/main/java/com/b44t/messenger/Dc*.java`
|
||||
- JSON-RPC bindings in `chat.delta.rpc.*` package (generated via dcrpcgen)
|
||||
|
||||
### Working with Translations
|
||||
|
||||
- Translations managed via Transifex (not in repository)
|
||||
- English source strings: `res/values/strings.xml`
|
||||
- Don't mix string changes with refactoring
|
||||
|
||||
### Debugging Native Code
|
||||
|
||||
Decode crash symbols:
|
||||
```bash
|
||||
$ANDROID_NDK_ROOT/ndk-stack --sym obj/local/armeabi-v7a --dump crash.txt > decoded.txt
|
||||
```
|
||||
|
||||
## WebXDC Support
|
||||
|
||||
ArcaneChat has extended WebXDC support:
|
||||
- `window.webxdc.arcanechat` - Version detection
|
||||
- `sendToChat()` - Extra properties: `subject`, `html`, `type` (sticker/image/audio/video/file)
|
||||
- External link support in apps
|
||||
- `manifest.toml` - `orientation` field for landscape mode
|
||||
|
||||
## Important Files
|
||||
|
||||
- `build.gradle` - Main build configuration
|
||||
- `CONTRIBUTING.md` - Contribution guidelines
|
||||
- `BUILDING.md` - Detailed build setup
|
||||
- `RELEASE.md` - Release process
|
||||
- `proguard-rules.pro` - ProGuard configuration
|
||||
- `google-services.json` - Firebase configuration (gplay flavor)
|
||||
|
||||
## Package Structure
|
||||
|
||||
- `org.thoughtcrime.securesms.*` - Main UI components (legacy namespace from Signal)
|
||||
- `com.b44t.messenger.*` - Delta Chat core integration
|
||||
- `chat.delta.rpc.*` - JSON-RPC bindings (generated)
|
||||
|
||||
## Notes for AI Assistants
|
||||
|
||||
- This is a fork of Delta Chat Android with ArcaneChat-specific improvements
|
||||
- Maintain compatibility with Delta Chat core library
|
||||
- Test on both gplay and foss flavors when making changes
|
||||
- Native library must be rebuilt after core changes
|
||||
- ProGuard is enabled in both debug and release builds
|
||||
- Multi-dex is enabled due to app size
|
||||
@@ -59,12 +59,27 @@ jobs:
|
||||
rm build/outputs/apk/foss/release/*universal*
|
||||
./gradlew assembleGplayRelease
|
||||
mv build/outputs/apk/gplay/release/*universal* build/outputs/apk/foss/release/ArcaneChat-gplay.apk
|
||||
mv build/outputs/mapping/fossRelease/mapping.txt build/outputs/mapping/fossRelease/mapping-foss.txt
|
||||
mv build/outputs/mapping/gplayRelease/mapping.txt build/outputs/mapping/fossRelease/mapping-gplay.txt
|
||||
|
||||
- name: Release
|
||||
- name: Release on GitHub
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
body: '[<img src="store/get-it-on-gplay.png" alt="Get it on Google Play" height="48">](https://play.google.com/store/apps/details?id=com.github.arcanechat) [<img src="store/get-it-on-fdroid.png" alt="Get it on F-Droid" height="48">](https://f-droid.org/packages/chat.delta.lite) [<img src="store/get-it-on-github.png" alt="Get it on GitHub" height="48">](https://github.com/ArcaneChat/android/releases/latest/download/ArcaneChat-gplay.apk)'
|
||||
prerelease: ${{ contains(github.event.ref, '-beta') }}
|
||||
fail_on_unmatched_files: true
|
||||
files: build/outputs/apk/foss/release/*.apk
|
||||
files: |
|
||||
build/outputs/apk/foss/release/*.apk
|
||||
build/outputs/mapping/fossRelease/mapping-*.txt
|
||||
|
||||
- name: Release on ZapStore
|
||||
run: |
|
||||
export CHECKSUM=6e2c7cf6da53c3f1a78b523a6aacd6316dce3d74ace6f859c2676729ee439990
|
||||
curl -sL https://cdn.zapstore.dev/$CHECKSUM -o zapstore
|
||||
if echo "$CHECKSUM zapstore" | sha256sum -c --status; then
|
||||
chmod +x zapstore
|
||||
SIGN_WITH=${{ secrets.NOSTR_KEY }} ./zapstore publish --indexer-mode
|
||||
else
|
||||
echo "ERROR: checksum doesn't match!"
|
||||
fi
|
||||
|
||||
@@ -22,24 +22,12 @@ subproject _deltachat-core-rust_:
|
||||
|
||||
## Generate JSON-RPC bindings
|
||||
|
||||
To generate the JSON-RPC bindings (ex. `chat.delta.rpc.*` package)
|
||||
install the [dcrpcgen tool](https://github.com/chatmail/dcrpcgen)
|
||||
then generate the `schema.json` file:
|
||||
To generate/update the JSON-RPC bindings (ex. `chat.delta.rpc.*` package)
|
||||
install Rust tooling (read sections below) and the [dcrpcgen tool](https://github.com/chatmail/dcrpcgen)
|
||||
then generate the code running the script:
|
||||
|
||||
```
|
||||
# install deltachat-rpc-server program:
|
||||
cargo install --path ./jni/deltachat-core-rust/deltachat-rpc-server
|
||||
# check the version of core matches:
|
||||
deltachat-rpc-server --version
|
||||
# generate the schema:
|
||||
deltachat-rpc-server --openrpc > schema.json
|
||||
```
|
||||
|
||||
then pass the schema file to the `dcrpcgen` tool to generate the
|
||||
code:
|
||||
|
||||
```
|
||||
dcrpcgen java --schema schema.json -o ./src/main/java/
|
||||
./scripts/generate-rpc-bindings.sh
|
||||
```
|
||||
|
||||
## Build Using Nix
|
||||
|
||||
@@ -1,5 +1,68 @@
|
||||
# Delta Chat Android Changelog
|
||||
|
||||
## Unreleased
|
||||
|
||||
* Improve switch speed when changing profiles
|
||||
* Allow to switch profile when sharing or forwarding
|
||||
* Display message views count for channel owners
|
||||
* Don't notify notification-to-all from in-chat apps if the chat is muted
|
||||
* Allow to see inbox quota for all relays in connectivity screen
|
||||
* Truncate file names in the middle, not at the end; important information are more often at the end
|
||||
* Remove email address from user profile
|
||||
* Mark external links with " ↗" to make them clear
|
||||
* Make QR code larger on "Add Second Device" screen
|
||||
* Add indication for blocked contacts in user profile
|
||||
* Show hint for empty contact search results
|
||||
* Fix: Show dialog if pasted QR codes are invalid
|
||||
* Fix: Refresh chat list when returning from conversation if selected profile changed
|
||||
* Fix: Update menu when using "select all" in contact selection
|
||||
* Fix: Avoid empty profiles after using "add as second device" from welcome screen
|
||||
* Fix multi-device seen messages synchronization when using multiple relays
|
||||
* Update to core 2.39.0
|
||||
|
||||
## v2.35.0
|
||||
2026-01
|
||||
|
||||
* Protect profile deletion and relays management with system lock/pin
|
||||
* Fix: Remove address from profile switcher
|
||||
* Fix: Avoid crash if the system doesn't allow to start foreground service
|
||||
* Remove deprecated "real-time apps" switch
|
||||
* Update to core 2.35.0
|
||||
|
||||
## v2.34.0
|
||||
2025-12
|
||||
|
||||
* Allow to add relay from clipboard or image if camera permission is not granted
|
||||
* Avoid crash in the "View Log" screen
|
||||
* Update to core 2.34.0
|
||||
|
||||
## v2.33.1
|
||||
2025-12
|
||||
|
||||
* Target Android 16
|
||||
* Change color of links in text messages
|
||||
* Improve edge-to-edge support
|
||||
* Add the option (opt-in) to send anonymous statistics to Delta Chat's developers
|
||||
* Metadata protection: protect message recipients
|
||||
* Allow to withdraw channel invite links and QR codes
|
||||
* Allow to open externally links clicked inside in-chat apps
|
||||
* Do not show "1 member" when the process of joining the group is not finished
|
||||
* Make search case-insensitive for non-ASCII chat and contact names
|
||||
* Improve handling of video recoding
|
||||
* Send .webm videos as file, they are not supported by all platforms
|
||||
* Tweak advanced section and wording of some advanced options
|
||||
* Fix: avoid crash in push notifications handling
|
||||
* Fix: avoid freezing in background
|
||||
* Fix: clean up web storage of deleted in-chat apps
|
||||
* Fix: avoid crash when exporting some files with wrong image MIME type
|
||||
* Expose new "Multi-device mode" option instead of "Delete from server" for chatmail profiles
|
||||
* Opened in-chat apps got a 'About Apps' menu item
|
||||
* Avoid gray avatar on profile creation
|
||||
* Avoid last item in chat list being covered by the floating button
|
||||
* Add disk usage statistics to log
|
||||
* New experimental feature: several addresses per profile
|
||||
* Update to core 2.33.0
|
||||
|
||||
## v2.25.0
|
||||
2025-11
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
## Generate APKs
|
||||
|
||||
### Update core and translations
|
||||
|
||||
on the command-line, in a PR called "update-core-and-stuff-DATE":
|
||||
|
||||
1. update core:
|
||||
@@ -21,12 +23,19 @@ a) Update `CHANGELOG.md`
|
||||
as `update to core 1.2.3` or `using core 1.2.3`
|
||||
|
||||
|
||||
2. update translations and local help:
|
||||
2. update JSON-RPC bindings:
|
||||
```
|
||||
./scripts/update-rpc-bindings.sh
|
||||
```
|
||||
|
||||
3. update translations and local help:
|
||||
```
|
||||
./scripts/tx-pull-translations.sh
|
||||
./scripts/create-local-help.sh # requires deltachat-pages checked out at ../deltachat-pages
|
||||
```
|
||||
|
||||
### Prepare release
|
||||
|
||||
the following steps are done in a PR called `prep-VERSION` (no leading "v"):
|
||||
|
||||
3. Update `CHANGELOG.md`:
|
||||
|
||||
@@ -21,7 +21,7 @@ android {
|
||||
}
|
||||
namespace "org.thoughtcrime.securesms"
|
||||
flavorDimensions "none"
|
||||
compileSdk 35
|
||||
compileSdk 36
|
||||
|
||||
// Set NDK version to strip native libraries.
|
||||
// Even though we compile our libraries outside Gradle with `scripts/ndk-make.sh`,
|
||||
@@ -33,14 +33,14 @@ android {
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
|
||||
defaultConfig {
|
||||
versionCode 30000732
|
||||
versionName "2.25.0"
|
||||
versionCode 30000736
|
||||
versionName "2.36.0"
|
||||
|
||||
applicationId "chat.delta.lite"
|
||||
multiDexEnabled true
|
||||
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 35
|
||||
targetSdkVersion 36
|
||||
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
|
||||
@@ -211,6 +211,7 @@ dependencies {
|
||||
implementation "io.noties.markwon:inline-parser:$markwon_version"
|
||||
implementation 'com.airbnb.android:lottie:4.2.2' // Lottie animations support.
|
||||
|
||||
implementation 'androidx.concurrent:concurrent-futures:1.3.0'
|
||||
implementation 'androidx.sharetarget:sharetarget:1.2.0'
|
||||
implementation 'androidx.webkit:webkit:1.14.0'
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
|
||||
@@ -23,12 +23,11 @@ ArcaneChat is a Delta Chat client and was created with a focus on usability, goo
|
||||
<li>Multiple color themes/skins</li>
|
||||
<li>It is possible to disable profiles to completely disconnect them saving data/bandwidth</li>
|
||||
<li>You can easily see the connection status of all your profiles in the profile switcher</li>
|
||||
<li>A videochat instance is set by default</li>
|
||||
<li>Extra option to share location for 12 hours</li>
|
||||
<li>Clicking on a message with a POI location, will open the POI on the map</li>
|
||||
<li>Last-seen status of contacts is shown in your contact list, like in WhatsApp, Telegram, etc.</li>
|
||||
<li>Videos are played in loop, useful for short GIF videos</li>
|
||||
<li>Verified icon is shown in the chat list for the "Device Messages" chat</li>
|
||||
<li>Verified icon is shown in the chat list for the "Device Messages" and "Saved Messages" chat to avoid fishing attempts by scammer pretending to be the official chats</li>
|
||||
<li>Voice messages have more aggressive compression in "worse quality" mode to save data plan</li>
|
||||
<li>Automatic download of messages limited to 640KB by default</li>
|
||||
<li>Profile's display name is always shown in the app's title bar instead of the name of the app</li>
|
||||
|
||||
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 287 KiB After Width: | Height: | Size: 283 KiB |
|
Before Width: | Height: | Size: 256 KiB After Width: | Height: | Size: 250 KiB |
|
Before Width: | Height: | Size: 447 KiB After Width: | Height: | Size: 446 KiB |
@@ -0,0 +1,36 @@
|
||||
ArcaneChat — децентрализованный и защищённый мессенджер, удобный для друзей и семьи.
|
||||
|
||||
• Анонимность. Мгновенный вход без номера телефона, e-mail или других личных данных.
|
||||
|
||||
• Гибкость. Поддерживает несколько профилей чатов и легко настраивается на нескольких устройствах.
|
||||
|
||||
• Расширяемость. В чатах можно использовать мини-приложения: списки покупок, календари или игры.
|
||||
|
||||
• Надёжность. Работает даже при плохом соединении и в сложных сетевых условиях.
|
||||
|
||||
• Безопасность. Проверенное сквозное шифрование, защищённое от сетевых и серверных атак.
|
||||
|
||||
• Самостоятельность. Может работать с вашим собственным e-mail-адресом или сервером.
|
||||
|
||||
ArcaneChat — клиент Delta Chat, разработанный с акцентом на удобство, качественный UX и экономию трафика. Также приложение часто экспериментирует с новыми функциями, которые со временем могут быть добавлены в официальный клиент Delta Chat.
|
||||
|
||||
<b>Основные отличия от официального клиента Delta Chat:</b>
|
||||
|
||||
<ul>
|
||||
<li>Поддержка некоторых стилей markdown в текстовых сообщениях (жирный, курсив, зачёркнутый и т.д.)</li>
|
||||
<li>Поддержка отображения анимированных стикеров Telegram (.tgs-файлы)</li>
|
||||
<li>Поддержка предпросмотра SVG-изображений</li>
|
||||
<li>Несколько цветовых тем/скинов</li>
|
||||
<li>Возможность отключать профили, полностью отключая им доступ в сеть для экономии трафика</li>
|
||||
<li>На панели переключения профилей видно состояние подключения каждого профиля</li>
|
||||
<li>Дополнительная опция для обмена местоположением на 12 часов</li>
|
||||
<li>Нажатие на сообщение с POI открывает его на карте</li>
|
||||
<li>Статус «был(а) в сети» отображается в списке контактов, как в WhatsApp, Telegram и т.д.</li>
|
||||
<li>Видео воспроизводятся по кругу — удобно для коротких GIF-видео</li>
|
||||
<li>У чата «Device Messages» в списке чатов отображается значок подтверждения</li>
|
||||
<li>В режиме «низкое качество» голосовые сообщения сжимаются сильнее для экономии трафика</li>
|
||||
<li>Автоматическая загрузка сообщений по умолчанию ограничена 640KB</li>
|
||||
<li>Отображаемое имя профиля всегда видно в заголовке приложения вместо названия приложения</li>
|
||||
<li>Для разработчиков мини-приложений: доступны дополнительные возможности WebXDC API, см. https://github.com/ArcaneChat/android/#webxdc</li>
|
||||
<li>Более удобная организация настроек с дополнительным разделом «Privacy»</li>
|
||||
</ul>
|
||||
@@ -0,0 +1 @@
|
||||
⚡ Быстрые зашифрованные чаты для семьи 🎉
|
||||
@@ -0,0 +1 @@
|
||||
ArcaneChat
|
||||
@@ -138,11 +138,11 @@
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1756197489,
|
||||
"narHash": "sha256-S16rPaBH1TnMbDyL5NlGSJcYd7wPlOEWTStdBDL7BHw=",
|
||||
"lastModified": 1763347184,
|
||||
"narHash": "sha256-6QH8hpCYJxifvyHEYg+Da0BotUn03BwLIvYo3JAxuqQ=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "8ec04f46f1edeeed3f870da62191745b93975da7",
|
||||
"rev": "08895cce80433978d5bfd668efa41c5e24578cbd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
build-tools-35-0-0
|
||||
cmdline-tools-latest
|
||||
platform-tools
|
||||
platforms-android-35
|
||||
platforms-android-36
|
||||
ndk-27-2-12479018
|
||||
]);
|
||||
rust-version = pkgs.lib.removeSuffix "\n"
|
||||
|
||||
@@ -231,6 +231,12 @@ JNIEXPORT jboolean Java_com_b44t_messenger_DcAccounts_backgroundFetch(JNIEnv *en
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT void Java_com_b44t_messenger_DcAccounts_stopBackgroundFetch(JNIEnv *env, jobject obj)
|
||||
{
|
||||
dc_accounts_stop_background_fetch(get_dc_accounts(env, obj));
|
||||
}
|
||||
|
||||
|
||||
JNIEXPORT jint Java_com_b44t_messenger_DcAccounts_migrateAccount(JNIEnv *env, jobject obj, jstring dbfile)
|
||||
{
|
||||
CHAR_REF(dbfile);
|
||||
@@ -1951,7 +1957,7 @@ JNIEXPORT jstring Java_com_b44t_messenger_DcBackupProvider_getQr(JNIEnv *env, jo
|
||||
|
||||
JNIEXPORT jstring Java_com_b44t_messenger_DcBackupProvider_getQrSvg(JNIEnv *env, jobject obj)
|
||||
{
|
||||
char* temp = dc_backup_provider_get_qr_svg(get_dc_backup_provider(env, obj));
|
||||
char* temp = dc_create_qr_svg(dc_backup_provider_get_qr(get_dc_backup_provider(env, obj)));
|
||||
jstring ret = JSTRING_NEW(temp);
|
||||
dc_str_unref(temp);
|
||||
return ret;
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
.PHONY: apk
|
||||
apk:
|
||||
./scripts/rebrand.sh
|
||||
./gradlew --offline assembleGplayRelease
|
||||
./scripts/undo_rebrand.sh
|
||||
|
||||
.PHONY: aab
|
||||
aab:
|
||||
./scripts/rebrand.sh
|
||||
sed -i 's/signingConfigs.releaseApk/signingConfigs.releaseBundle/g' build.gradle
|
||||
./gradlew --offline bundleGplayRelease
|
||||
sed -i 's/signingConfigs.releaseBundle/signingConfigs.releaseApk/g' build.gradle
|
||||
./scripts/undo_rebrand.sh
|
||||
|
||||
.PHONY: foss
|
||||
foss:
|
||||
./scripts/rebrand.sh
|
||||
./gradlew --offline assembleFossRelease
|
||||
./scripts/undo_rebrand.sh
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
adb -d install -r build/outputs/apk/gplay/release/*universal*.apk
|
||||
|
||||
.PHONY: emulator-install
|
||||
emulator-install:
|
||||
adb install -r build/outputs/apk/gplay/release/*universal*.apk
|
||||
|
||||
.PHONY: fetch
|
||||
fetch:
|
||||
git fetch upstream
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
./gradlew --offline clean
|
||||
|
||||
|
||||
# CORE:
|
||||
|
||||
.PHONY: fetch-core
|
||||
fetch-core:
|
||||
cd ../core && git fetch upstream
|
||||
|
||||
.PHONY: core
|
||||
core:
|
||||
rmdir jni/deltachat-core-rust; mv ../core jni/deltachat-core-rust; true
|
||||
./scripts/ndk-make.sh; true
|
||||
./scripts/undo_rebrand.sh
|
||||
mv jni/deltachat-core-rust ../core
|
||||
mkdir jni/deltachat-core-rust
|
||||
|
||||
.PHONY: core-fast
|
||||
core-fast:
|
||||
rmdir jni/deltachat-core-rust; mv ../core jni/deltachat-core-rust; true
|
||||
./scripts/ndk-make.sh arm64-v8a; true
|
||||
./scripts/undo_rebrand.sh
|
||||
mv jni/deltachat-core-rust ../core
|
||||
mkdir jni/deltachat-core-rust
|
||||
|
||||
.PHONY: core-v7
|
||||
core-v7:
|
||||
rmdir jni/deltachat-core-rust; mv ../core jni/deltachat-core-rust; true
|
||||
./scripts/ndk-make.sh armeabi-v7a; true
|
||||
./scripts/undo_rebrand.sh
|
||||
mv jni/deltachat-core-rust ../core
|
||||
mkdir jni/deltachat-core-rust
|
||||
|
||||
.PHONY: core-x86
|
||||
core-x86:
|
||||
rmdir jni/deltachat-core-rust; mv ../core jni/deltachat-core-rust; true
|
||||
./scripts/ndk-make.sh x86; true
|
||||
./scripts/undo_rebrand.sh
|
||||
mv jni/deltachat-core-rust ../core
|
||||
mkdir jni/deltachat-core-rust
|
||||
|
||||
.PHONY: link
|
||||
link:
|
||||
rmdir jni/deltachat-core-rust; mv ../core jni/deltachat-core-rust; true
|
||||
|
||||
.PHONY: unlink
|
||||
unlink:
|
||||
mv jni/deltachat-core-rust ../core
|
||||
mkdir jni/deltachat-core-rust
|
||||
@@ -1 +1,2 @@
|
||||
rm src/main/assets/help/*.png
|
||||
../deltachat-pages/tools/create-local-help.py ../deltachat-pages/result src/main/assets/help
|
||||
|
||||
@@ -6,3 +6,4 @@ find ./src/main/assets/help/ -type f -name '*.html' | xargs sed -i 's/Delta Chat
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/get.delta.chat/github.com\/ArcaneChat/g'
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/delta.chat\/donate/arcanechat.me\/#contribute/g'
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/Delta Chat/ArcaneChat/g'
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/❤️/💜/g'
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.86.0
|
||||
1.91.1
|
||||
|
||||
@@ -6,6 +6,7 @@ find ./src/main/assets/help/ -type f -name '*.html' | xargs sed -i 's/ArcaneChat
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/github.com\/ArcaneChat/get.delta.chat/g'
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/arcanechat.me\/#contribute/delta.chat\/donate/g'
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/ArcaneChat/Delta Chat/g'
|
||||
find ./src/ -type f -name 'strings.xml' | xargs sed -i 's/💜/❤️/g'
|
||||
|
||||
# don't revert the app name
|
||||
sed -i 's/>Delta Chat</>ArcaneChat</g' ./src/main/res/values/strings.xml
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# you need to have dcrpcgen
|
||||
|
||||
# generate schema.json
|
||||
ROOT_DIR=$PWD
|
||||
cd ./jni/deltachat-core-rust/deltachat-rpc-server
|
||||
cargo run -- --openrpc > "$ROOT_DIR/schema.json"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
# generate code
|
||||
dcrpcgen java --schema schema.json -o ./src/main/java/
|
||||
@@ -41,7 +41,7 @@ public class OnboardingTest {
|
||||
}
|
||||
onView(withText(R.string.scan_invitation_code)).check(matches(isClickable()));
|
||||
onView(withText(R.string.import_backup_title)).check(matches(isClickable()));
|
||||
onView(withText(R.string.login_header)).perform(click());
|
||||
onView(withText(R.string.manual_account_setup_option)).perform(click());
|
||||
onView(withHint(R.string.email_address)).perform(replaceText(BuildConfig.TEST_ADDR));
|
||||
onView(withHint(R.string.existing_password)).perform(replaceText(BuildConfig.TEST_MAIL_PW));
|
||||
onView(withContentDescription(R.string.ok)).perform(click());
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
|
||||
|
||||
<application>
|
||||
<service
|
||||
android:name=".connect.KeepAliveService"
|
||||
android:foregroundServiceType="specialUse"
|
||||
android:enabled="true" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -10,6 +10,11 @@
|
||||
<meta-data android:name="firebase_messaging_auto_init_enabled" android:value="false" />
|
||||
|
||||
<application>
|
||||
<service
|
||||
android:name=".connect.KeepAliveService"
|
||||
android:foregroundServiceType="dataSync"
|
||||
android:enabled="true" />
|
||||
|
||||
<service
|
||||
android:name=".notifications.FcmReceiveService"
|
||||
android:foregroundServiceType="dataSync"
|
||||
|
||||
@@ -62,7 +62,7 @@ public class FcmReceiveService extends FirebaseMessagingService {
|
||||
|
||||
prefixedToken = addPrefix(rawToken);
|
||||
Log.i(TAG, "FCM token: " + prefixedToken);
|
||||
ApplicationContext.dcAccounts.setPushDeviceToken(prefixedToken);
|
||||
ApplicationContext.getDcAccounts().setPushDeviceToken(prefixedToken);
|
||||
triedRegistering = true;
|
||||
});
|
||||
}
|
||||
@@ -91,7 +91,19 @@ public class FcmReceiveService extends FirebaseMessagingService {
|
||||
@Override
|
||||
public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
|
||||
Log.i(TAG, "FCM push notification received");
|
||||
FetchForegroundService.start(this);
|
||||
// Note: The system can downgrade the high priority messages to normal priority
|
||||
// if the app is not using the high priority messages for surfacing time sensitive
|
||||
// content to the user. If the message's priority is downgraded, your app cannot
|
||||
// start a foreground service and attempting to start one results in a
|
||||
// ForegroundServiceStartNotAllowedException.
|
||||
// So, it's recommended to check the result of RemoteMessage.getPriority() and
|
||||
// confirm it's PRIORITY_HIGH() before attempting to start a foreground service.
|
||||
// source: https://developer.android.com/develop/background-work/services/fgs/restrictions-bg-start
|
||||
if (remoteMessage.getPriority() == RemoteMessage.PRIORITY_HIGH) {
|
||||
FetchForegroundService.start(this);
|
||||
} else {
|
||||
FetchForegroundService.fetchSynchronously();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -104,6 +116,6 @@ public class FcmReceiveService extends FirebaseMessagingService {
|
||||
public void onNewToken(@NonNull String rawToken) {
|
||||
prefixedToken = addPrefix(rawToken);
|
||||
Log.i(TAG, "new FCM token: " + prefixedToken);
|
||||
ApplicationContext.dcAccounts.setPushDeviceToken(prefixedToken);
|
||||
ApplicationContext.getDcAccounts().setPushDeviceToken(prefixedToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
|
||||
|
||||
<!-- dangerous permissions - we need to as the user with a PermissionsRequest -->
|
||||
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
|
||||
@@ -208,16 +207,7 @@
|
||||
<activity android:name=".NewConversationActivity"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:exported="true">
|
||||
|
||||
<intent-filter>
|
||||
<data android:scheme="mailto"/>
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
</intent-filter>
|
||||
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
</activity>
|
||||
|
||||
<activity android:name=".ContactMultiSelectionActivity"
|
||||
@@ -229,17 +219,20 @@
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".WelcomeActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/TextSecure.LightNoActionBar"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".RegistrationActivity"
|
||||
<activity android:name=".relay.EditRelayActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||
android:exported="true">
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
</activity>
|
||||
|
||||
<activity android:name=".relay.RelayListActivity"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".proxy.ProxySettingsActivity"
|
||||
android:label="@string/proxy_settings"
|
||||
android:windowSoftInputMode="stateHidden"
|
||||
@@ -361,15 +354,13 @@
|
||||
<activity android:name=".calls.CallActivity"
|
||||
android:label=""
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize|uiMode"
|
||||
android:exported="true">
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize|uiMode">
|
||||
</activity>
|
||||
|
||||
<activity android:name=".WebxdcActivity"
|
||||
android:label=""
|
||||
android:theme="@style/TextSecure.LightTheme"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize|uiMode"
|
||||
android:exported="true">
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize|uiMode">
|
||||
</activity>
|
||||
|
||||
<activity android:name=".WebxdcStoreActivity"
|
||||
@@ -387,11 +378,6 @@
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||
</activity>
|
||||
|
||||
<service
|
||||
android:name=".connect.KeepAliveService"
|
||||
android:foregroundServiceType="dataSync"
|
||||
android:enabled="true" />
|
||||
|
||||
<service
|
||||
android:name=".geolocation.LocationBackgroundService"
|
||||
android:foregroundServiceType="location" />
|
||||
|
||||
|
Before Width: | Height: | Size: 16 KiB |
@@ -6,6 +6,10 @@ a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a[href^='http']::after {
|
||||
content: " ↗";
|
||||
}
|
||||
|
||||
h2, h3, h4 {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 778 B |
|
After Width: | Height: | Size: 577 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 137 B After Width: | Height: | Size: 138 B |
|
Before Width: | Height: | Size: 145 B After Width: | Height: | Size: 148 B |
|
After Width: | Height: | Size: 232 B |
|
After Width: | Height: | Size: 286 B |
@@ -94,7 +94,7 @@ public abstract class BaseTransport implements Rpc.Transport {
|
||||
}
|
||||
|
||||
if (response.error != null) {
|
||||
future.setException(new RpcException(response.error.toString()));
|
||||
future.setException(new RpcException(response.error.message));
|
||||
} else if (response.result != null) {
|
||||
future.set(response.result);
|
||||
} else {
|
||||
@@ -115,10 +115,15 @@ public abstract class BaseTransport implements Rpc.Transport {
|
||||
}
|
||||
}
|
||||
|
||||
private static class RpcError {
|
||||
public int code;
|
||||
public String message;
|
||||
}
|
||||
|
||||
private static class Response {
|
||||
public String jsonrpc;
|
||||
public int id;
|
||||
public JsonNode result;
|
||||
public JsonNode error;
|
||||
public RpcError error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||
|
||||
@JsonTypeInfo(use=Id.NAME, include=As.PROPERTY, property="kind")
|
||||
@JsonSubTypes({@Type(value = Account.Configured.class, name="Configured"), @Type(value = Account.Unconfigured.class, name="Unconfigured")})
|
||||
public abstract class Account {
|
||||
|
||||
public static class Configured extends Account {
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String addr;
|
||||
public String color;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String displayName;
|
||||
public Integer id;
|
||||
/** Optional tag as "Work", "Family". Meant to help profile owner to differ between profiles with similar names. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String privateTag;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String profileImage;
|
||||
}
|
||||
|
||||
public static class Unconfigured extends Account {
|
||||
public Integer id;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
/**
|
||||
* cheaper version of fullchat, omits: - contact_ids - fresh_message_counter - ephemeral_timer - self_in_group - was_seen_recently - can_send
|
||||
* <p>
|
||||
* used when you only need the basic metadata of a chat like type, name, profile picture
|
||||
*/
|
||||
public class BasicChat {
|
||||
public Boolean archived;
|
||||
public ChatType chatType;
|
||||
public String color;
|
||||
public Integer id;
|
||||
public Boolean isContactRequest;
|
||||
public Boolean isDeviceChat;
|
||||
/**
|
||||
* True if the chat is encrypted. This means that all messages in the chat are encrypted, and all contacts in the chat are "key-contacts", i.e. identified by the PGP key fingerprint.
|
||||
* <p>
|
||||
* False if the chat is unencrypted. This means that all messages in the chat are unencrypted, and all contacts in the chat are "address-contacts", i.e. identified by the email address. The UI should mark this chat e.g. with a mail-letter icon.
|
||||
* <p>
|
||||
* Unencrypted groups are called "ad-hoc groups" and the user can't add/remove members, create a QR invite code, or set an avatar. These options should therefore be disabled in the UI.
|
||||
* <p>
|
||||
* Note that it can happen that an encrypted chat contains unencrypted messages that were received in core <= v1.159.* and vice versa.
|
||||
* <p>
|
||||
* See also `is_key_contact` on `Contact`.
|
||||
*/
|
||||
public Boolean isEncrypted;
|
||||
public Boolean isMuted;
|
||||
public Boolean isSelfTalk;
|
||||
public Boolean isUnpromoted;
|
||||
public String name;
|
||||
public Boolean pinned;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String profileImage;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class CallInfo {
|
||||
/* True if SDP offer has a video. */
|
||||
/** True if SDP offer has a video. */
|
||||
public Boolean hasVideo;
|
||||
/**
|
||||
* SDP offer.
|
||||
|
||||
@@ -19,21 +19,21 @@ public abstract class CallState {
|
||||
public static class Alerting extends CallState {
|
||||
}
|
||||
|
||||
/* Active call. */
|
||||
/** Active call. */
|
||||
public static class Active extends CallState {
|
||||
}
|
||||
|
||||
/* Completed call that was once active and then was terminated for any reason. */
|
||||
/** Completed call that was once active and then was terminated for any reason. */
|
||||
public static class Completed extends CallState {
|
||||
/* Call duration in seconds. */
|
||||
/** Call duration in seconds. */
|
||||
public Integer duration;
|
||||
}
|
||||
|
||||
/* Incoming call that was not picked up within a timeout or was explicitly ended by the caller before we picked up. */
|
||||
/** Incoming call that was not picked up within a timeout or was explicitly ended by the caller before we picked up. */
|
||||
public static class Missed extends CallState {
|
||||
}
|
||||
|
||||
/* Incoming call that was explicitly ended on our side before picking up or outgoing call that was declined before the timeout. */
|
||||
/** Incoming call that was explicitly ended on our side before picking up or outgoing call that was declined before the timeout. */
|
||||
public static class Declined extends CallState {
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||
|
||||
@JsonTypeInfo(use=Id.NAME, include=As.PROPERTY, property="kind")
|
||||
@JsonSubTypes({@Type(value = ChatListItemFetchResult.ChatListItem.class, name="ChatListItem"), @Type(value = ChatListItemFetchResult.ArchiveLink.class, name="ArchiveLink"), @Type(value = ChatListItemFetchResult.Error.class, name="Error")})
|
||||
public abstract class ChatListItemFetchResult {
|
||||
|
||||
public static class ChatListItem extends ChatListItemFetchResult {
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String avatarPath;
|
||||
public ChatType chatType;
|
||||
public String color;
|
||||
/** contact id if this is a dm chat (for view profile entry in context menu) */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer dmChatContact;
|
||||
public Integer freshMessageCounter;
|
||||
public Integer id;
|
||||
public Boolean isArchived;
|
||||
public Boolean isContactRequest;
|
||||
public Boolean isDeviceTalk;
|
||||
/**
|
||||
* True if the chat is encrypted. This means that all messages in the chat are encrypted, and all contacts in the chat are "key-contacts", i.e. identified by the PGP key fingerprint.
|
||||
* <p>
|
||||
* False if the chat is unencrypted. This means that all messages in the chat are unencrypted, and all contacts in the chat are "address-contacts", i.e. identified by the email address. The UI should mark this chat e.g. with a mail-letter icon.
|
||||
* <p>
|
||||
* Unencrypted groups are called "ad-hoc groups" and the user can't add/remove members, create a QR invite code, or set an avatar. These options should therefore be disabled in the UI.
|
||||
* <p>
|
||||
* Note that it can happen that an encrypted chat contains unencrypted messages that were received in core <= v1.159.* and vice versa.
|
||||
* <p>
|
||||
* See also `is_key_contact` on `Contact`.
|
||||
*/
|
||||
public Boolean isEncrypted;
|
||||
/** deprecated 2025-07, use chat_type instead */
|
||||
public Boolean isGroup;
|
||||
public Boolean isMuted;
|
||||
public Boolean isPinned;
|
||||
public Boolean isSelfInGroup;
|
||||
public Boolean isSelfTalk;
|
||||
public Boolean isSendingLocation;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer lastMessageId;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Viewtype lastMessageType;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer lastUpdated;
|
||||
public String name;
|
||||
/** showing preview if last chat message is image */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String summaryPreviewImage;
|
||||
public Integer summaryStatus;
|
||||
public String summaryText1;
|
||||
public String summaryText2;
|
||||
public Boolean wasSeenRecently;
|
||||
}
|
||||
|
||||
public static class ArchiveLink extends ChatListItemFetchResult {
|
||||
public Integer freshMessageCounter;
|
||||
}
|
||||
|
||||
public static class Error extends ChatListItemFetchResult {
|
||||
public String error;
|
||||
public Integer id;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public enum ChatType {
|
||||
Single,
|
||||
Group,
|
||||
Mailinglist,
|
||||
OutBroadcast,
|
||||
InBroadcast,
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public enum ChatVisibility {
|
||||
Normal,
|
||||
Archived,
|
||||
Pinned,
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class Contact {
|
||||
public String address;
|
||||
public String authName;
|
||||
public String color;
|
||||
public String displayName;
|
||||
/**
|
||||
* Is encryption available for this contact.
|
||||
* <p>
|
||||
* This can only be true for key-contacts. However, it is possible to have a key-contact for which encryption is not available because we don't have a key yet, e.g. if we just scanned the fingerprint from a QR code.
|
||||
*/
|
||||
public Boolean e2eeAvail;
|
||||
public Integer id;
|
||||
public Boolean isBlocked;
|
||||
/** If the contact is a bot. */
|
||||
public Boolean isBot;
|
||||
/** Is the contact a key contact. */
|
||||
public Boolean isKeyContact;
|
||||
/**
|
||||
* True if the contact can be added to protected chats because SELF and contact have verified their fingerprints in both directions.
|
||||
* <p>
|
||||
* See [`Self::verifier_id`]/`Contact.verifierId` for a guidance how to display these information.
|
||||
*/
|
||||
public Boolean isVerified;
|
||||
/** the contact's last seen timestamp */
|
||||
public Integer lastSeen;
|
||||
public String name;
|
||||
public String nameAndAddr;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String profileImage;
|
||||
public String status;
|
||||
/**
|
||||
* The contact ID that verified a contact.
|
||||
* <p>
|
||||
* As verifier may be unknown, use [`Self::is_verified`]/`Contact.isVerified` to check if a contact can be added to a protected chat.
|
||||
* <p>
|
||||
* UI should display the information in the contact's profile as follows:
|
||||
* <p>
|
||||
* - If `verifierId` != 0, display text "Introduced by ..." with the name of the contact. Prefix the text by a green checkmark.
|
||||
* <p>
|
||||
* - If `verifierId` == 0 and `isVerified` != 0, display "Introduced" prefixed by a green checkmark.
|
||||
* <p>
|
||||
* - if `verifierId` == 0 and `isVerified` == 0, display nothing
|
||||
* <p>
|
||||
* This contains the contact ID of the verifier. If it is `DC_CONTACT_ID_SELF`, we verified the contact ourself. If it is None/Null, we don't have verifier information or the contact is not verified.
|
||||
*/
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer verifierId;
|
||||
public Boolean wasSeenRecently;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public enum DownloadState {
|
||||
Done,
|
||||
Available,
|
||||
Failure,
|
||||
Undecipherable,
|
||||
InProgress,
|
||||
}
|
||||
@@ -2,12 +2,12 @@
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public enum EnteredCertificateChecks {
|
||||
/* `Automatic` means that provider database setting should be taken. If there is no provider database setting for certificate checks, check certificates strictly. */
|
||||
/** `Automatic` means that provider database setting should be taken. If there is no provider database setting for certificate checks, check certificates strictly. */
|
||||
automatic,
|
||||
|
||||
/* Ensure that TLS certificate is valid for the server hostname. */
|
||||
/** Ensure that TLS certificate is valid for the server hostname. */
|
||||
strict,
|
||||
|
||||
/* Accept certificates that are expired, self-signed or otherwise not valid for the server hostname. */
|
||||
/** Accept certificates that are expired, self-signed or otherwise not valid for the server hostname. */
|
||||
acceptInvalidCertificates,
|
||||
}
|
||||
@@ -7,27 +7,27 @@ package chat.delta.rpc.types;
|
||||
* Usually it will be enough to only set `addr` and `password`, and all the other settings will be autoconfigured.
|
||||
*/
|
||||
public class EnteredLoginParam {
|
||||
/* Email address. */
|
||||
/** Email address. */
|
||||
public String addr;
|
||||
/* TLS options: whether to allow invalid certificates and/or invalid hostnames. Default: Automatic */
|
||||
/** TLS options: whether to allow invalid certificates and/or invalid hostnames. Default: Automatic */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public EnteredCertificateChecks certificateChecks;
|
||||
/* Imap server port. */
|
||||
/** Imap server port. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer imapPort;
|
||||
/* Imap socket security. */
|
||||
/** Imap socket security. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Socket imapSecurity;
|
||||
/* Imap server hostname or IP address. */
|
||||
/** Imap server hostname or IP address. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String imapServer;
|
||||
/* Imap username. */
|
||||
/** Imap username. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String imapUser;
|
||||
/* If true, login via OAUTH2 (not recommended anymore). Default: false */
|
||||
/** If true, login via OAUTH2 (not recommended anymore). Default: false */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Boolean oauth2;
|
||||
/* Password. */
|
||||
/** Password. */
|
||||
public String password;
|
||||
/**
|
||||
* SMTP Password.
|
||||
@@ -36,16 +36,16 @@ public class EnteredLoginParam {
|
||||
*/
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String smtpPassword;
|
||||
/* SMTP server port. */
|
||||
/** SMTP server port. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer smtpPort;
|
||||
/* SMTP socket security. */
|
||||
/** SMTP socket security. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Socket smtpSecurity;
|
||||
/* SMTP server hostname or IP address. */
|
||||
/** SMTP server hostname or IP address. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String smtpServer;
|
||||
/* SMTP username. */
|
||||
/** SMTP username. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String smtpUser;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||
|
||||
@JsonTypeInfo(use=Id.NAME, include=As.PROPERTY, property="kind")
|
||||
@JsonSubTypes({@Type(value = EphemeralTimer.Disabled.class, name="Disabled"), @Type(value = EphemeralTimer.Enabled.class, name="Enabled")})
|
||||
public abstract class EphemeralTimer {
|
||||
|
||||
/** Timer is disabled. */
|
||||
public static class Disabled extends EphemeralTimer {
|
||||
}
|
||||
|
||||
/** Timer is enabled. */
|
||||
public static class Enabled extends EphemeralTimer {
|
||||
/**
|
||||
* Timer duration in seconds.
|
||||
* <p>
|
||||
* The value cannot be 0.
|
||||
*/
|
||||
public Integer duration;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class Event {
|
||||
/** Account ID. */
|
||||
public Integer contextId;
|
||||
/** Event payload. */
|
||||
public EventType event;
|
||||
}
|
||||
@@ -0,0 +1,422 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||
|
||||
@JsonTypeInfo(use=Id.NAME, include=As.PROPERTY, property="kind")
|
||||
@JsonSubTypes({@Type(value = EventType.Info.class, name="Info"), @Type(value = EventType.SmtpConnected.class, name="SmtpConnected"), @Type(value = EventType.ImapConnected.class, name="ImapConnected"), @Type(value = EventType.SmtpMessageSent.class, name="SmtpMessageSent"), @Type(value = EventType.ImapMessageDeleted.class, name="ImapMessageDeleted"), @Type(value = EventType.ImapMessageMoved.class, name="ImapMessageMoved"), @Type(value = EventType.ImapInboxIdle.class, name="ImapInboxIdle"), @Type(value = EventType.NewBlobFile.class, name="NewBlobFile"), @Type(value = EventType.DeletedBlobFile.class, name="DeletedBlobFile"), @Type(value = EventType.Warning.class, name="Warning"), @Type(value = EventType.Error.class, name="Error"), @Type(value = EventType.ErrorSelfNotInGroup.class, name="ErrorSelfNotInGroup"), @Type(value = EventType.MsgsChanged.class, name="MsgsChanged"), @Type(value = EventType.ReactionsChanged.class, name="ReactionsChanged"), @Type(value = EventType.IncomingReaction.class, name="IncomingReaction"), @Type(value = EventType.IncomingWebxdcNotify.class, name="IncomingWebxdcNotify"), @Type(value = EventType.IncomingMsg.class, name="IncomingMsg"), @Type(value = EventType.IncomingMsgBunch.class, name="IncomingMsgBunch"), @Type(value = EventType.MsgsNoticed.class, name="MsgsNoticed"), @Type(value = EventType.MsgDelivered.class, name="MsgDelivered"), @Type(value = EventType.MsgFailed.class, name="MsgFailed"), @Type(value = EventType.MsgRead.class, name="MsgRead"), @Type(value = EventType.MsgDeleted.class, name="MsgDeleted"), @Type(value = EventType.ChatModified.class, name="ChatModified"), @Type(value = EventType.ChatEphemeralTimerModified.class, name="ChatEphemeralTimerModified"), @Type(value = EventType.ChatDeleted.class, name="ChatDeleted"), @Type(value = EventType.ContactsChanged.class, name="ContactsChanged"), @Type(value = EventType.LocationChanged.class, name="LocationChanged"), @Type(value = EventType.ConfigureProgress.class, name="ConfigureProgress"), @Type(value = EventType.ImexProgress.class, name="ImexProgress"), @Type(value = EventType.ImexFileWritten.class, name="ImexFileWritten"), @Type(value = EventType.SecurejoinInviterProgress.class, name="SecurejoinInviterProgress"), @Type(value = EventType.SecurejoinJoinerProgress.class, name="SecurejoinJoinerProgress"), @Type(value = EventType.ConnectivityChanged.class, name="ConnectivityChanged"), @Type(value = EventType.SelfavatarChanged.class, name="SelfavatarChanged"), @Type(value = EventType.ConfigSynced.class, name="ConfigSynced"), @Type(value = EventType.WebxdcStatusUpdate.class, name="WebxdcStatusUpdate"), @Type(value = EventType.WebxdcRealtimeData.class, name="WebxdcRealtimeData"), @Type(value = EventType.WebxdcRealtimeAdvertisementReceived.class, name="WebxdcRealtimeAdvertisementReceived"), @Type(value = EventType.WebxdcInstanceDeleted.class, name="WebxdcInstanceDeleted"), @Type(value = EventType.AccountsBackgroundFetchDone.class, name="AccountsBackgroundFetchDone"), @Type(value = EventType.ChatlistChanged.class, name="ChatlistChanged"), @Type(value = EventType.ChatlistItemChanged.class, name="ChatlistItemChanged"), @Type(value = EventType.AccountsChanged.class, name="AccountsChanged"), @Type(value = EventType.AccountsItemChanged.class, name="AccountsItemChanged"), @Type(value = EventType.EventChannelOverflow.class, name="EventChannelOverflow"), @Type(value = EventType.IncomingCall.class, name="IncomingCall"), @Type(value = EventType.IncomingCallAccepted.class, name="IncomingCallAccepted"), @Type(value = EventType.OutgoingCallAccepted.class, name="OutgoingCallAccepted"), @Type(value = EventType.CallEnded.class, name="CallEnded"), @Type(value = EventType.TransportsModified.class, name="TransportsModified")})
|
||||
public abstract class EventType {
|
||||
|
||||
/**
|
||||
* The library-user may write an informational string to the log.
|
||||
* <p>
|
||||
* This event should *not* be reported to the end-user using a popup or something like that.
|
||||
*/
|
||||
public static class Info extends EventType {
|
||||
public String msg;
|
||||
}
|
||||
|
||||
/** Emitted when SMTP connection is established and login was successful. */
|
||||
public static class SmtpConnected extends EventType {
|
||||
public String msg;
|
||||
}
|
||||
|
||||
/** Emitted when IMAP connection is established and login was successful. */
|
||||
public static class ImapConnected extends EventType {
|
||||
public String msg;
|
||||
}
|
||||
|
||||
/** Emitted when a message was successfully sent to the SMTP server. */
|
||||
public static class SmtpMessageSent extends EventType {
|
||||
public String msg;
|
||||
}
|
||||
|
||||
/** Emitted when an IMAP message has been marked as deleted */
|
||||
public static class ImapMessageDeleted extends EventType {
|
||||
public String msg;
|
||||
}
|
||||
|
||||
/** Emitted when an IMAP message has been moved */
|
||||
public static class ImapMessageMoved extends EventType {
|
||||
public String msg;
|
||||
}
|
||||
|
||||
/** Emitted before going into IDLE on the Inbox folder. */
|
||||
public static class ImapInboxIdle extends EventType {
|
||||
}
|
||||
|
||||
/** Emitted when an new file in the $BLOBDIR was created */
|
||||
public static class NewBlobFile extends EventType {
|
||||
public String file;
|
||||
}
|
||||
|
||||
/** Emitted when an file in the $BLOBDIR was deleted */
|
||||
public static class DeletedBlobFile extends EventType {
|
||||
public String file;
|
||||
}
|
||||
|
||||
/**
|
||||
* The library-user should write a warning string to the log.
|
||||
* <p>
|
||||
* This event should *not* be reported to the end-user using a popup or something like that.
|
||||
*/
|
||||
public static class Warning extends EventType {
|
||||
public String msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* The library-user should report an error to the end-user.
|
||||
* <p>
|
||||
* As most things are asynchronous, things may go wrong at any time and the user should not be disturbed by a dialog or so. Instead, use a bubble or so.
|
||||
* <p>
|
||||
* However, for ongoing processes (eg. configure()) or for functions that are expected to fail (eg. autocryptContinueKeyTransfer()) it might be better to delay showing these events until the function has really failed (returned false). It should be sufficient to report only the *last* error in a message box then.
|
||||
*/
|
||||
public static class Error extends EventType {
|
||||
public String msg;
|
||||
}
|
||||
|
||||
/** An action cannot be performed because the user is not in the group. Reported eg. after a call to setChatName(), setChatProfileImage(), addContactToChat(), removeContactFromChat(), and messages sending functions. */
|
||||
public static class ErrorSelfNotInGroup extends EventType {
|
||||
public String msg;
|
||||
}
|
||||
|
||||
/** Messages or chats changed. One or more messages or chats changed for various reasons in the database: - Messages sent, received or removed - Chats created, deleted or archived - A draft has been set */
|
||||
public static class MsgsChanged extends EventType {
|
||||
/** Set if only a single chat is affected by the changes, otherwise 0. */
|
||||
public Integer chatId;
|
||||
/** Set if only a single message is affected by the changes, otherwise 0. */
|
||||
public Integer msgId;
|
||||
}
|
||||
|
||||
/** Reactions for the message changed. */
|
||||
public static class ReactionsChanged extends EventType {
|
||||
/** ID of the chat which the message belongs to. */
|
||||
public Integer chatId;
|
||||
/** ID of the contact whose reaction set is changed. */
|
||||
public Integer contactId;
|
||||
/** ID of the message for which reactions were changed. */
|
||||
public Integer msgId;
|
||||
}
|
||||
|
||||
/**
|
||||
* A reaction to one's own sent message received. Typically, the UI will show a notification for that.
|
||||
* <p>
|
||||
* In addition to this event, ReactionsChanged is emitted.
|
||||
*/
|
||||
public static class IncomingReaction extends EventType {
|
||||
/** ID of the chat which the message belongs to. */
|
||||
public Integer chatId;
|
||||
/** ID of the contact whose reaction set is changed. */
|
||||
public Integer contactId;
|
||||
/** ID of the message for which reactions were changed. */
|
||||
public Integer msgId;
|
||||
/** The reaction. */
|
||||
public String reaction;
|
||||
}
|
||||
|
||||
/** Incoming webxdc info or summary update, should be notified. */
|
||||
public static class IncomingWebxdcNotify extends EventType {
|
||||
/** ID of the chat. */
|
||||
public Integer chatId;
|
||||
/** ID of the contact sending. */
|
||||
public Integer contactId;
|
||||
/** Link assigned to this notification, if any. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String href;
|
||||
/** ID of the added info message or webxdc instance in case of summary change. */
|
||||
public Integer msgId;
|
||||
/** Text to notify. */
|
||||
public String text;
|
||||
}
|
||||
|
||||
/**
|
||||
* There is a fresh message. Typically, the user will show a notification when receiving this message.
|
||||
* <p>
|
||||
* There is no extra #DC_EVENT_MSGS_CHANGED event sent together with this event.
|
||||
*/
|
||||
public static class IncomingMsg extends EventType {
|
||||
/** ID of the chat where the message is assigned. */
|
||||
public Integer chatId;
|
||||
/** ID of the message. */
|
||||
public Integer msgId;
|
||||
}
|
||||
|
||||
/** Downloading a bunch of messages just finished. This is an event to allow the UI to only show one notification per message bunch, instead of cluttering the user with many notifications. */
|
||||
public static class IncomingMsgBunch extends EventType {
|
||||
}
|
||||
|
||||
/** Messages were seen or noticed. chat id is always set. */
|
||||
public static class MsgsNoticed extends EventType {
|
||||
public Integer chatId;
|
||||
}
|
||||
|
||||
/** A single message is sent successfully. State changed from DC_STATE_OUT_PENDING to DC_STATE_OUT_DELIVERED, see `Message.state`. */
|
||||
public static class MsgDelivered extends EventType {
|
||||
/** ID of the chat which the message belongs to. */
|
||||
public Integer chatId;
|
||||
/** ID of the message that was successfully sent. */
|
||||
public Integer msgId;
|
||||
}
|
||||
|
||||
/** A single message could not be sent. State changed from DC_STATE_OUT_PENDING or DC_STATE_OUT_DELIVERED to DC_STATE_OUT_FAILED, see `Message.state`. */
|
||||
public static class MsgFailed extends EventType {
|
||||
/** ID of the chat which the message belongs to. */
|
||||
public Integer chatId;
|
||||
/** ID of the message that could not be sent. */
|
||||
public Integer msgId;
|
||||
}
|
||||
|
||||
/** A single message is read by the receiver. State changed from DC_STATE_OUT_DELIVERED to DC_STATE_OUT_MDN_RCVD, see `Message.state`. */
|
||||
public static class MsgRead extends EventType {
|
||||
/** ID of the chat which the message belongs to. */
|
||||
public Integer chatId;
|
||||
/** ID of the message that was read. */
|
||||
public Integer msgId;
|
||||
}
|
||||
|
||||
/**
|
||||
* A single message was deleted.
|
||||
* <p>
|
||||
* This event means that the message will no longer appear in the messagelist. UI should remove the message from the messagelist in response to this event if the message is currently displayed.
|
||||
* <p>
|
||||
* The message may have been explicitly deleted by the user or expired. Internally the message may have been removed from the database, moved to the trash chat or hidden.
|
||||
* <p>
|
||||
* This event does not indicate the message deletion from the server.
|
||||
*/
|
||||
public static class MsgDeleted extends EventType {
|
||||
/** ID of the chat where the message was prior to deletion. Never 0. */
|
||||
public Integer chatId;
|
||||
/** ID of the deleted message. Never 0. */
|
||||
public Integer msgId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Chat changed. The name or the image of a chat group was changed or members were added or removed. See setChatName(), setChatProfileImage(), addContactToChat() and removeContactFromChat().
|
||||
* <p>
|
||||
* This event does not include ephemeral timer modification, which is a separate event.
|
||||
*/
|
||||
public static class ChatModified extends EventType {
|
||||
public Integer chatId;
|
||||
}
|
||||
|
||||
/** Chat ephemeral timer changed. */
|
||||
public static class ChatEphemeralTimerModified extends EventType {
|
||||
/** Chat ID. */
|
||||
public Integer chatId;
|
||||
/** New ephemeral timer value. */
|
||||
public Integer timer;
|
||||
}
|
||||
|
||||
/** Chat deleted. */
|
||||
public static class ChatDeleted extends EventType {
|
||||
/** Chat ID. */
|
||||
public Integer chat_id;
|
||||
}
|
||||
|
||||
/** Contact(s) created, renamed, blocked or deleted. */
|
||||
public static class ContactsChanged extends EventType {
|
||||
/** If set, this is the contact_id of an added contact that should be selected. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer contactId;
|
||||
}
|
||||
|
||||
/** Location of one or more contact has changed. */
|
||||
public static class LocationChanged extends EventType {
|
||||
/** contact_id of the contact for which the location has changed. If the locations of several contacts have been changed, this parameter is set to `None`. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer contactId;
|
||||
}
|
||||
|
||||
/** Inform about the configuration progress started by configure(). */
|
||||
public static class ConfigureProgress extends EventType {
|
||||
/** Progress comment or error, something to display to the user. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String comment;
|
||||
/**
|
||||
* Progress.
|
||||
* <p>
|
||||
* 0=error, 1-999=progress in permille, 1000=success and done
|
||||
*/
|
||||
public Integer progress;
|
||||
}
|
||||
|
||||
/** Inform about the import/export progress started by imex(). */
|
||||
public static class ImexProgress extends EventType {
|
||||
/** 0=error, 1-999=progress in permille, 1000=success and done */
|
||||
public Integer progress;
|
||||
}
|
||||
|
||||
/**
|
||||
* A file has been exported. A file has been written by imex(). This event may be sent multiple times by a single call to imex().
|
||||
* <p>
|
||||
* A typical purpose for a handler of this event may be to make the file public to some system services.
|
||||
* <p>
|
||||
* @param data2 0
|
||||
*/
|
||||
public static class ImexFileWritten extends EventType {
|
||||
public String path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Progress event sent when SecureJoin protocol has finished from the view of the inviter (Alice, the person who shows the QR code).
|
||||
* <p>
|
||||
* These events are typically sent after a joiner has scanned the QR code generated by getChatSecurejoinQrCodeSvg().
|
||||
*/
|
||||
public static class SecurejoinInviterProgress extends EventType {
|
||||
/** ID of the chat in case of success. */
|
||||
public Integer chatId;
|
||||
/** The type of the joined chat. This can take the same values as `BasicChat.chatType` ([`crate::api::types::chat::BasicChat::chat_type`]). */
|
||||
public ChatType chatType;
|
||||
/** ID of the contact that wants to join. */
|
||||
public Integer contactId;
|
||||
/** Progress, always 1000. */
|
||||
public Integer progress;
|
||||
}
|
||||
|
||||
/** Progress information of a secure-join handshake from the view of the joiner (Bob, the person who scans the QR code). The events are typically sent while secureJoin(), which may take some time, is executed. */
|
||||
public static class SecurejoinJoinerProgress extends EventType {
|
||||
/** ID of the inviting contact. */
|
||||
public Integer contactId;
|
||||
/** Progress as: 400=vg-/vc-request-with-auth sent, typically shown as "alice@addr verified, introducing myself." (Bob has verified alice and waits until Alice does the same for him) 1000=vg-member-added/vc-contact-confirm received */
|
||||
public Integer progress;
|
||||
}
|
||||
|
||||
/** The connectivity to the server changed. This means that you should refresh the connectivity view and possibly the connectivtiy HTML; see getConnectivity() and getConnectivityHtml() for details. */
|
||||
public static class ConnectivityChanged extends EventType {
|
||||
}
|
||||
|
||||
/** Deprecated by `ConfigSynced`. */
|
||||
public static class SelfavatarChanged extends EventType {
|
||||
}
|
||||
|
||||
/** A multi-device synced config value changed. Maybe the app needs to refresh smth. For uniformity this is emitted on the source device too. The value isn't here, otherwise it would be logged which might not be good for privacy. */
|
||||
public static class ConfigSynced extends EventType {
|
||||
/** Configuration key. */
|
||||
public String key;
|
||||
}
|
||||
|
||||
public static class WebxdcStatusUpdate extends EventType {
|
||||
/** Message ID. */
|
||||
public Integer msgId;
|
||||
/** Status update ID. */
|
||||
public Integer statusUpdateSerial;
|
||||
}
|
||||
|
||||
/** Data received over an ephemeral peer channel. */
|
||||
public static class WebxdcRealtimeData extends EventType {
|
||||
/** Realtime data. */
|
||||
public java.util.List<Integer> data;
|
||||
/** Message ID. */
|
||||
public Integer msgId;
|
||||
}
|
||||
|
||||
/** Advertisement received over an ephemeral peer channel. This can be used by bots to initiate peer-to-peer communication from their side. */
|
||||
public static class WebxdcRealtimeAdvertisementReceived extends EventType {
|
||||
/** Message ID of the webxdc instance. */
|
||||
public Integer msgId;
|
||||
}
|
||||
|
||||
/** Inform that a message containing a webxdc instance has been deleted */
|
||||
public static class WebxdcInstanceDeleted extends EventType {
|
||||
/** ID of the deleted message. */
|
||||
public Integer msgId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells that the Background fetch was completed (or timed out). This event acts as a marker, when you reach this event you can be sure that all events emitted during the background fetch were processed.
|
||||
* <p>
|
||||
* This event is only emitted by the account manager
|
||||
*/
|
||||
public static class AccountsBackgroundFetchDone extends EventType {
|
||||
}
|
||||
|
||||
/**
|
||||
* Inform that set of chats or the order of the chats in the chatlist has changed.
|
||||
* <p>
|
||||
* Sometimes this is emitted together with `UIChatlistItemChanged`.
|
||||
*/
|
||||
public static class ChatlistChanged extends EventType {
|
||||
}
|
||||
|
||||
/** Inform that a single chat list item changed and needs to be rerendered. If `chat_id` is set to None, then all currently visible chats need to be rerendered, and all not-visible items need to be cleared from cache if the UI has a cache. */
|
||||
public static class ChatlistItemChanged extends EventType {
|
||||
/** ID of the changed chat */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer chatId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inform that the list of accounts has changed (an account removed or added or (not yet implemented) the account order changes)
|
||||
* <p>
|
||||
* This event is only emitted by the account manager
|
||||
*/
|
||||
public static class AccountsChanged extends EventType {
|
||||
}
|
||||
|
||||
/**
|
||||
* Inform that an account property that might be shown in the account list changed, namely: - is_configured (see is_configured()) - displayname - selfavatar - private_tag
|
||||
* <p>
|
||||
* This event is emitted from the account whose property changed.
|
||||
*/
|
||||
public static class AccountsItemChanged extends EventType {
|
||||
}
|
||||
|
||||
/** Inform than some events have been skipped due to event channel overflow. */
|
||||
public static class EventChannelOverflow extends EventType {
|
||||
/** Number of events skipped. */
|
||||
public Integer n;
|
||||
}
|
||||
|
||||
/** Incoming call. */
|
||||
public static class IncomingCall extends EventType {
|
||||
/** ID of the chat which the message belongs to. */
|
||||
public Integer chat_id;
|
||||
/** True if incoming call is a video call. */
|
||||
public Boolean has_video;
|
||||
/** ID of the info message referring to the call. */
|
||||
public Integer msg_id;
|
||||
/** User-defined info as passed to place_outgoing_call() */
|
||||
public String place_call_info;
|
||||
}
|
||||
|
||||
/** Incoming call accepted. This is esp. interesting to stop ringing on other devices. */
|
||||
public static class IncomingCallAccepted extends EventType {
|
||||
/** ID of the chat which the message belongs to. */
|
||||
public Integer chat_id;
|
||||
/** ID of the info message referring to the call. */
|
||||
public Integer msg_id;
|
||||
}
|
||||
|
||||
/** Outgoing call accepted. */
|
||||
public static class OutgoingCallAccepted extends EventType {
|
||||
/** User-defined info passed to dc_accept_incoming_call( */
|
||||
public String accept_call_info;
|
||||
/** ID of the chat which the message belongs to. */
|
||||
public Integer chat_id;
|
||||
/** ID of the info message referring to the call. */
|
||||
public Integer msg_id;
|
||||
}
|
||||
|
||||
/** Call ended. */
|
||||
public static class CallEnded extends EventType {
|
||||
/** ID of the chat which the message belongs to. */
|
||||
public Integer chat_id;
|
||||
/** ID of the info message referring to the call. */
|
||||
public Integer msg_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* One or more transports has changed.
|
||||
* <p>
|
||||
* UI should update the list.
|
||||
* <p>
|
||||
* This event is emitted when transport synchronization messages arrives, but not when the UI modifies the transport list by itself.
|
||||
*/
|
||||
public static class TransportsModified extends EventType {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class FullChat {
|
||||
public Boolean archived;
|
||||
public Boolean canSend;
|
||||
public ChatType chatType;
|
||||
public String color;
|
||||
public java.util.List<Integer> contactIds;
|
||||
public Integer ephemeralTimer;
|
||||
public Integer freshMessageCounter;
|
||||
public Integer id;
|
||||
public Boolean isContactRequest;
|
||||
public Boolean isDeviceChat;
|
||||
/**
|
||||
* True if the chat is encrypted. This means that all messages in the chat are encrypted, and all contacts in the chat are "key-contacts", i.e. identified by the PGP key fingerprint.
|
||||
* <p>
|
||||
* False if the chat is unencrypted. This means that all messages in the chat are unencrypted, and all contacts in the chat are "address-contacts", i.e. identified by the email address. The UI should mark this chat e.g. with a mail-letter icon.
|
||||
* <p>
|
||||
* Unencrypted groups are called "ad-hoc groups" and the user can't add/remove members, create a QR invite code, or set an avatar. These options should therefore be disabled in the UI.
|
||||
* <p>
|
||||
* Note that it can happen that an encrypted chat contains unencrypted messages that were received in core <= v1.159.* and vice versa.
|
||||
* <p>
|
||||
* See also `is_key_contact` on `Contact`.
|
||||
*/
|
||||
public Boolean isEncrypted;
|
||||
public Boolean isMuted;
|
||||
public Boolean isSelfTalk;
|
||||
public Boolean isUnpromoted;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String mailingListAddress;
|
||||
public String name;
|
||||
/** Contact IDs of the past chat members. */
|
||||
public java.util.List<Integer> pastContactIds;
|
||||
public Boolean pinned;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String profileImage;
|
||||
/** Note that this is different from [`ChatListItem::is_self_in_group`](`crate::api::types::chat_list::ChatListItemFetchResult::ChatListItem::is_self_in_group`). This property should only be accessed when [`FullChat::chat_type`] is [`Chattype::Group`]. */
|
||||
public Boolean selfInGroup;
|
||||
public Boolean wasSeenRecently;
|
||||
}
|
||||
@@ -2,12 +2,12 @@
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class HttpResponse {
|
||||
/* base64-encoded response body. */
|
||||
/** base64-encoded response body. */
|
||||
public String blob;
|
||||
/* Encoding, e.g. "utf-8". */
|
||||
/** Encoding, e.g. "utf-8". */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String encoding;
|
||||
/* MIME type, e.g. "text/plain" or "text/html". */
|
||||
/** MIME type, e.g. "text/plain" or "text/html". */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String mimetype;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class Location {
|
||||
public Float accuracy;
|
||||
public Integer chatId;
|
||||
public Integer contactId;
|
||||
public Boolean isIndependent;
|
||||
public Float latitude;
|
||||
public Integer locationId;
|
||||
public Float longitude;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String marker;
|
||||
public Integer msgId;
|
||||
public Integer timestamp;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class Message {
|
||||
public Integer chatId;
|
||||
public Integer dimensionsHeight;
|
||||
public Integer dimensionsWidth;
|
||||
public DownloadState downloadState;
|
||||
public Integer duration;
|
||||
/** An error text, if there is one. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String error;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String file;
|
||||
/** The size of the file in bytes, if applicable. If message is a pre-message, then this is the size of the file to be downloaded. */
|
||||
public Integer fileBytes;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String fileMime;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String fileName;
|
||||
public Integer fromId;
|
||||
public Boolean hasDeviatingTimestamp;
|
||||
public Boolean hasHtml;
|
||||
/** Check if a message has a POI location bound to it. These locations are also returned by `get_locations` method. The UI may decide to display a special icon beside such messages. */
|
||||
public Boolean hasLocation;
|
||||
public Integer id;
|
||||
/** if is_info is set, this refers to the contact profile that should be opened when the info message is tapped. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer infoContactId;
|
||||
/** True if the message was sent by a bot. */
|
||||
public Boolean isBot;
|
||||
public Boolean isEdited;
|
||||
public Boolean isForwarded;
|
||||
public Boolean isInfo;
|
||||
public Boolean isSetupmessage;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer originalMsgId;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String overrideSenderName;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer parentId;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public MessageQuote quote;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Reactions reactions;
|
||||
public Integer receivedTimestamp;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer savedMessageId;
|
||||
public Contact sender;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String setupCodeBegin;
|
||||
/**
|
||||
* True if the message was correctly encrypted&signed, false otherwise. Historically, UIs showed a small padlock on the message then.
|
||||
* <p>
|
||||
* Today, the UIs should instead show a small email-icon on the message if `show_padlock` is `false`, and nothing if it is `true`.
|
||||
*/
|
||||
public Boolean showPadlock;
|
||||
public Integer sortTimestamp;
|
||||
public Integer state;
|
||||
public String subject;
|
||||
/** when is_info is true this describes what type of system message it is */
|
||||
public SystemMessageType systemMessageType;
|
||||
public String text;
|
||||
public Integer timestamp;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public VcardContact vcardContact;
|
||||
public Viewtype viewType;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String webxdcHref;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class MessageData {
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String file;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String filename;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String html;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Pair<Float, Float> location;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String overrideSenderName;
|
||||
/** Quoted message id. Takes preference over `quoted_text` (see below). */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer quotedMessageId;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String quotedText;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String text;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Viewtype viewtype;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class MessageInfo {
|
||||
public EphemeralTimer ephemeralTimer;
|
||||
/** When message is ephemeral this contains the timestamp of the message expiry */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer ephemeralTimestamp;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String error;
|
||||
public String hopInfo;
|
||||
public String rfc724Mid;
|
||||
public java.util.List<String> serverUrls;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||
|
||||
@JsonTypeInfo(use=Id.NAME, include=As.PROPERTY, property="kind")
|
||||
@JsonSubTypes({@Type(value = MessageListItem.Message.class, name="Message"), @Type(value = MessageListItem.DayMarker.class, name="DayMarker")})
|
||||
public abstract class MessageListItem {
|
||||
|
||||
public static class Message extends MessageListItem {
|
||||
public Integer msg_id;
|
||||
}
|
||||
|
||||
/** Day marker, separating messages that correspond to different days according to local time. */
|
||||
public static class DayMarker extends MessageListItem {
|
||||
/** Marker timestamp, for day markers, in unix milliseconds */
|
||||
public Integer timestamp;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||
|
||||
@JsonTypeInfo(use=Id.NAME, include=As.PROPERTY, property="kind")
|
||||
@JsonSubTypes({@Type(value = MessageLoadResult.Message.class, name="Message"), @Type(value = MessageLoadResult.LoadingError.class, name="LoadingError")})
|
||||
public abstract class MessageLoadResult {
|
||||
|
||||
public static class Message extends MessageLoadResult {
|
||||
public Integer chatId;
|
||||
public Integer dimensionsHeight;
|
||||
public Integer dimensionsWidth;
|
||||
public DownloadState downloadState;
|
||||
public Integer duration;
|
||||
/** An error text, if there is one. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String error;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String file;
|
||||
/** The size of the file in bytes, if applicable. If message is a pre-message, then this is the size of the file to be downloaded. */
|
||||
public Integer fileBytes;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String fileMime;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String fileName;
|
||||
public Integer fromId;
|
||||
public Boolean hasDeviatingTimestamp;
|
||||
public Boolean hasHtml;
|
||||
/** Check if a message has a POI location bound to it. These locations are also returned by `get_locations` method. The UI may decide to display a special icon beside such messages. */
|
||||
public Boolean hasLocation;
|
||||
public Integer id;
|
||||
/** if is_info is set, this refers to the contact profile that should be opened when the info message is tapped. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer infoContactId;
|
||||
/** True if the message was sent by a bot. */
|
||||
public Boolean isBot;
|
||||
public Boolean isEdited;
|
||||
public Boolean isForwarded;
|
||||
public Boolean isInfo;
|
||||
public Boolean isSetupmessage;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer originalMsgId;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String overrideSenderName;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer parentId;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public MessageQuote quote;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Reactions reactions;
|
||||
public Integer receivedTimestamp;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer savedMessageId;
|
||||
public Contact sender;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String setupCodeBegin;
|
||||
/**
|
||||
* True if the message was correctly encrypted&signed, false otherwise. Historically, UIs showed a small padlock on the message then.
|
||||
* <p>
|
||||
* Today, the UIs should instead show a small email-icon on the message if `show_padlock` is `false`, and nothing if it is `true`.
|
||||
*/
|
||||
public Boolean showPadlock;
|
||||
public Integer sortTimestamp;
|
||||
public Integer state;
|
||||
public String subject;
|
||||
/** when is_info is true this describes what type of system message it is */
|
||||
public SystemMessageType systemMessageType;
|
||||
public String text;
|
||||
public Integer timestamp;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public VcardContact vcardContact;
|
||||
public Viewtype viewType;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String webxdcHref;
|
||||
}
|
||||
|
||||
public static class LoadingError extends MessageLoadResult {
|
||||
public String error;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class MessageNotificationInfo {
|
||||
public Integer accountId;
|
||||
public Integer chatId;
|
||||
public String chatName;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String chatProfileImage;
|
||||
public Integer id;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String image;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String imageMimeType;
|
||||
/** also known as summary_text1 */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String summaryPrefix;
|
||||
/** also known as summary_text2 */
|
||||
public String summaryText;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||
|
||||
@JsonTypeInfo(use=Id.NAME, include=As.PROPERTY, property="kind")
|
||||
@JsonSubTypes({@Type(value = MessageQuote.JustText.class, name="JustText"), @Type(value = MessageQuote.WithMessage.class, name="WithMessage")})
|
||||
public abstract class MessageQuote {
|
||||
|
||||
public static class JustText extends MessageQuote {
|
||||
public String text;
|
||||
}
|
||||
|
||||
public static class WithMessage extends MessageQuote {
|
||||
public String authorDisplayColor;
|
||||
public String authorDisplayName;
|
||||
/** The quoted message does not always belong to the same chat, e.g. when "Reply Privately" is used. */
|
||||
public Integer chatId;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String image;
|
||||
public Boolean isForwarded;
|
||||
public Integer messageId;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String overrideSenderName;
|
||||
public String text;
|
||||
public Viewtype viewType;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class MessageReadReceipt {
|
||||
public Integer contactId;
|
||||
public Integer timestamp;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class MessageSearchResult {
|
||||
public String authorColor;
|
||||
public Integer authorId;
|
||||
/** if sender name if overridden it will show it as ~alias */
|
||||
public String authorName;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String authorProfileImage;
|
||||
public String chatColor;
|
||||
public Integer chatId;
|
||||
public String chatName;
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String chatProfileImage;
|
||||
public ChatType chatType;
|
||||
public Integer id;
|
||||
public Boolean isChatArchived;
|
||||
public Boolean isChatContactRequest;
|
||||
public String message;
|
||||
public Integer timestamp;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||
|
||||
@JsonTypeInfo(use=Id.NAME, include=As.PROPERTY, property="kind")
|
||||
@JsonSubTypes({@Type(value = MuteDuration.NotMuted.class, name="NotMuted"), @Type(value = MuteDuration.Forever.class, name="Forever"), @Type(value = MuteDuration.Until.class, name="Until")})
|
||||
public abstract class MuteDuration {
|
||||
|
||||
public static class NotMuted extends MuteDuration {
|
||||
}
|
||||
|
||||
public static class Forever extends MuteDuration {
|
||||
}
|
||||
|
||||
public static class Until extends MuteDuration {
|
||||
public Integer duration;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public enum NotifyState {
|
||||
/** Not subscribed to push notifications. */
|
||||
NotConnected,
|
||||
|
||||
/** Subscribed to heartbeat push notifications. */
|
||||
Heartbeat,
|
||||
|
||||
/** Subscribed to push notifications for new messages. */
|
||||
Connected,
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class Pair<T1, T2> {
|
||||
private final T1 v1;
|
||||
private final T2 v2;
|
||||
|
||||
public Pair(T1 v1, T2 v2) {
|
||||
this.v1 = v1;
|
||||
this.v2 = v2;
|
||||
}
|
||||
|
||||
public T1 first(){
|
||||
return v1;
|
||||
}
|
||||
|
||||
public T2 second(){
|
||||
return v2;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Pair &&
|
||||
equal(((Pair) o).first(), first()) &&
|
||||
equal(((Pair) o).second(), second());
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return first().hashCode() ^ second().hashCode();
|
||||
}
|
||||
|
||||
private boolean equal(Object first, Object second) {
|
||||
if (first == null && second == null) return true;
|
||||
if (first == null || second == null) return false;
|
||||
return first.equals(second);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class ProviderInfo {
|
||||
public String beforeLoginHint;
|
||||
/** Unique ID, corresponding to provider database filename. */
|
||||
public String id;
|
||||
public String overviewPage;
|
||||
public Integer status;
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||
|
||||
@JsonTypeInfo(use=Id.NAME, include=As.PROPERTY, property="kind")
|
||||
@JsonSubTypes({@Type(value = Qr.AskVerifyContact.class, name="AskVerifyContact"), @Type(value = Qr.AskVerifyGroup.class, name="AskVerifyGroup"), @Type(value = Qr.AskJoinBroadcast.class, name="AskJoinBroadcast"), @Type(value = Qr.FprOk.class, name="FprOk"), @Type(value = Qr.FprMismatch.class, name="FprMismatch"), @Type(value = Qr.FprWithoutAddr.class, name="FprWithoutAddr"), @Type(value = Qr.Account.class, name="Account"), @Type(value = Qr.Backup2.class, name="Backup2"), @Type(value = Qr.BackupTooNew.class, name="BackupTooNew"), @Type(value = Qr.WebrtcInstance.class, name="WebrtcInstance"), @Type(value = Qr.Proxy.class, name="Proxy"), @Type(value = Qr.Addr.class, name="Addr"), @Type(value = Qr.Url.class, name="Url"), @Type(value = Qr.Text.class, name="Text"), @Type(value = Qr.WithdrawVerifyContact.class, name="WithdrawVerifyContact"), @Type(value = Qr.WithdrawVerifyGroup.class, name="WithdrawVerifyGroup"), @Type(value = Qr.WithdrawJoinBroadcast.class, name="WithdrawJoinBroadcast"), @Type(value = Qr.ReviveVerifyContact.class, name="ReviveVerifyContact"), @Type(value = Qr.ReviveVerifyGroup.class, name="ReviveVerifyGroup"), @Type(value = Qr.ReviveJoinBroadcast.class, name="ReviveJoinBroadcast"), @Type(value = Qr.Login.class, name="Login")})
|
||||
public abstract class Qr {
|
||||
|
||||
/**
|
||||
* Ask the user whether to verify the contact.
|
||||
* <p>
|
||||
* If the user agrees, pass this QR code to [`crate::securejoin::join_securejoin`].
|
||||
*/
|
||||
public static class AskVerifyContact extends Qr {
|
||||
/** Authentication code. */
|
||||
public String authcode;
|
||||
/** ID of the contact. */
|
||||
public Integer contact_id;
|
||||
/** Fingerprint of the contact key as scanned from the QR code. */
|
||||
public String fingerprint;
|
||||
/** Invite number. */
|
||||
public String invitenumber;
|
||||
}
|
||||
|
||||
/** Ask the user whether to join the group. */
|
||||
public static class AskVerifyGroup extends Qr {
|
||||
/** Authentication code. */
|
||||
public String authcode;
|
||||
/** ID of the contact. */
|
||||
public Integer contact_id;
|
||||
/** Fingerprint of the contact key as scanned from the QR code. */
|
||||
public String fingerprint;
|
||||
/** Group ID. */
|
||||
public String grpid;
|
||||
/** Group name. */
|
||||
public String grpname;
|
||||
/** Invite number. */
|
||||
public String invitenumber;
|
||||
}
|
||||
|
||||
/** Ask the user whether to join the broadcast channel. */
|
||||
public static class AskJoinBroadcast extends Qr {
|
||||
/** Authentication code. */
|
||||
public String authcode;
|
||||
/** ID of the contact who owns the broadcast channel and created the QR code. */
|
||||
public Integer contact_id;
|
||||
/** Fingerprint of the broadcast channel owner's key as scanned from the QR code. */
|
||||
public String fingerprint;
|
||||
/** A string of random characters, uniquely identifying this broadcast channel across all databases/clients. Called `grpid` for historic reasons: The id of multi-user chats is always called `grpid` in the database because groups were once the only multi-user chats. */
|
||||
public String grpid;
|
||||
/** Invite number. */
|
||||
public String invitenumber;
|
||||
/** The user-visible name of this broadcast channel */
|
||||
public String name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Contact fingerprint is verified.
|
||||
* <p>
|
||||
* Ask the user if they want to start chatting.
|
||||
*/
|
||||
public static class FprOk extends Qr {
|
||||
/** Contact ID. */
|
||||
public Integer contact_id;
|
||||
}
|
||||
|
||||
/** Scanned fingerprint does not match the last seen fingerprint. */
|
||||
public static class FprMismatch extends Qr {
|
||||
/** Contact ID. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer contact_id;
|
||||
}
|
||||
|
||||
/** The scanned QR code contains a fingerprint but no e-mail address. */
|
||||
public static class FprWithoutAddr extends Qr {
|
||||
/** Key fingerprint. */
|
||||
public String fingerprint;
|
||||
}
|
||||
|
||||
/** Ask the user if they want to create an account on the given domain. */
|
||||
public static class Account extends Qr {
|
||||
/** Server domain name. */
|
||||
public String domain;
|
||||
}
|
||||
|
||||
/** Provides a backup that can be retrieved using iroh-net based backup transfer protocol. */
|
||||
public static class Backup2 extends Qr {
|
||||
/** Authentication token. */
|
||||
public String auth_token;
|
||||
/** Iroh node address. */
|
||||
public String node_addr;
|
||||
}
|
||||
|
||||
public static class BackupTooNew extends Qr {
|
||||
}
|
||||
|
||||
/** Ask the user if they want to use the given service for video chats. */
|
||||
public static class WebrtcInstance extends Qr {
|
||||
public String domain;
|
||||
public String instance_pattern;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask the user if they want to use the given proxy.
|
||||
* <p>
|
||||
* Note that HTTP(S) URLs without a path and query parameters are treated as HTTP(S) proxy URL. UI may want to still offer to open the URL in the browser if QR code contents starts with `http://` or `https://` and the QR code was not scanned from the proxy configuration screen.
|
||||
*/
|
||||
public static class Proxy extends Qr {
|
||||
/** Host extracted from the URL to display in the UI. */
|
||||
public String host;
|
||||
/** Port extracted from the URL to display in the UI. */
|
||||
public Integer port;
|
||||
/**
|
||||
* Proxy URL.
|
||||
* <p>
|
||||
* This is the URL that is going to be added.
|
||||
*/
|
||||
public String url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Contact address is scanned.
|
||||
* <p>
|
||||
* Optionally, a draft message could be provided. Ask the user if they want to start chatting.
|
||||
*/
|
||||
public static class Addr extends Qr {
|
||||
/** Contact ID. */
|
||||
public Integer contact_id;
|
||||
/** Draft message. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String draft;
|
||||
}
|
||||
|
||||
/**
|
||||
* URL scanned.
|
||||
* <p>
|
||||
* Ask the user if they want to open a browser or copy the URL to clipboard.
|
||||
*/
|
||||
public static class Url extends Qr {
|
||||
public String url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Text scanned.
|
||||
* <p>
|
||||
* Ask the user if they want to copy the text to clipboard.
|
||||
*/
|
||||
public static class Text extends Qr {
|
||||
public String text;
|
||||
}
|
||||
|
||||
/** Ask the user if they want to withdraw their own QR code. */
|
||||
public static class WithdrawVerifyContact extends Qr {
|
||||
/** Authentication code. */
|
||||
public String authcode;
|
||||
/** Contact ID. */
|
||||
public Integer contact_id;
|
||||
/** Fingerprint of the contact key as scanned from the QR code. */
|
||||
public String fingerprint;
|
||||
/** Invite number. */
|
||||
public String invitenumber;
|
||||
}
|
||||
|
||||
/** Ask the user if they want to withdraw their own group invite QR code. */
|
||||
public static class WithdrawVerifyGroup extends Qr {
|
||||
/** Authentication code. */
|
||||
public String authcode;
|
||||
/** Contact ID. */
|
||||
public Integer contact_id;
|
||||
/** Fingerprint of the contact key as scanned from the QR code. */
|
||||
public String fingerprint;
|
||||
/** Group ID. */
|
||||
public String grpid;
|
||||
/** Group name. */
|
||||
public String grpname;
|
||||
/** Invite number. */
|
||||
public String invitenumber;
|
||||
}
|
||||
|
||||
/** Ask the user if they want to withdraw their own broadcast channel invite QR code. */
|
||||
public static class WithdrawJoinBroadcast extends Qr {
|
||||
/** Authentication code. */
|
||||
public String authcode;
|
||||
/** Contact ID. Always `ContactId::SELF`. */
|
||||
public Integer contact_id;
|
||||
/** Fingerprint of the contact key as scanned from the QR code. */
|
||||
public String fingerprint;
|
||||
/** ID, uniquely identifying this chat. Called grpid for historic reasons. */
|
||||
public String grpid;
|
||||
/** Invite number. */
|
||||
public String invitenumber;
|
||||
/** Broadcast name. */
|
||||
public String name;
|
||||
}
|
||||
|
||||
/** Ask the user if they want to revive their own QR code. */
|
||||
public static class ReviveVerifyContact extends Qr {
|
||||
/** Authentication code. */
|
||||
public String authcode;
|
||||
/** Contact ID. */
|
||||
public Integer contact_id;
|
||||
/** Fingerprint of the contact key as scanned from the QR code. */
|
||||
public String fingerprint;
|
||||
/** Invite number. */
|
||||
public String invitenumber;
|
||||
}
|
||||
|
||||
/** Ask the user if they want to revive their own group invite QR code. */
|
||||
public static class ReviveVerifyGroup extends Qr {
|
||||
/** Authentication code. */
|
||||
public String authcode;
|
||||
/** Contact ID. */
|
||||
public Integer contact_id;
|
||||
/** Fingerprint of the contact key as scanned from the QR code. */
|
||||
public String fingerprint;
|
||||
/** Group ID. */
|
||||
public String grpid;
|
||||
/** Contact ID. */
|
||||
public String grpname;
|
||||
/** Invite number. */
|
||||
public String invitenumber;
|
||||
}
|
||||
|
||||
/** Ask the user if they want to revive their own broadcast channel invite QR code. */
|
||||
public static class ReviveJoinBroadcast extends Qr {
|
||||
/** Authentication code. */
|
||||
public String authcode;
|
||||
/** Contact ID. Always `ContactId::SELF`. */
|
||||
public Integer contact_id;
|
||||
/** Fingerprint of the contact key as scanned from the QR code. */
|
||||
public String fingerprint;
|
||||
/** Globally unique chat ID. Called grpid for historic reasons. */
|
||||
public String grpid;
|
||||
/** Invite number. */
|
||||
public String invitenumber;
|
||||
/** Broadcast name. */
|
||||
public String name;
|
||||
}
|
||||
|
||||
/**
|
||||
* `dclogin:` scheme parameters.
|
||||
* <p>
|
||||
* Ask the user if they want to login with the email address.
|
||||
*/
|
||||
public static class Login extends Qr {
|
||||
public String address;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
/* A single reaction emoji. */
|
||||
/** A single reaction emoji. */
|
||||
public class Reaction {
|
||||
/* Emoji frequency. */
|
||||
/** Emoji frequency. */
|
||||
public Integer count;
|
||||
/* Emoji. */
|
||||
/** Emoji. */
|
||||
public String emoji;
|
||||
/* True if we reacted with this emoji. */
|
||||
/** True if we reacted with this emoji. */
|
||||
public Boolean isFromSelf;
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
/* Structure representing all reactions to a particular message. */
|
||||
/** Structure representing all reactions to a particular message. */
|
||||
public class Reactions {
|
||||
/* Unique reactions and their count, sorted in descending order. */
|
||||
/** Unique reactions and their count, sorted in descending order. */
|
||||
public java.util.List<Reaction> reactions;
|
||||
/* Map from a contact to it's reaction to message. */
|
||||
/** Map from a contact to it's reaction to message. */
|
||||
public java.util.Map<String, java.util.List<String>> reactionsByContact;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public enum SecurejoinSource {
|
||||
/** Because of some problem, it is unknown where the QR code came from. */
|
||||
Unknown,
|
||||
|
||||
/** The user opened a link somewhere outside Delta Chat */
|
||||
ExternalLink,
|
||||
|
||||
/** The user clicked on a link in a message inside Delta Chat */
|
||||
InternalLink,
|
||||
|
||||
/** The user clicked "Paste from Clipboard" in the QR scan activity */
|
||||
Clipboard,
|
||||
|
||||
/** The user clicked "Load QR code as image" in the QR scan activity */
|
||||
ImageLoaded,
|
||||
|
||||
/** The user scanned a QR code */
|
||||
Scan,
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public enum SecurejoinUiPath {
|
||||
/** The UI path is unknown, or the user didn't open the QR code screen at all. */
|
||||
Unknown,
|
||||
|
||||
/** The user directly clicked on the QR icon in the main screen */
|
||||
QrIcon,
|
||||
|
||||
/** The user first clicked on the `+` button in the main screen, and then on "New Contact" */
|
||||
NewContact,
|
||||
}
|
||||
@@ -2,15 +2,15 @@
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public enum Socket {
|
||||
/* Unspecified socket security, select automatically. */
|
||||
/** Unspecified socket security, select automatically. */
|
||||
automatic,
|
||||
|
||||
/* TLS connection. */
|
||||
/** TLS connection. */
|
||||
ssl,
|
||||
|
||||
/* STARTTLS connection. */
|
||||
/** STARTTLS connection. */
|
||||
starttls,
|
||||
|
||||
/* No TLS, plaintext connection. */
|
||||
/** No TLS, plaintext connection. */
|
||||
plain,
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public enum SystemMessageType {
|
||||
Unknown,
|
||||
GroupNameChanged,
|
||||
GroupImageChanged,
|
||||
MemberAddedToGroup,
|
||||
MemberRemovedFromGroup,
|
||||
AutocryptSetupMessage,
|
||||
SecurejoinMessage,
|
||||
LocationStreamingEnabled,
|
||||
LocationOnly,
|
||||
InvalidUnencryptedMail,
|
||||
ChatE2ee,
|
||||
ChatProtectionEnabled,
|
||||
ChatProtectionDisabled,
|
||||
WebxdcStatusUpdate,
|
||||
CallAccepted,
|
||||
CallEnded,
|
||||
|
||||
/** 1:1 chats info message telling that SecureJoin has started and the user should wait for it to complete. */
|
||||
SecurejoinWait,
|
||||
|
||||
/** 1:1 chats info message telling that SecureJoin is still running, but the user may already send messages. */
|
||||
SecurejoinWaitTimeout,
|
||||
|
||||
/** Chat ephemeral message timer is changed. */
|
||||
EphemeralTimerChanged,
|
||||
|
||||
/** Self-sent-message that contains only json used for multi-device-sync; if possible, we attach that to other messages as for locations. */
|
||||
MultiDeviceSync,
|
||||
|
||||
/** Webxdc info added with `info` set in `send_webxdc_status_update()`. */
|
||||
WebxdcInfoMessage,
|
||||
|
||||
/** This message contains a users iroh node address. */
|
||||
IrohNodeAddr,
|
||||
}
|
||||
@@ -2,19 +2,19 @@
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class VcardContact {
|
||||
/* Email address. */
|
||||
/** Email address. */
|
||||
public String addr;
|
||||
/* Contact color as hex string. */
|
||||
/** Contact color as hex string. */
|
||||
public String color;
|
||||
/* The contact's name, or the email address if no name was given. */
|
||||
/** The contact's name, or the email address if no name was given. */
|
||||
public String displayName;
|
||||
/* Public PGP key in Base64. */
|
||||
/** Public PGP key in Base64. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String key;
|
||||
/* Profile image in Base64. */
|
||||
/** Profile image in Base64. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String profileImage;
|
||||
/* Last update timestamp. */
|
||||
/** Last update timestamp. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public Integer timestamp;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public enum Viewtype {
|
||||
Unknown,
|
||||
|
||||
/** Text message. */
|
||||
Text,
|
||||
|
||||
/** Image message. If the image is an animated GIF, the type `Viewtype.Gif` should be used. */
|
||||
Image,
|
||||
|
||||
/** Animated GIF message. */
|
||||
Gif,
|
||||
|
||||
/**
|
||||
* Message containing a sticker, similar to image. NB: When sending, the message viewtype may be changed to `Image` by some heuristics like checking for transparent pixels. Use `Message::force_sticker()` to disable them.
|
||||
* <p>
|
||||
* If possible, the ui should display the image without borders in a transparent way. A click on a sticker will offer to install the sticker set in some future.
|
||||
*/
|
||||
Sticker,
|
||||
|
||||
/** Message containing an Audio file. */
|
||||
Audio,
|
||||
|
||||
/** A voice message that was directly recorded by the user. For all other audio messages, the type `Viewtype.Audio` should be used. */
|
||||
Voice,
|
||||
|
||||
/** Video messages. */
|
||||
Video,
|
||||
|
||||
/** Message containing any file, eg. a PDF. */
|
||||
File,
|
||||
|
||||
/** Message is a call. */
|
||||
Call,
|
||||
|
||||
/** Message is an webxdc instance. */
|
||||
Webxdc,
|
||||
|
||||
/** Message containing shared contacts represented as a vCard (virtual contact file) with email addresses and possibly other fields. Use `parse_vcard()` to retrieve them. */
|
||||
Vcard,
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/* Autogenerated file, do not edit manually */
|
||||
package chat.delta.rpc.types;
|
||||
|
||||
public class WebxdcMessageInfo {
|
||||
/** if the Webxdc represents a document, then this is the name of the document */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String document;
|
||||
/**
|
||||
* App icon file name. Defaults to an standard icon if nothing is set in the manifest.
|
||||
* <p>
|
||||
* To get the file, use dc_msg_get_webxdc_blob(). (not yet in jsonrpc, use rust api or cffi for it)
|
||||
* <p>
|
||||
* App icons should should be square, the implementations will add round corners etc. as needed.
|
||||
*/
|
||||
public String icon;
|
||||
/** True if full internet access should be granted to the app. */
|
||||
public Boolean internetAccess;
|
||||
/**
|
||||
* The name of the app.
|
||||
* <p>
|
||||
* Defaults to the filename if not set in the manifest.
|
||||
*/
|
||||
public String name;
|
||||
/** Address to be used for `window.webxdc.selfAddr` in JS land. */
|
||||
public String selfAddr;
|
||||
/** Milliseconds to wait before calling `sendUpdate()` again since the last call. Should be exposed to `window.sendUpdateInterval` in JS land. */
|
||||
public Integer sendUpdateInterval;
|
||||
/** Maximum number of bytes accepted for a serialized update object. Should be exposed to `window.sendUpdateMaxSize` in JS land. */
|
||||
public Integer sendUpdateMaxSize;
|
||||
/** URL where the source code of the Webxdc and other information can be found; defaults to an empty string. Implementations may offer an menu or a button to open this URL. */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String sourceCodeUrl;
|
||||
/** short string describing the state of the app, sth. as "2 votes", "Highscore: 123", can be changed by the apps */
|
||||
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
|
||||
public String summary;
|
||||
}
|
||||
@@ -4,6 +4,7 @@ public class DcAccounts {
|
||||
|
||||
public DcAccounts(String dir) {
|
||||
accountsCPtr = createAccountsCPtr(dir);
|
||||
if (accountsCPtr == 0) throw new RuntimeException("createAccountsCPtr() returned null pointer");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -34,6 +35,7 @@ public class DcAccounts {
|
||||
public native void maybeNetwork ();
|
||||
public native void setPushDeviceToken (String token);
|
||||
public native boolean backgroundFetch (int timeoutSeconds);
|
||||
public native void stopBackgroundFetch ();
|
||||
|
||||
public native int migrateAccount (String dbfile);
|
||||
public native boolean removeAccount (int accountId);
|
||||
|
||||
@@ -35,6 +35,7 @@ public class DcContext {
|
||||
public final static int DC_EVENT_INCOMING_CALL_ACCEPTED = 2560;
|
||||
public final static int DC_EVENT_OUTGOING_CALL_ACCEPTED = 2570;
|
||||
public final static int DC_EVENT_CALL_ENDED = 2580;
|
||||
public final static int DC_EVENT_TRANSPORTS_MODIFIED = 2600;
|
||||
|
||||
public final static int DC_IMEX_EXPORT_SELF_KEYS = 1;
|
||||
public final static int DC_IMEX_IMPORT_SELF_KEYS = 2;
|
||||
@@ -68,8 +69,10 @@ public class DcContext {
|
||||
public final static int DC_QR_ERROR = 400;
|
||||
public final static int DC_QR_WITHDRAW_VERIFYCONTACT = 500;
|
||||
public final static int DC_QR_WITHDRAW_VERIFYGROUP = 502;
|
||||
public final static int DC_QR_WITHDRAW_JOINBROADCAST = 504;
|
||||
public final static int DC_QR_REVIVE_VERIFYCONTACT = 510;
|
||||
public final static int DC_QR_REVIVE_VERIFYGROUP = 512;
|
||||
public final static int DC_QR_REVIVE_JOINBROADCAST = 514;
|
||||
public final static int DC_QR_LOGIN = 520;
|
||||
|
||||
public final static int DC_SOCKET_AUTO = 0;
|
||||
|
||||
@@ -54,7 +54,6 @@ public class AllMediaDocumentsFragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
|
||||
dcContext = DcHelper.getContext(getContext());
|
||||
chatId = getArguments().getInt(CHAT_ID_EXTRA, -1);
|
||||
viewtype1 = getArguments().getInt(VIEWTYPE1, 0);
|
||||
viewtype2 = getArguments().getInt(VIEWTYPE2, 0);
|
||||
@@ -70,6 +69,9 @@ public class AllMediaDocumentsFragment
|
||||
this.noMedia = ViewUtil.findById(view, R.id.no_documents);
|
||||
this.gridManager = new StickyHeaderGridLayoutManager(1);
|
||||
|
||||
// add padding to avoid content hidden behind system bars
|
||||
ViewUtil.applyWindowInsets(recyclerView, true, false, true, true);
|
||||
|
||||
this.recyclerView.setAdapter(new AllMediaDocumentsAdapter(getContext(),
|
||||
new BucketedThreadMediaLoader.BucketedThreadMedia(getContext()),
|
||||
this));
|
||||
|
||||
@@ -52,7 +52,6 @@ public class AllMediaGalleryFragment
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
|
||||
dcContext = DcHelper.getContext(getContext());
|
||||
chatId = getArguments().getInt(CHAT_ID_EXTRA, -1);
|
||||
|
||||
getLoaderManager().initLoader(0, null, this);
|
||||
@@ -66,6 +65,9 @@ public class AllMediaGalleryFragment
|
||||
this.noMedia = ViewUtil.findById(view, R.id.no_images);
|
||||
this.gridManager = new StickyHeaderGridLayoutManager(getCols());
|
||||
|
||||
// add padding to avoid content hidden behind system bars
|
||||
ViewUtil.applyWindowInsets(recyclerView, true, false, true, true);
|
||||
|
||||
this.recyclerView.setAdapter(new AllMediaGalleryAdapter(getContext(),
|
||||
GlideApp.with(this),
|
||||
new BucketedThreadMediaLoader.BucketedThreadMedia(getContext()),
|
||||
|
||||
@@ -45,6 +45,7 @@ import org.thoughtcrime.securesms.util.DynamicTheme;
|
||||
import org.thoughtcrime.securesms.util.Prefs;
|
||||
import org.thoughtcrime.securesms.util.SignalProtocolLoggerProvider;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.webxdc.WebxdcGarbageCollectionWorker;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintWriter;
|
||||
@@ -56,13 +57,16 @@ import chat.delta.rpc.RpcException;
|
||||
|
||||
public class ApplicationContext extends MultiDexApplication {
|
||||
private static final String TAG = ApplicationContext.class.getSimpleName();
|
||||
private static final Object initLock = new Object();
|
||||
private static volatile boolean isInitialized = false;
|
||||
|
||||
public static DcAccounts dcAccounts;
|
||||
public Rpc rpc;
|
||||
public DcContext dcContext;
|
||||
public DcLocationManager dcLocationManager;
|
||||
public DcEventCenter eventCenter;
|
||||
public NotificationCenter notificationCenter;
|
||||
private static DcAccounts dcAccounts;
|
||||
private Rpc rpc;
|
||||
private DcContext dcContext;
|
||||
|
||||
private DcLocationManager dcLocationManager;
|
||||
private DcEventCenter eventCenter;
|
||||
private NotificationCenter notificationCenter;
|
||||
private JobManager jobManager;
|
||||
|
||||
private int debugOnAvailableCount;
|
||||
@@ -74,6 +78,84 @@ public class ApplicationContext extends MultiDexApplication {
|
||||
return (ApplicationContext)context.getApplicationContext();
|
||||
}
|
||||
|
||||
private static void ensureInitialized() {
|
||||
synchronized (initLock) {
|
||||
while (!isInitialized) {
|
||||
try {
|
||||
initLock.wait();
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new RuntimeException("Interrupted while waiting for initialization", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get DcAccounts instance, waiting for initialization if necessary.
|
||||
* This method is thread-safe and will block until initialization is complete.
|
||||
*/
|
||||
public static DcAccounts getDcAccounts() {
|
||||
ensureInitialized();
|
||||
return dcAccounts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Rpc instance, waiting for initialization if necessary.
|
||||
* This method is thread-safe and will block until initialization is complete.
|
||||
*/
|
||||
public Rpc getRpc() {
|
||||
ensureInitialized();
|
||||
return rpc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get DcContext instance, waiting for initialization if necessary.
|
||||
* This method is thread-safe and will block until initialization is complete.
|
||||
*/
|
||||
public DcContext getDcContext() {
|
||||
ensureInitialized();
|
||||
return dcContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set DcContext instance. This should only be called by AccountManager when switching accounts,
|
||||
* which only happens after initial initialization is complete.
|
||||
* This method is thread-safe but does NOT trigger initialization or notify waiting threads.
|
||||
*/
|
||||
public void setDcContext(DcContext dcContext) {
|
||||
synchronized (initLock) {
|
||||
this.dcContext = dcContext;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get DcLocationManager instance, waiting for initialization if necessary.
|
||||
* This method is thread-safe and will block until initialization is complete.
|
||||
*/
|
||||
public DcLocationManager getLocationManager() {
|
||||
ensureInitialized();
|
||||
return dcLocationManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get DcEventCenter instance, waiting for initialization if necessary.
|
||||
* This method is thread-safe and will block until initialization is complete.
|
||||
*/
|
||||
public DcEventCenter getEventCenter() {
|
||||
ensureInitialized();
|
||||
return eventCenter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get NotificationCenter instance, waiting for initialization if necessary.
|
||||
* This method is thread-safe and will block until initialization is complete.
|
||||
*/
|
||||
public NotificationCenter getNotificationCenter() {
|
||||
ensureInitialized();
|
||||
return notificationCenter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
@@ -109,57 +191,91 @@ public class ApplicationContext extends MultiDexApplication {
|
||||
|
||||
System.loadLibrary("native-utils");
|
||||
|
||||
dcAccounts = new DcAccounts(new File(getFilesDir(), "accounts").getAbsolutePath());
|
||||
rpc = new Rpc(new FFITransport(dcAccounts.getJsonrpcInstance()));
|
||||
AccountManager.getInstance().migrateToDcAccounts(this);
|
||||
// Initialize DcAccounts in background to avoid ANR during SQL migrations
|
||||
Util.runOnBackground(() -> {
|
||||
synchronized (initLock) {
|
||||
try {
|
||||
dcAccounts = new DcAccounts(new File(getFilesDir(), "accounts").getAbsolutePath());
|
||||
Log.i(TAG, "DcAccounts created");
|
||||
rpc = new Rpc(new FFITransport(dcAccounts.getJsonrpcInstance()));
|
||||
Log.i(TAG, "Rpc created");
|
||||
AccountManager.getInstance().migrateToDcAccounts(this);
|
||||
|
||||
int[] allAccounts = dcAccounts.getAll();
|
||||
Log.i(TAG, "Number of profiles: " + allAccounts.length);
|
||||
for (int accountId : allAccounts) {
|
||||
DcContext ac = dcAccounts.getAccount(accountId);
|
||||
if (!ac.isOpen()) {
|
||||
try {
|
||||
DatabaseSecret secret = DatabaseSecretProvider.getOrCreateDatabaseSecret(this, accountId);
|
||||
boolean res = ac.open(secret.asString());
|
||||
if (res) Log.i(TAG, "Successfully opened account " + accountId + ", path: " + ac.getBlobdir());
|
||||
else Log.e(TAG, "Error opening account " + accountId + ", path: " + ac.getBlobdir());
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Failed to open account " + accountId + ", path: " + ac.getBlobdir() + ": " + e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// 2025-12-16: The setting was removed.
|
||||
// Revert it to the default if it was changed in the past.
|
||||
ac.setConfigInt("webxdc_realtime_enabled", 1);
|
||||
|
||||
// 2025-11-12: this is needed until core starts ignoring "delete_server_after" for chatmail
|
||||
if (ac.isChatmail()) {
|
||||
ac.setConfig("delete_server_after", null); // reset
|
||||
}
|
||||
}
|
||||
if (allAccounts.length == 0) {
|
||||
try {
|
||||
rpc.addAccount();
|
||||
} catch (RpcException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
dcContext = dcAccounts.getSelectedAccount();
|
||||
notificationCenter = new NotificationCenter(this);
|
||||
eventCenter = new DcEventCenter(this);
|
||||
dcLocationManager = new DcLocationManager(this, dcContext);
|
||||
|
||||
// Mark as initialized before starting threads that depend on it
|
||||
isInitialized = true;
|
||||
initLock.notifyAll();
|
||||
Log.i(TAG, "DcAccounts initialization complete");
|
||||
|
||||
new Thread(() -> {
|
||||
Log.i(TAG, "Starting event loop");
|
||||
DcEventEmitter emitter = dcAccounts.getEventEmitter();
|
||||
Log.i(TAG, "DcEventEmitter obtained");
|
||||
while (true) {
|
||||
DcEvent event = emitter.getNextEvent();
|
||||
if (event==null) {
|
||||
break;
|
||||
}
|
||||
eventCenter.handleEvent(event);
|
||||
}
|
||||
Log.i("DeltaChat", "shutting down event handler");
|
||||
}, "eventThread").start();
|
||||
|
||||
// set translations before starting I/O to avoid sending untranslated MDNs (issue #2288)
|
||||
DcHelper.setStockTranslations(this);
|
||||
|
||||
dcAccounts.startIo();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Fatal error during DcAccounts initialization", e);
|
||||
// Mark as initialized even on error to avoid deadlock
|
||||
isInitialized = true;
|
||||
initLock.notifyAll();
|
||||
throw new RuntimeException("Failed to initialize DcAccounts", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// October-2025 migration: delete deprecated "permanent channel" id
|
||||
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
|
||||
notificationManager.deleteNotificationChannel("dc_foreground_notification_ch");
|
||||
// end October-2025 migration
|
||||
|
||||
int[] allAccounts = dcAccounts.getAll();
|
||||
for (int accountId : allAccounts) {
|
||||
DcContext ac = dcAccounts.getAccount(accountId);
|
||||
if (!ac.isOpen()) {
|
||||
try {
|
||||
DatabaseSecret secret = DatabaseSecretProvider.getOrCreateDatabaseSecret(this, accountId);
|
||||
boolean res = ac.open(secret.asString());
|
||||
if (res) Log.i(TAG, "Successfully opened account " + accountId + ", path: " + ac.getBlobdir());
|
||||
else Log.e(TAG, "Error opening account " + accountId + ", path: " + ac.getBlobdir());
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Failed to open account " + accountId + ", path: " + ac.getBlobdir() + ": " + e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (allAccounts.length == 0) {
|
||||
try {
|
||||
rpc.addAccount();
|
||||
} catch (RpcException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
dcContext = dcAccounts.getSelectedAccount();
|
||||
notificationCenter = new NotificationCenter(this);
|
||||
eventCenter = new DcEventCenter(this);
|
||||
new Thread(() -> {
|
||||
DcEventEmitter emitter = dcAccounts.getEventEmitter();
|
||||
while (true) {
|
||||
DcEvent event = emitter.getNextEvent();
|
||||
if (event==null) {
|
||||
break;
|
||||
}
|
||||
eventCenter.handleEvent(event);
|
||||
}
|
||||
Log.i("DeltaChat", "shutting down event handler");
|
||||
}, "eventThread").start();
|
||||
|
||||
// set translations before starting I/O to avoid sending untranslated MDNs (issue #2288)
|
||||
DcHelper.setStockTranslations(this);
|
||||
|
||||
dcAccounts.startIo();
|
||||
|
||||
new ForegroundDetector(ApplicationContext.getInstance(this));
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
@@ -169,7 +285,7 @@ public class ApplicationContext extends MultiDexApplication {
|
||||
@Override
|
||||
public void onAvailable(@NonNull android.net.Network network) {
|
||||
Log.i("DeltaChat", "++++++++++++++++++ NetworkCallback.onAvailable() #" + debugOnAvailableCount++);
|
||||
dcAccounts.maybeNetwork();
|
||||
getDcAccounts().maybeNetwork();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -198,7 +314,6 @@ public class ApplicationContext extends MultiDexApplication {
|
||||
initializeJobManager();
|
||||
InChatSounds.getInstance(this);
|
||||
|
||||
dcLocationManager = new DcLocationManager(this);
|
||||
DynamicTheme.setDefaultDayNightMode(this);
|
||||
|
||||
IntentFilter filter = new IntentFilter(Intent.ACTION_LOCALE_CHANGED);
|
||||
@@ -235,6 +350,20 @@ public class ApplicationContext extends MultiDexApplication {
|
||||
ExistingPeriodicWorkPolicy.KEEP,
|
||||
fetchWorkRequest);
|
||||
}
|
||||
|
||||
PeriodicWorkRequest webxdcGarbageCollectionRequest = new PeriodicWorkRequest.Builder(
|
||||
WebxdcGarbageCollectionWorker.class,
|
||||
PeriodicWorkRequest.MIN_PERIODIC_INTERVAL_MILLIS,
|
||||
TimeUnit.MILLISECONDS,
|
||||
PeriodicWorkRequest.MIN_PERIODIC_FLEX_MILLIS,
|
||||
TimeUnit.MILLISECONDS)
|
||||
.build();
|
||||
WorkManager.getInstance(this).enqueueUniquePeriodicWork(
|
||||
"WebxdcGarbageCollectionWorker",
|
||||
ExistingPeriodicWorkPolicy.KEEP,
|
||||
webxdcGarbageCollectionRequest);
|
||||
|
||||
Log.i("DeltaChat", "+++++++++++ ApplicationContext.onCreate() finished ++++++++++");
|
||||
}
|
||||
|
||||
public JobManager getJobManager() {
|
||||
|
||||