mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-07 12:59:55 +01:00
Compare commits
311 Commits
alpha-2200
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
41e12ec19d | ||
|
b3e89633fa | ||
|
b9667e45c0 | ||
|
5606254a4a | ||
|
9cc950e30a | ||
|
4f5e2ce273 | ||
|
6b63a4f793 | ||
|
3af5981841 | ||
|
d9be063891 | ||
|
b5ec3cd2af | ||
|
fc65a7a8d0 | ||
|
6a026c1fc7 | ||
|
c9f699d0d3 | ||
|
913907a7e2 | ||
|
7f6f077680 | ||
|
632e8f85a9 | ||
|
42bd8d2235 | ||
|
33ad578ef5 | ||
|
b7ae981c3d | ||
|
81cf077f6f | ||
|
1b7b11ff76 | ||
|
c8e4de6665 | ||
|
78cb62a3bd | ||
|
59fd9f2319 | ||
|
74a1c5aeb0 | ||
|
a3a5272dbb | ||
|
dd77ce7c4c | ||
|
94db4e6892 | ||
|
99d5fc7d19 | ||
|
ba0d37020b | ||
|
c19cba3c0d | ||
|
2d0f0d9f73 | ||
|
cdb1c4b0f8 | ||
|
ea0588cb99 | ||
|
ea19f60ef3 | ||
|
3096a73585 | ||
|
dbf5c84050 | ||
|
4c7d6f90ec | ||
|
3930d4b740 | ||
|
9b3f508652 | ||
|
28556e12cd | ||
|
bd8ad9e672 | ||
|
0a44067a58 | ||
|
4d24716a4d | ||
|
1648c61b06 | ||
|
bd050f0bc0 | ||
|
f7997d339b | ||
|
28cacf2a90 | ||
|
890a7febc2 | ||
|
48e8caac0a | ||
|
a6fbac92c2 | ||
|
439912754b | ||
|
8792ac1dbd | ||
|
adc0be1d1d | ||
|
5fccf47353 | ||
|
324e02a807 | ||
|
94894b17a6 | ||
|
f1a0d8c70a | ||
|
0edc4ea337 | ||
|
2fe295ef63 | ||
|
9723d298ed | ||
|
44f201800f | ||
|
375d7316d8 | ||
|
d89c243904 | ||
|
22a780d7c8 | ||
|
0b95237991 | ||
|
351173bb6b | ||
|
1aa2d2aaaa | ||
|
06df0084cf | ||
|
ca73e93aeb | ||
|
c305816f6d | ||
|
8bc31cdbd4 | ||
|
0d9402f496 | ||
|
9867ed08ac | ||
|
ef5f6b67f6 | ||
|
5cd84f633c | ||
|
d7d139c861 | ||
|
5612cfa19d | ||
|
b4d5af8a4c | ||
|
5ac7e8357b | ||
|
156d142ba0 | ||
|
207408a606 | ||
|
5a7f4924ab | ||
|
f53b90cdf6 | ||
|
8980bd0f64 | ||
|
6b0142c6c3 | ||
|
011ea9dc82 | ||
|
c95bed4be5 | ||
|
1a6e18b003 | ||
|
87d75102d4 | ||
|
c110ecdc2b | ||
|
fa8a72bc74 | ||
|
a8dd25a285 | ||
|
486d8d1035 | ||
|
84d09d0e58 | ||
|
cc270848b5 | ||
|
8ac9427ba6 | ||
|
6905c78796 | ||
|
4a4f4fc8e1 | ||
|
02eab6766a | ||
|
6effeef2ee | ||
|
d3d3776a8f | ||
|
d97de1bdd2 | ||
|
e94e2b63ae | ||
|
5c3cc89084 | ||
|
c2d3340ddb | ||
|
cc9ca58a69 | ||
|
21932df918 | ||
|
f29d174a61 | ||
|
8e3909efbc | ||
|
9d3ad47e20 | ||
|
f7fcc74c68 | ||
|
0eebf8b2d0 | ||
|
95f8b08a19 | ||
|
2a7359c1e9 | ||
|
86bfaa8657 | ||
|
8c066eb521 | ||
|
9e08af3306 | ||
|
95f7a1e312 | ||
|
73271018f5 | ||
|
7111109ac0 | ||
|
e3c83823e6 | ||
|
3b11a90aac | ||
|
bc29c67269 | ||
|
4a93551ef9 | ||
|
d0ff4320a8 | ||
|
20b70c2728 | ||
|
6aab2e27cd | ||
|
a34ad80a90 | ||
|
5a22f27b64 | ||
|
776ba77c3a | ||
|
3cf01d9123 | ||
|
2ab9f168d2 | ||
|
038a30dcca | ||
|
ddc40537d5 | ||
|
bd23a05a88 | ||
|
76f1e1c005 | ||
|
40c9816827 | ||
|
a7f742931e | ||
|
a361240692 | ||
|
fe6897baf4 | ||
|
18578521cf | ||
|
4b71c50fb2 | ||
|
7ec7904691 | ||
|
34992438ed | ||
|
af721510e1 | ||
|
393c70f6e6 | ||
|
d28bcbd5e9 | ||
|
03e3737e69 | ||
|
a5fe9ec133 | ||
|
6633ae223c | ||
|
1dd9d6ba7b | ||
|
1a00678e46 | ||
|
77944b4367 | ||
|
9b889ef751 | ||
|
ccecb9005c | ||
|
ccb700376a | ||
|
f574359432 | ||
|
ba690c0615 | ||
|
ccf955f43e | ||
|
856b1ebf8c | ||
|
b1448e13b5 | ||
|
224eb3d0e8 | ||
|
4158628475 | ||
|
e88bd1caf7 | ||
|
27ba2acf86 | ||
|
4efba2b953 | ||
|
f64e9e7c66 | ||
|
6cd8718ac8 | ||
|
eb72c70520 | ||
|
ca06333c48 | ||
|
325ffc4443 | ||
|
89bddbd8fd | ||
|
de62d2776c | ||
|
9aa1622929 | ||
|
9dbb7ab703 | ||
|
8307a9a0df | ||
|
a354ca197e | ||
|
12cb0825ca | ||
|
cc8e241213 | ||
|
14fd9b4af8 | ||
|
9fe39603c3 | ||
|
707371603d | ||
|
632a26d3cb | ||
|
262205b615 | ||
|
131723317b | ||
|
e299023ef1 | ||
|
92e1028354 | ||
|
ebc41c33d0 | ||
|
b11e5a474c | ||
|
54ac15d089 | ||
|
b3c7990c88 | ||
|
88ed309220 | ||
|
5855ec7b38 | ||
|
6f4cc903f8 | ||
|
c01e058ff9 | ||
|
a559fd5ea6 | ||
|
d33081c387 | ||
|
b2e9429cb5 | ||
|
073a0462d9 | ||
|
c8b33a380a | ||
|
78a88a9ce5 | ||
|
1ccc3ebb94 | ||
|
89d51837b7 | ||
|
6ec4e05cb1 | ||
|
87f8272b10 | ||
|
05815ebeae | ||
|
6d4e5d2774 | ||
|
f0cbe5113f | ||
|
4f8584bc75 | ||
|
652dd5033a | ||
|
6e48b86940 | ||
|
18b75233a5 | ||
|
b9e9d0ccd1 | ||
|
c3ebeebcb0 | ||
|
c5c129b706 | ||
|
96541b7ad8 | ||
|
e689e4f7f8 | ||
|
ebe374c9cb | ||
|
350bba1b95 | ||
|
29d5293587 | ||
|
eb75f488c5 | ||
|
c349f120dc | ||
|
6445633c94 | ||
|
ac170f0803 | ||
|
1fe356eee2 | ||
|
b35bfc1ee7 | ||
|
25639702f6 | ||
|
6c5347ef72 | ||
|
3f512c7b54 | ||
|
a943dc1070 | ||
|
2e41b27dc8 | ||
|
38482b8bb5 | ||
|
62041d2581 | ||
|
7548ce58b5 | ||
|
799d108708 | ||
|
4803712ca3 | ||
|
8db97fe0d9 | ||
|
635624006d | ||
|
d3acf3078b | ||
|
85a7bd010b | ||
|
e7d3af1a21 | ||
|
6a8cb99aeb | ||
|
29054d9062 | ||
|
ccd33dd578 | ||
|
39ac9974b6 | ||
|
ba430c0c3c | ||
|
85d9d2cb77 | ||
|
ed2903a139 | ||
|
7239af603d | ||
|
1718b1faa6 | ||
|
d5c8d4743d | ||
|
2af86c7bcc | ||
|
ff408cd988 | ||
|
9289f3662d | ||
|
6aed879d57 | ||
|
aaf8000a31 | ||
|
7f863e543a | ||
|
ac116c91f5 | ||
|
523b8080d1 | ||
|
f28bf02380 | ||
|
d159a577ba | ||
|
59bfaa6cd2 | ||
|
61af44f3f4 | ||
|
8f46531699 | ||
|
98d5b3da72 | ||
|
d899824ebc | ||
|
b4de86b84e | ||
|
c337d5087b | ||
|
07dc25d3bf | ||
|
2585439ddc | ||
|
97f793ffbf | ||
|
8836195f92 | ||
|
38eba2f6c9 | ||
|
9493e7889f | ||
|
ab8a41182a | ||
|
354b107e1c | ||
|
c185563794 | ||
|
e72701c219 | ||
|
3007633873 | ||
|
5512a47d32 | ||
|
6659b664d8 | ||
|
d6a2a1fe27 | ||
|
1670ff181f | ||
|
01b80a0753 | ||
|
1ed89b2a53 | ||
|
4d3acdb2f5 | ||
|
0104989eef | ||
|
7a4c98db01 | ||
|
ccb2fcfcad | ||
|
7d1308b718 | ||
|
8f0ef1900e | ||
|
62d9a47c37 | ||
|
39b7931534 | ||
|
6f9522456f | ||
|
29523cf0da | ||
|
d41f5d449a | ||
|
11b25324b4 | ||
|
cd79275475 | ||
|
0ba959fb69 | ||
|
9c651abbb8 | ||
|
225291fe20 | ||
|
971cc79b76 | ||
|
0b40e06f46 | ||
|
fd7afccbc4 | ||
|
fdfa58dcdd | ||
|
9a2049d8d4 | ||
|
19b8dc7ce7 | ||
|
3c2fc8f34f | ||
|
71c8719f88 | ||
|
2afa9ca80a |
.devcontainer
.drone.yml.github/workflows
analysis.ymlassembleFlavors.ymlcodeql.ymlpr-feedback.ymlrenovate-approve-merge.ymlreuse.ymlscorecard.ymlunit-tests.yml
CHANGELOG.mdapp
build.gradle
schemas/com.nextcloud.talk.data.source.local.TalkDatabase
src/main/java/com/nextcloud/talk
account
AccountVerificationActivity.ktServerSelectionActivity.ktSwitchAccountActivity.ktWebViewLoginActivity.kt
activities
adapters
items
messages
api
application
bottomsheet/items
call/components
chat
components
contacts
conversationcreation
conversationinfo
conversationinfoedit
conversationlist
data
database
dao
mappers
model
source/local
diagnose
fullscreenfile
invitation
location
messagesearch
models
domain
json
openconversations
profile
receivers
repositories/conversations
settings
shareditems/activities
translate/ui
ui
ComposeChatAdapter.kt
dialog
utils
@ -1,4 +1,4 @@
|
||||
FROM ubuntu:noble@sha256:6015f66923d7afbc53558d7ccffd325d43b4e249f41a6e93eef074c9505d2233
|
||||
FROM ubuntu:noble@sha256:440dcf6a5640b2ae5c77724e68787a906afb8ddee98bf86db94eea8528c2c076
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ENV ANDROID_HOME=/usr/lib/android-sdk
|
||||
|
10
.drone.yml
10
.drone.yml
@ -8,7 +8,7 @@ name: generic
|
||||
|
||||
steps:
|
||||
- name: generic
|
||||
image: ghcr.io/nextcloud/continuous-integration-android8:3
|
||||
image: ghcr.io/nextcloud/continuous-integration-android8:4
|
||||
commands:
|
||||
- ./gradlew --console=plain assembleGeneric
|
||||
|
||||
@ -27,7 +27,7 @@ name: gplay
|
||||
|
||||
steps:
|
||||
- name: gplay
|
||||
image: ghcr.io/nextcloud/continuous-integration-android8:3
|
||||
image: ghcr.io/nextcloud/continuous-integration-android8:4
|
||||
commands:
|
||||
- ./gradlew --console=plain assembleGplay
|
||||
|
||||
@ -46,7 +46,7 @@ name: tests
|
||||
|
||||
steps:
|
||||
- name: all
|
||||
image: ghcr.io/nextcloud/continuous-integration-android8:3
|
||||
image: ghcr.io/nextcloud/continuous-integration-android8:4
|
||||
privileged: true
|
||||
commands:
|
||||
- emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
|
||||
@ -81,4 +81,6 @@ trigger:
|
||||
- pull_request
|
||||
---
|
||||
kind: signature
|
||||
hmac: cdce3f7eea46ef85c0223f62f66d1fe53d7dad007ef095c9f70fa063450d8c75
|
||||
hmac: cf0c19e54fa45d1ee226f5f05202a32329b90aaf46711ea073c566a4c4a8a6c5
|
||||
|
||||
...
|
||||
|
2
.github/workflows/analysis.yml
vendored
2
.github/workflows/analysis.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Disabled on forks
|
||||
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
|
||||
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
|
||||
run: |
|
||||
echo 'Can not analyze PRs from forks'
|
||||
exit 1
|
||||
|
2
.github/workflows/assembleFlavors.yml
vendored
2
.github/workflows/assembleFlavors.yml
vendored
@ -34,7 +34,7 @@ jobs:
|
||||
java-version: 17
|
||||
|
||||
- name: Gradle validate
|
||||
uses: gradle/actions/wrapper-validation@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
|
||||
uses: gradle/actions/wrapper-validation@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
|
||||
|
||||
- name: Build ${{ matrix.flavor }}
|
||||
run: |
|
||||
|
4
.github/workflows/codeql.yml
vendored
4
.github/workflows/codeql.yml
vendored
@ -43,7 +43,7 @@ jobs:
|
||||
with:
|
||||
swap-size-gb: 10
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
|
||||
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
- name: Set up JDK 17
|
||||
@ -57,4 +57,4 @@ jobs:
|
||||
echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
|
||||
./gradlew assembleDebug
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
|
||||
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
||||
|
2
.github/workflows/pr-feedback.yml
vendored
2
.github/workflows/pr-feedback.yml
vendored
@ -36,7 +36,7 @@ jobs:
|
||||
blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -)
|
||||
echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: nextcloud/pr-feedback-action@1883b38a033fb16f576875e0cf45f98b857655c4 # main
|
||||
- uses: nextcloud/pr-feedback-action@e397f3c7e655092b746e3610d121545530c6a90e # main
|
||||
with:
|
||||
feedback-message: |
|
||||
Hello there,
|
||||
|
19
.github/workflows/renovate-approve-merge.yml
vendored
19
.github/workflows/renovate-approve-merge.yml
vendored
@ -29,8 +29,6 @@ jobs:
|
||||
permissions:
|
||||
# for hmarr/auto-approve-action to approve PRs
|
||||
pull-requests: write
|
||||
# for alexwilson/enable-github-automerge-action to approve PRs
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Disabled on forks
|
||||
@ -46,13 +44,18 @@ jobs:
|
||||
|
||||
# GitHub actions bot approve
|
||||
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
|
||||
if: startsWith(steps.branchname.outputs.branch, 'renovate/')
|
||||
if: github.actor == 'renovate[bot]'
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Enable GitHub auto merge
|
||||
- name: Auto merge
|
||||
uses: alexwilson/enable-github-automerge-action@56e3117d1ae1540309dc8f7a9f2825bc3c5f06ff # v2.0.0
|
||||
if: startsWith(steps.branchname.outputs.branch, 'renovate/')
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
ref: ${{ github.head_ref }}
|
||||
|
||||
# Enable GitHub auto merge
|
||||
- name: Enable Pull Request Automerge
|
||||
if: github.actor == 'renovate[bot]'
|
||||
run: gh pr merge --merge --auto
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.AUTOMERGE }}
|
||||
|
||||
|
4
.github/workflows/reuse.yml
vendored
4
.github/workflows/reuse.yml
vendored
@ -12,11 +12,11 @@ name: REUSE Compliance Check
|
||||
on: [pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
reuse-compliance-check:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-latest-low
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
4
.github/workflows/scorecard.yml
vendored
4
.github/workflows/scorecard.yml
vendored
@ -34,7 +34,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
|
||||
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
@ -42,6 +42,6 @@ jobs:
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
|
||||
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
2
.github/workflows/unit-tests.yml
vendored
2
.github/workflows/unit-tests.yml
vendored
@ -33,7 +33,7 @@ jobs:
|
||||
java-version: 17
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
|
||||
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
|
||||
|
||||
- name: Run unit tests with coverage
|
||||
run: ./gradlew testGplayDebugUnit
|
||||
|
30
CHANGELOG.md
30
CHANGELOG.md
@ -9,6 +9,36 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
Types of changes can be: Added/Changed/Deprecated/Removed/Fixed/Security
|
||||
|
||||
## [21.1.0] - 2025-06-05
|
||||
|
||||
### Added
|
||||
- Allow adding participants to one-to-one chats creating a new conversation
|
||||
- Handling of event conversations
|
||||
- Show info about participant (organization, role, timezone, ...) in 1:1 conversation info screen
|
||||
- Added gallery option in chat attachment menu (access photos and videos with one click without giving permissions)
|
||||
- Add self-test button for push notifications in diagnosis screen
|
||||
- Edit checkbox in chat messages
|
||||
- Team mentions in chat
|
||||
- Add option to mark a conversation as sensitive
|
||||
- Allow bluetooth headset to be discovered and used during a call (@gavine99)
|
||||
|
||||
### Changed
|
||||
- Design of participants grid in call
|
||||
- Improve subline in conversations screen when last message is attachment
|
||||
- Improve message search
|
||||
- In search window, show messages at last
|
||||
- Switch video capture for calls between 4:3 and 16:9 ratio depending on portrait/ landscape mode
|
||||
|
||||
### Fixed
|
||||
- Crashes
|
||||
- Videos in videocall lost after app comes back to foreground
|
||||
- Open conversations not being shown in search
|
||||
- Minor bugs (@MmAaXx500)
|
||||
|
||||
Minimum: NC 17 Server, Android 8.0 Oreo
|
||||
|
||||
For a full list, please see https://github.com/nextcloud/talk-android/milestone/94?closed=1
|
||||
|
||||
## [21.0.1] - 2025-04-15
|
||||
|
||||
### Fixed
|
||||
|
@ -13,9 +13,9 @@ import com.github.spotbugs.snom.Effort
|
||||
import com.github.spotbugs.snom.SpotBugsTask
|
||||
|
||||
plugins {
|
||||
id "org.jetbrains.kotlin.plugin.compose" version "2.1.21"
|
||||
id "org.jetbrains.kotlin.plugin.compose" version "2.2.0"
|
||||
id "org.jetbrains.kotlin.kapt"
|
||||
id 'com.google.devtools.ksp' version '2.1.21-2.0.1'
|
||||
id 'com.google.devtools.ksp' version '2.2.0-2.0.2'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
@ -28,19 +28,19 @@ apply plugin: "org.jlleitschuh.gradle.ktlint"
|
||||
apply plugin: 'kotlinx-serialization'
|
||||
|
||||
android {
|
||||
compileSdk 34
|
||||
compileSdk 35
|
||||
|
||||
namespace 'com.nextcloud.talk'
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 26
|
||||
targetSdkVersion 34
|
||||
targetSdkVersion 35
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
// mayor.minor.hotfix.increment (for increment: 01-50=Alpha / 51-89=RC / 90-99=stable)
|
||||
// xx .xxx .xx .xx
|
||||
versionCode 220000002
|
||||
versionName "22.0.0 Alpha 02"
|
||||
versionCode 220000009
|
||||
versionName "22.0.0 Alpha 09"
|
||||
|
||||
flavorDimensions "default"
|
||||
renderscriptTargetApi 19
|
||||
@ -155,18 +155,18 @@ ext {
|
||||
daggerVersion = "2.56.2"
|
||||
emojiVersion = "1.5.0"
|
||||
fidoVersion = "4.1.0-patch2"
|
||||
lifecycleVersion = '2.8.7'
|
||||
lifecycleVersion = '2.9.1'
|
||||
okhttpVersion = "4.12.0"
|
||||
markwonVersion = "4.6.2"
|
||||
materialDialogsVersion = "3.3.0"
|
||||
parcelerVersion = "1.1.13"
|
||||
prismVersion = "2.0.0"
|
||||
retrofit2Version = "2.11.0"
|
||||
roomVersion = "2.7.1"
|
||||
workVersion = "2.9.1"
|
||||
retrofit2Version = "3.0.0"
|
||||
roomVersion = "2.7.2"
|
||||
workVersion = "2.10.2"
|
||||
espressoVersion = "3.6.1"
|
||||
androidxTestVersion = "1.5.0"
|
||||
media3_version = "1.4.1"
|
||||
media3_version = "1.7.1"
|
||||
coroutines_version = "1.10.2"
|
||||
mockitoKotlinVersion = "5.4.0"
|
||||
}
|
||||
@ -180,20 +180,20 @@ configurations.configureEach {
|
||||
|
||||
dependencies {
|
||||
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.14.0'
|
||||
spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.6.9'
|
||||
spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.6.11'
|
||||
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.8")
|
||||
|
||||
implementation("androidx.compose.runtime:runtime:1.7.8")
|
||||
implementation("androidx.compose.runtime:runtime:1.8.3")
|
||||
implementation 'androidx.preference:preference-ktx:1.2.1'
|
||||
implementation 'androidx.datastore:datastore-core:1.1.6'
|
||||
implementation 'androidx.datastore:datastore-preferences:1.1.6'
|
||||
implementation 'androidx.datastore:datastore-core:1.1.7'
|
||||
implementation 'androidx.datastore:datastore-preferences:1.1.7'
|
||||
implementation 'androidx.test.ext:junit-ktx:1.2.1'
|
||||
|
||||
implementation fileTree(include: ['*'], dir: 'libs')
|
||||
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.1"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0"
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.7.1'
|
||||
implementation 'com.google.android.material:material:1.12.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
|
||||
implementation "com.vanniktech:emoji-google:0.21.0"
|
||||
@ -236,7 +236,7 @@ dependencies {
|
||||
implementation "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"
|
||||
|
||||
implementation 'com.bluelinelabs:logansquare:1.3.7'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-core:2.14.3'
|
||||
implementation 'com.fasterxml.jackson.core:jackson-core:2.19.1'
|
||||
kapt 'com.bluelinelabs:logansquare-compiler:1.3.7'
|
||||
|
||||
implementation "com.squareup.retrofit2:retrofit:${retrofit2Version}"
|
||||
@ -291,6 +291,7 @@ dependencies {
|
||||
implementation "io.noties.markwon:core:$markwonVersion"
|
||||
implementation "io.noties.markwon:ext-strikethrough:$markwonVersion"
|
||||
implementation "io.noties.markwon:ext-tasklist:$markwonVersion"
|
||||
implementation "io.noties.markwon:ext-tables:$markwonVersion"
|
||||
|
||||
implementation 'com.github.nextcloud-deps:ImagePicker:2.1.0.2'
|
||||
implementation 'io.github.elye:loaderviewlibrary:3.0.0'
|
||||
@ -300,35 +301,35 @@ dependencies {
|
||||
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
|
||||
})
|
||||
|
||||
implementation 'androidx.core:core-ktx:1.13.1'
|
||||
implementation 'androidx.activity:activity-ktx:1.9.3'
|
||||
implementation 'com.github.nextcloud.android-common:ui:0.23.2'
|
||||
implementation 'androidx.core:core-ktx:1.16.0'
|
||||
implementation 'androidx.activity:activity-ktx:1.10.1'
|
||||
implementation 'com.github.nextcloud.android-common:ui:0.26.0'
|
||||
implementation 'com.github.nextcloud-deps:android-talk-webrtc:132.6834.0'
|
||||
|
||||
gplayImplementation 'com.google.android.gms:play-services-base:18.6.0'
|
||||
gplayImplementation "com.google.firebase:firebase-messaging:24.1.1"
|
||||
gplayImplementation "com.google.firebase:firebase-messaging:24.1.2"
|
||||
|
||||
//compose
|
||||
implementation(platform("androidx.compose:compose-bom:2025.04.00"))
|
||||
implementation(platform("androidx.compose:compose-bom:2025.06.01"))
|
||||
implementation("androidx.compose.ui:ui")
|
||||
implementation 'androidx.compose.material3:material3:1.3.2'
|
||||
implementation("androidx.compose.ui:ui-tooling-preview")
|
||||
implementation 'androidx.activity:activity-compose:1.9.3'
|
||||
implementation 'androidx.activity:activity-compose:1.10.1'
|
||||
debugImplementation("androidx.compose.ui:ui-tooling")
|
||||
|
||||
//tests
|
||||
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.7.8")
|
||||
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.8.3")
|
||||
debugImplementation("androidx.compose.ui:ui-test-manifest")
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
testImplementation 'org.mockito:mockito-core:5.17.0'
|
||||
testImplementation 'org.mockito:mockito-core:5.18.0'
|
||||
testImplementation 'androidx.arch.core:core-testing:2.2.0'
|
||||
|
||||
androidTestImplementation "androidx.test:core:1.6.1"
|
||||
|
||||
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2"
|
||||
androidTestImplementation 'androidx.test:core-ktx:1.6.1'
|
||||
androidTestImplementation 'org.mockito:mockito-android:5.17.0'
|
||||
androidTestImplementation 'org.mockito:mockito-android:5.18.0'
|
||||
androidTestImplementation "androidx.work:work-testing:${workVersion}"
|
||||
// Espresso core
|
||||
androidTestImplementation ("androidx.test.espresso:espresso-core:$espressoVersion", {
|
||||
@ -342,11 +343,11 @@ dependencies {
|
||||
|
||||
androidTestImplementation('com.android.support.test.espresso:espresso-intents:3.0.2')
|
||||
|
||||
androidTestImplementation(platform("androidx.compose:compose-bom:2025.04.00"))
|
||||
androidTestImplementation(platform("androidx.compose:compose-bom:2025.06.01"))
|
||||
testImplementation "org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion"
|
||||
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
|
||||
|
||||
testImplementation 'org.junit.vintage:junit-vintage-engine:5.12.2'
|
||||
testImplementation 'org.junit.vintage:junit-vintage-engine:5.13.3'
|
||||
}
|
||||
|
||||
tasks.register('installGitHooks', Copy) {
|
||||
|
@ -0,0 +1,725 @@
|
||||
{
|
||||
"formatVersion": 1,
|
||||
"database": {
|
||||
"version": 15,
|
||||
"identityHash": "acac3fd21e35762b90f65f213be38ccd",
|
||||
"entities": [
|
||||
{
|
||||
"tableName": "User",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `userId` TEXT, `username` TEXT, `baseUrl` TEXT, `token` TEXT, `displayName` TEXT, `pushConfigurationState` TEXT, `capabilities` TEXT, `serverVersion` TEXT DEFAULT '', `clientCertificate` TEXT, `externalSignalingServer` TEXT, `current` INTEGER NOT NULL, `scheduledForDeletion` INTEGER NOT NULL)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "userId",
|
||||
"columnName": "userId",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "username",
|
||||
"columnName": "username",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "baseUrl",
|
||||
"columnName": "baseUrl",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "token",
|
||||
"columnName": "token",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "displayName",
|
||||
"columnName": "displayName",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "pushConfigurationState",
|
||||
"columnName": "pushConfigurationState",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "capabilities",
|
||||
"columnName": "capabilities",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "serverVersion",
|
||||
"columnName": "serverVersion",
|
||||
"affinity": "TEXT",
|
||||
"defaultValue": "''"
|
||||
},
|
||||
{
|
||||
"fieldPath": "clientCertificate",
|
||||
"columnName": "clientCertificate",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "externalSignalingServer",
|
||||
"columnName": "externalSignalingServer",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "current",
|
||||
"columnName": "current",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "scheduledForDeletion",
|
||||
"columnName": "scheduledForDeletion",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"tableName": "ArbitraryStorage",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountIdentifier` INTEGER NOT NULL, `key` TEXT NOT NULL, `object` TEXT, `value` TEXT, PRIMARY KEY(`accountIdentifier`, `key`))",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "accountIdentifier",
|
||||
"columnName": "accountIdentifier",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "key",
|
||||
"columnName": "key",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "storageObject",
|
||||
"columnName": "object",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "value",
|
||||
"columnName": "value",
|
||||
"affinity": "TEXT"
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": false,
|
||||
"columnNames": [
|
||||
"accountIdentifier",
|
||||
"key"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"tableName": "Conversations",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`internalId` TEXT NOT NULL, `accountId` INTEGER NOT NULL, `token` TEXT NOT NULL, `displayName` TEXT NOT NULL, `actorId` TEXT NOT NULL, `actorType` TEXT NOT NULL, `avatarVersion` TEXT NOT NULL, `callFlag` INTEGER NOT NULL, `callRecording` INTEGER NOT NULL, `callStartTime` INTEGER NOT NULL, `canDeleteConversation` INTEGER NOT NULL, `canLeaveConversation` INTEGER NOT NULL, `canStartCall` INTEGER NOT NULL, `description` TEXT NOT NULL, `hasCall` INTEGER NOT NULL, `hasPassword` INTEGER NOT NULL, `isCustomAvatar` INTEGER NOT NULL, `isFavorite` INTEGER NOT NULL, `lastActivity` INTEGER NOT NULL, `lastCommonReadMessage` INTEGER NOT NULL, `lastMessage` TEXT, `lastPing` INTEGER NOT NULL, `lastReadMessage` INTEGER NOT NULL, `lobbyState` TEXT NOT NULL, `lobbyTimer` INTEGER NOT NULL, `messageExpiration` INTEGER NOT NULL, `name` TEXT NOT NULL, `notificationCalls` INTEGER NOT NULL, `notificationLevel` TEXT NOT NULL, `objectType` TEXT NOT NULL, `objectId` TEXT NOT NULL, `participantType` TEXT NOT NULL, `permissions` INTEGER NOT NULL, `readOnly` TEXT NOT NULL, `recordingConsent` INTEGER NOT NULL, `remoteServer` TEXT, `remoteToken` TEXT, `sessionId` TEXT NOT NULL, `status` TEXT, `statusClearAt` INTEGER, `statusIcon` TEXT, `statusMessage` TEXT, `type` TEXT NOT NULL, `unreadMention` INTEGER NOT NULL, `unreadMentionDirect` INTEGER NOT NULL, `unreadMessages` INTEGER NOT NULL, `hasArchived` INTEGER NOT NULL, `hasSensitive` INTEGER NOT NULL, PRIMARY KEY(`internalId`), FOREIGN KEY(`accountId`) REFERENCES `User`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "internalId",
|
||||
"columnName": "internalId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "accountId",
|
||||
"columnName": "accountId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "token",
|
||||
"columnName": "token",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "displayName",
|
||||
"columnName": "displayName",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorId",
|
||||
"columnName": "actorId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorType",
|
||||
"columnName": "actorType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "avatarVersion",
|
||||
"columnName": "avatarVersion",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "callFlag",
|
||||
"columnName": "callFlag",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "callRecording",
|
||||
"columnName": "callRecording",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "callStartTime",
|
||||
"columnName": "callStartTime",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "canDeleteConversation",
|
||||
"columnName": "canDeleteConversation",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "canLeaveConversation",
|
||||
"columnName": "canLeaveConversation",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "canStartCall",
|
||||
"columnName": "canStartCall",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "description",
|
||||
"columnName": "description",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasCall",
|
||||
"columnName": "hasCall",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasPassword",
|
||||
"columnName": "hasPassword",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasCustomAvatar",
|
||||
"columnName": "isCustomAvatar",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "favorite",
|
||||
"columnName": "isFavorite",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastActivity",
|
||||
"columnName": "lastActivity",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastCommonReadMessage",
|
||||
"columnName": "lastCommonReadMessage",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastMessage",
|
||||
"columnName": "lastMessage",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastPing",
|
||||
"columnName": "lastPing",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastReadMessage",
|
||||
"columnName": "lastReadMessage",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lobbyState",
|
||||
"columnName": "lobbyState",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lobbyTimer",
|
||||
"columnName": "lobbyTimer",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "messageExpiration",
|
||||
"columnName": "messageExpiration",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "name",
|
||||
"columnName": "name",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "notificationCalls",
|
||||
"columnName": "notificationCalls",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "notificationLevel",
|
||||
"columnName": "notificationLevel",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "objectType",
|
||||
"columnName": "objectType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "objectId",
|
||||
"columnName": "objectId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "participantType",
|
||||
"columnName": "participantType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "permissions",
|
||||
"columnName": "permissions",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "conversationReadOnlyState",
|
||||
"columnName": "readOnly",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "recordingConsentRequired",
|
||||
"columnName": "recordingConsent",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "remoteServer",
|
||||
"columnName": "remoteServer",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "remoteToken",
|
||||
"columnName": "remoteToken",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "sessionId",
|
||||
"columnName": "sessionId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "status",
|
||||
"columnName": "status",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "statusClearAt",
|
||||
"columnName": "statusClearAt",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "statusIcon",
|
||||
"columnName": "statusIcon",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "statusMessage",
|
||||
"columnName": "statusMessage",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "type",
|
||||
"columnName": "type",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "unreadMention",
|
||||
"columnName": "unreadMention",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "unreadMentionDirect",
|
||||
"columnName": "unreadMentionDirect",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "unreadMessages",
|
||||
"columnName": "unreadMessages",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasArchived",
|
||||
"columnName": "hasArchived",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasSensitive",
|
||||
"columnName": "hasSensitive",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": false,
|
||||
"columnNames": [
|
||||
"internalId"
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_Conversations_accountId",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"accountId"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_Conversations_accountId` ON `${TABLE_NAME}` (`accountId`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": [
|
||||
{
|
||||
"table": "User",
|
||||
"onDelete": "CASCADE",
|
||||
"onUpdate": "CASCADE",
|
||||
"columns": [
|
||||
"accountId"
|
||||
],
|
||||
"referencedColumns": [
|
||||
"id"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tableName": "ChatMessages",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`internalId` TEXT NOT NULL, `accountId` INTEGER NOT NULL, `token` TEXT NOT NULL, `id` INTEGER NOT NULL, `internalConversationId` TEXT NOT NULL, `actorDisplayName` TEXT NOT NULL, `message` TEXT NOT NULL, `actorId` TEXT NOT NULL, `actorType` TEXT NOT NULL, `deleted` INTEGER NOT NULL, `expirationTimestamp` INTEGER NOT NULL, `isReplyable` INTEGER NOT NULL, `isTemporary` INTEGER NOT NULL, `lastEditActorDisplayName` TEXT, `lastEditActorId` TEXT, `lastEditActorType` TEXT, `lastEditTimestamp` INTEGER, `markdown` INTEGER, `messageParameters` TEXT, `messageType` TEXT NOT NULL, `parent` INTEGER, `reactions` TEXT, `reactionsSelf` TEXT, `referenceId` TEXT, `sendingFailed` INTEGER NOT NULL, `silent` INTEGER NOT NULL, `systemMessage` TEXT NOT NULL, `timestamp` INTEGER NOT NULL, PRIMARY KEY(`internalId`), FOREIGN KEY(`internalConversationId`) REFERENCES `Conversations`(`internalId`) ON UPDATE CASCADE ON DELETE CASCADE )",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "internalId",
|
||||
"columnName": "internalId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "accountId",
|
||||
"columnName": "accountId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "token",
|
||||
"columnName": "token",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "internalConversationId",
|
||||
"columnName": "internalConversationId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorDisplayName",
|
||||
"columnName": "actorDisplayName",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "message",
|
||||
"columnName": "message",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorId",
|
||||
"columnName": "actorId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorType",
|
||||
"columnName": "actorType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "deleted",
|
||||
"columnName": "deleted",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "expirationTimestamp",
|
||||
"columnName": "expirationTimestamp",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "replyable",
|
||||
"columnName": "isReplyable",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "isTemporary",
|
||||
"columnName": "isTemporary",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastEditActorDisplayName",
|
||||
"columnName": "lastEditActorDisplayName",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastEditActorId",
|
||||
"columnName": "lastEditActorId",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastEditActorType",
|
||||
"columnName": "lastEditActorType",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastEditTimestamp",
|
||||
"columnName": "lastEditTimestamp",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "renderMarkdown",
|
||||
"columnName": "markdown",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "messageParameters",
|
||||
"columnName": "messageParameters",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "messageType",
|
||||
"columnName": "messageType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "parentMessageId",
|
||||
"columnName": "parent",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "reactions",
|
||||
"columnName": "reactions",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "reactionsSelf",
|
||||
"columnName": "reactionsSelf",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "referenceId",
|
||||
"columnName": "referenceId",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "sendingFailed",
|
||||
"columnName": "sendingFailed",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "silent",
|
||||
"columnName": "silent",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "systemMessageType",
|
||||
"columnName": "systemMessage",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "timestamp",
|
||||
"columnName": "timestamp",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": false,
|
||||
"columnNames": [
|
||||
"internalId"
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_ChatMessages_internalId",
|
||||
"unique": true,
|
||||
"columnNames": [
|
||||
"internalId"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_ChatMessages_internalId` ON `${TABLE_NAME}` (`internalId`)"
|
||||
},
|
||||
{
|
||||
"name": "index_ChatMessages_internalConversationId",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"internalConversationId"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_ChatMessages_internalConversationId` ON `${TABLE_NAME}` (`internalConversationId`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": [
|
||||
{
|
||||
"table": "Conversations",
|
||||
"onDelete": "CASCADE",
|
||||
"onUpdate": "CASCADE",
|
||||
"columns": [
|
||||
"internalConversationId"
|
||||
],
|
||||
"referencedColumns": [
|
||||
"internalId"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tableName": "ChatBlocks",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `internalConversationId` TEXT NOT NULL, `accountId` INTEGER, `token` TEXT, `oldestMessageId` INTEGER NOT NULL, `newestMessageId` INTEGER NOT NULL, `hasHistory` INTEGER NOT NULL, FOREIGN KEY(`internalConversationId`) REFERENCES `Conversations`(`internalId`) ON UPDATE CASCADE ON DELETE CASCADE )",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "internalConversationId",
|
||||
"columnName": "internalConversationId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "accountId",
|
||||
"columnName": "accountId",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "token",
|
||||
"columnName": "token",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "oldestMessageId",
|
||||
"columnName": "oldestMessageId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "newestMessageId",
|
||||
"columnName": "newestMessageId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasHistory",
|
||||
"columnName": "hasHistory",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_ChatBlocks_internalConversationId",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"internalConversationId"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_ChatBlocks_internalConversationId` ON `${TABLE_NAME}` (`internalConversationId`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": [
|
||||
{
|
||||
"table": "Conversations",
|
||||
"onDelete": "CASCADE",
|
||||
"onUpdate": "CASCADE",
|
||||
"columns": [
|
||||
"internalConversationId"
|
||||
],
|
||||
"referencedColumns": [
|
||||
"internalId"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"setupQueries": [
|
||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'acac3fd21e35762b90f65f213be38ccd')"
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,731 @@
|
||||
{
|
||||
"formatVersion": 1,
|
||||
"database": {
|
||||
"version": 16,
|
||||
"identityHash": "bbf526d5c78a99eb951635cc46f4c59f",
|
||||
"entities": [
|
||||
{
|
||||
"tableName": "User",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `userId` TEXT, `username` TEXT, `baseUrl` TEXT, `token` TEXT, `displayName` TEXT, `pushConfigurationState` TEXT, `capabilities` TEXT, `serverVersion` TEXT DEFAULT '', `clientCertificate` TEXT, `externalSignalingServer` TEXT, `current` INTEGER NOT NULL, `scheduledForDeletion` INTEGER NOT NULL)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "userId",
|
||||
"columnName": "userId",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "username",
|
||||
"columnName": "username",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "baseUrl",
|
||||
"columnName": "baseUrl",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "token",
|
||||
"columnName": "token",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "displayName",
|
||||
"columnName": "displayName",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "pushConfigurationState",
|
||||
"columnName": "pushConfigurationState",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "capabilities",
|
||||
"columnName": "capabilities",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "serverVersion",
|
||||
"columnName": "serverVersion",
|
||||
"affinity": "TEXT",
|
||||
"defaultValue": "''"
|
||||
},
|
||||
{
|
||||
"fieldPath": "clientCertificate",
|
||||
"columnName": "clientCertificate",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "externalSignalingServer",
|
||||
"columnName": "externalSignalingServer",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "current",
|
||||
"columnName": "current",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "scheduledForDeletion",
|
||||
"columnName": "scheduledForDeletion",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"tableName": "ArbitraryStorage",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountIdentifier` INTEGER NOT NULL, `key` TEXT NOT NULL, `object` TEXT, `value` TEXT, PRIMARY KEY(`accountIdentifier`, `key`))",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "accountIdentifier",
|
||||
"columnName": "accountIdentifier",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "key",
|
||||
"columnName": "key",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "storageObject",
|
||||
"columnName": "object",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "value",
|
||||
"columnName": "value",
|
||||
"affinity": "TEXT"
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": false,
|
||||
"columnNames": [
|
||||
"accountIdentifier",
|
||||
"key"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"tableName": "Conversations",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`internalId` TEXT NOT NULL, `accountId` INTEGER NOT NULL, `token` TEXT NOT NULL, `displayName` TEXT NOT NULL, `actorId` TEXT NOT NULL, `actorType` TEXT NOT NULL, `avatarVersion` TEXT NOT NULL, `callFlag` INTEGER NOT NULL, `callRecording` INTEGER NOT NULL, `callStartTime` INTEGER NOT NULL, `canDeleteConversation` INTEGER NOT NULL, `canLeaveConversation` INTEGER NOT NULL, `canStartCall` INTEGER NOT NULL, `description` TEXT NOT NULL, `hasCall` INTEGER NOT NULL, `hasPassword` INTEGER NOT NULL, `isCustomAvatar` INTEGER NOT NULL, `isFavorite` INTEGER NOT NULL, `lastActivity` INTEGER NOT NULL, `lastCommonReadMessage` INTEGER NOT NULL, `lastMessage` TEXT, `lastPing` INTEGER NOT NULL, `lastReadMessage` INTEGER NOT NULL, `lobbyState` TEXT NOT NULL, `lobbyTimer` INTEGER NOT NULL, `messageExpiration` INTEGER NOT NULL, `name` TEXT NOT NULL, `notificationCalls` INTEGER NOT NULL, `notificationLevel` TEXT NOT NULL, `objectType` TEXT NOT NULL, `objectId` TEXT NOT NULL, `participantType` TEXT NOT NULL, `permissions` INTEGER NOT NULL, `readOnly` TEXT NOT NULL, `recordingConsent` INTEGER NOT NULL, `remoteServer` TEXT, `remoteToken` TEXT, `sessionId` TEXT NOT NULL, `status` TEXT, `statusClearAt` INTEGER, `statusIcon` TEXT, `statusMessage` TEXT, `type` TEXT NOT NULL, `unreadMention` INTEGER NOT NULL, `unreadMentionDirect` INTEGER NOT NULL, `unreadMessages` INTEGER NOT NULL, `hasArchived` INTEGER NOT NULL, `hasSensitive` INTEGER NOT NULL, `hasImportant` INTEGER NOT NULL, PRIMARY KEY(`internalId`), FOREIGN KEY(`accountId`) REFERENCES `User`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "internalId",
|
||||
"columnName": "internalId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "accountId",
|
||||
"columnName": "accountId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "token",
|
||||
"columnName": "token",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "displayName",
|
||||
"columnName": "displayName",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorId",
|
||||
"columnName": "actorId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorType",
|
||||
"columnName": "actorType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "avatarVersion",
|
||||
"columnName": "avatarVersion",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "callFlag",
|
||||
"columnName": "callFlag",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "callRecording",
|
||||
"columnName": "callRecording",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "callStartTime",
|
||||
"columnName": "callStartTime",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "canDeleteConversation",
|
||||
"columnName": "canDeleteConversation",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "canLeaveConversation",
|
||||
"columnName": "canLeaveConversation",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "canStartCall",
|
||||
"columnName": "canStartCall",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "description",
|
||||
"columnName": "description",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasCall",
|
||||
"columnName": "hasCall",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasPassword",
|
||||
"columnName": "hasPassword",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasCustomAvatar",
|
||||
"columnName": "isCustomAvatar",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "favorite",
|
||||
"columnName": "isFavorite",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastActivity",
|
||||
"columnName": "lastActivity",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastCommonReadMessage",
|
||||
"columnName": "lastCommonReadMessage",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastMessage",
|
||||
"columnName": "lastMessage",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastPing",
|
||||
"columnName": "lastPing",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastReadMessage",
|
||||
"columnName": "lastReadMessage",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lobbyState",
|
||||
"columnName": "lobbyState",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lobbyTimer",
|
||||
"columnName": "lobbyTimer",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "messageExpiration",
|
||||
"columnName": "messageExpiration",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "name",
|
||||
"columnName": "name",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "notificationCalls",
|
||||
"columnName": "notificationCalls",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "notificationLevel",
|
||||
"columnName": "notificationLevel",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "objectType",
|
||||
"columnName": "objectType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "objectId",
|
||||
"columnName": "objectId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "participantType",
|
||||
"columnName": "participantType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "permissions",
|
||||
"columnName": "permissions",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "conversationReadOnlyState",
|
||||
"columnName": "readOnly",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "recordingConsentRequired",
|
||||
"columnName": "recordingConsent",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "remoteServer",
|
||||
"columnName": "remoteServer",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "remoteToken",
|
||||
"columnName": "remoteToken",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "sessionId",
|
||||
"columnName": "sessionId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "status",
|
||||
"columnName": "status",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "statusClearAt",
|
||||
"columnName": "statusClearAt",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "statusIcon",
|
||||
"columnName": "statusIcon",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "statusMessage",
|
||||
"columnName": "statusMessage",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "type",
|
||||
"columnName": "type",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "unreadMention",
|
||||
"columnName": "unreadMention",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "unreadMentionDirect",
|
||||
"columnName": "unreadMentionDirect",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "unreadMessages",
|
||||
"columnName": "unreadMessages",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasArchived",
|
||||
"columnName": "hasArchived",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasSensitive",
|
||||
"columnName": "hasSensitive",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasImportant",
|
||||
"columnName": "hasImportant",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": false,
|
||||
"columnNames": [
|
||||
"internalId"
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_Conversations_accountId",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"accountId"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_Conversations_accountId` ON `${TABLE_NAME}` (`accountId`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": [
|
||||
{
|
||||
"table": "User",
|
||||
"onDelete": "CASCADE",
|
||||
"onUpdate": "CASCADE",
|
||||
"columns": [
|
||||
"accountId"
|
||||
],
|
||||
"referencedColumns": [
|
||||
"id"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tableName": "ChatMessages",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`internalId` TEXT NOT NULL, `accountId` INTEGER NOT NULL, `token` TEXT NOT NULL, `id` INTEGER NOT NULL, `internalConversationId` TEXT NOT NULL, `actorDisplayName` TEXT NOT NULL, `message` TEXT NOT NULL, `actorId` TEXT NOT NULL, `actorType` TEXT NOT NULL, `deleted` INTEGER NOT NULL, `expirationTimestamp` INTEGER NOT NULL, `isReplyable` INTEGER NOT NULL, `isTemporary` INTEGER NOT NULL, `lastEditActorDisplayName` TEXT, `lastEditActorId` TEXT, `lastEditActorType` TEXT, `lastEditTimestamp` INTEGER, `markdown` INTEGER, `messageParameters` TEXT, `messageType` TEXT NOT NULL, `parent` INTEGER, `reactions` TEXT, `reactionsSelf` TEXT, `referenceId` TEXT, `sendingFailed` INTEGER NOT NULL, `silent` INTEGER NOT NULL, `systemMessage` TEXT NOT NULL, `timestamp` INTEGER NOT NULL, PRIMARY KEY(`internalId`), FOREIGN KEY(`internalConversationId`) REFERENCES `Conversations`(`internalId`) ON UPDATE CASCADE ON DELETE CASCADE )",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "internalId",
|
||||
"columnName": "internalId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "accountId",
|
||||
"columnName": "accountId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "token",
|
||||
"columnName": "token",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "internalConversationId",
|
||||
"columnName": "internalConversationId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorDisplayName",
|
||||
"columnName": "actorDisplayName",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "message",
|
||||
"columnName": "message",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorId",
|
||||
"columnName": "actorId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorType",
|
||||
"columnName": "actorType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "deleted",
|
||||
"columnName": "deleted",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "expirationTimestamp",
|
||||
"columnName": "expirationTimestamp",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "replyable",
|
||||
"columnName": "isReplyable",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "isTemporary",
|
||||
"columnName": "isTemporary",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastEditActorDisplayName",
|
||||
"columnName": "lastEditActorDisplayName",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastEditActorId",
|
||||
"columnName": "lastEditActorId",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastEditActorType",
|
||||
"columnName": "lastEditActorType",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastEditTimestamp",
|
||||
"columnName": "lastEditTimestamp",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "renderMarkdown",
|
||||
"columnName": "markdown",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "messageParameters",
|
||||
"columnName": "messageParameters",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "messageType",
|
||||
"columnName": "messageType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "parentMessageId",
|
||||
"columnName": "parent",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "reactions",
|
||||
"columnName": "reactions",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "reactionsSelf",
|
||||
"columnName": "reactionsSelf",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "referenceId",
|
||||
"columnName": "referenceId",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "sendingFailed",
|
||||
"columnName": "sendingFailed",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "silent",
|
||||
"columnName": "silent",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "systemMessageType",
|
||||
"columnName": "systemMessage",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "timestamp",
|
||||
"columnName": "timestamp",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": false,
|
||||
"columnNames": [
|
||||
"internalId"
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_ChatMessages_internalId",
|
||||
"unique": true,
|
||||
"columnNames": [
|
||||
"internalId"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_ChatMessages_internalId` ON `${TABLE_NAME}` (`internalId`)"
|
||||
},
|
||||
{
|
||||
"name": "index_ChatMessages_internalConversationId",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"internalConversationId"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_ChatMessages_internalConversationId` ON `${TABLE_NAME}` (`internalConversationId`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": [
|
||||
{
|
||||
"table": "Conversations",
|
||||
"onDelete": "CASCADE",
|
||||
"onUpdate": "CASCADE",
|
||||
"columns": [
|
||||
"internalConversationId"
|
||||
],
|
||||
"referencedColumns": [
|
||||
"internalId"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tableName": "ChatBlocks",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `internalConversationId` TEXT NOT NULL, `accountId` INTEGER, `token` TEXT, `oldestMessageId` INTEGER NOT NULL, `newestMessageId` INTEGER NOT NULL, `hasHistory` INTEGER NOT NULL, FOREIGN KEY(`internalConversationId`) REFERENCES `Conversations`(`internalId`) ON UPDATE CASCADE ON DELETE CASCADE )",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "internalConversationId",
|
||||
"columnName": "internalConversationId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "accountId",
|
||||
"columnName": "accountId",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "token",
|
||||
"columnName": "token",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "oldestMessageId",
|
||||
"columnName": "oldestMessageId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "newestMessageId",
|
||||
"columnName": "newestMessageId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasHistory",
|
||||
"columnName": "hasHistory",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_ChatBlocks_internalConversationId",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"internalConversationId"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_ChatBlocks_internalConversationId` ON `${TABLE_NAME}` (`internalConversationId`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": [
|
||||
{
|
||||
"table": "Conversations",
|
||||
"onDelete": "CASCADE",
|
||||
"onUpdate": "CASCADE",
|
||||
"columns": [
|
||||
"internalConversationId"
|
||||
],
|
||||
"referencedColumns": [
|
||||
"internalId"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"setupQueries": [
|
||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'bbf526d5c78a99eb951635cc46f4c59f')"
|
||||
]
|
||||
}
|
||||
}
|
@ -0,0 +1,730 @@
|
||||
{
|
||||
"formatVersion": 1,
|
||||
"database": {
|
||||
"version": 17,
|
||||
"identityHash": "5bc4247e179307faa995552da5d34324",
|
||||
"entities": [
|
||||
{
|
||||
"tableName": "User",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `userId` TEXT, `username` TEXT, `baseUrl` TEXT, `token` TEXT, `displayName` TEXT, `pushConfigurationState` TEXT, `capabilities` TEXT, `serverVersion` TEXT DEFAULT '', `clientCertificate` TEXT, `externalSignalingServer` TEXT, `current` INTEGER NOT NULL, `scheduledForDeletion` INTEGER NOT NULL)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "userId",
|
||||
"columnName": "userId",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "username",
|
||||
"columnName": "username",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "baseUrl",
|
||||
"columnName": "baseUrl",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "token",
|
||||
"columnName": "token",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "displayName",
|
||||
"columnName": "displayName",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "pushConfigurationState",
|
||||
"columnName": "pushConfigurationState",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "capabilities",
|
||||
"columnName": "capabilities",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "serverVersion",
|
||||
"columnName": "serverVersion",
|
||||
"affinity": "TEXT",
|
||||
"defaultValue": "''"
|
||||
},
|
||||
{
|
||||
"fieldPath": "clientCertificate",
|
||||
"columnName": "clientCertificate",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "externalSignalingServer",
|
||||
"columnName": "externalSignalingServer",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "current",
|
||||
"columnName": "current",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "scheduledForDeletion",
|
||||
"columnName": "scheduledForDeletion",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"tableName": "ArbitraryStorage",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountIdentifier` INTEGER NOT NULL, `key` TEXT NOT NULL, `object` TEXT, `value` TEXT, PRIMARY KEY(`accountIdentifier`, `key`))",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "accountIdentifier",
|
||||
"columnName": "accountIdentifier",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "key",
|
||||
"columnName": "key",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "storageObject",
|
||||
"columnName": "object",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "value",
|
||||
"columnName": "value",
|
||||
"affinity": "TEXT"
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": false,
|
||||
"columnNames": [
|
||||
"accountIdentifier",
|
||||
"key"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"tableName": "Conversations",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`internalId` TEXT NOT NULL, `accountId` INTEGER NOT NULL, `token` TEXT NOT NULL, `displayName` TEXT NOT NULL, `actorId` TEXT NOT NULL, `actorType` TEXT NOT NULL, `avatarVersion` TEXT NOT NULL, `callFlag` INTEGER NOT NULL, `callRecording` INTEGER NOT NULL, `callStartTime` INTEGER NOT NULL, `canDeleteConversation` INTEGER NOT NULL, `canLeaveConversation` INTEGER NOT NULL, `canStartCall` INTEGER NOT NULL, `description` TEXT NOT NULL, `hasCall` INTEGER NOT NULL, `hasPassword` INTEGER NOT NULL, `isCustomAvatar` INTEGER NOT NULL, `isFavorite` INTEGER NOT NULL, `lastActivity` INTEGER NOT NULL, `lastCommonReadMessage` INTEGER NOT NULL, `lastMessage` TEXT, `lastPing` INTEGER NOT NULL, `lastReadMessage` INTEGER NOT NULL, `lobbyState` TEXT NOT NULL, `lobbyTimer` INTEGER NOT NULL, `messageExpiration` INTEGER NOT NULL, `name` TEXT NOT NULL, `notificationCalls` INTEGER NOT NULL, `notificationLevel` TEXT NOT NULL, `objectType` TEXT NOT NULL, `objectId` TEXT NOT NULL, `participantType` TEXT NOT NULL, `permissions` INTEGER NOT NULL, `readOnly` TEXT NOT NULL, `recordingConsent` INTEGER NOT NULL, `remoteServer` TEXT, `remoteToken` TEXT, `sessionId` TEXT NOT NULL, `status` TEXT, `statusClearAt` INTEGER, `statusIcon` TEXT, `statusMessage` TEXT, `type` TEXT NOT NULL, `unreadMention` INTEGER NOT NULL, `unreadMentionDirect` INTEGER NOT NULL, `unreadMessages` INTEGER NOT NULL, `hasArchived` INTEGER NOT NULL, `hasSensitive` INTEGER NOT NULL, `hasImportant` INTEGER NOT NULL, PRIMARY KEY(`internalId`), FOREIGN KEY(`accountId`) REFERENCES `User`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "internalId",
|
||||
"columnName": "internalId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "accountId",
|
||||
"columnName": "accountId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "token",
|
||||
"columnName": "token",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "displayName",
|
||||
"columnName": "displayName",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorId",
|
||||
"columnName": "actorId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorType",
|
||||
"columnName": "actorType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "avatarVersion",
|
||||
"columnName": "avatarVersion",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "callFlag",
|
||||
"columnName": "callFlag",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "callRecording",
|
||||
"columnName": "callRecording",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "callStartTime",
|
||||
"columnName": "callStartTime",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "canDeleteConversation",
|
||||
"columnName": "canDeleteConversation",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "canLeaveConversation",
|
||||
"columnName": "canLeaveConversation",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "canStartCall",
|
||||
"columnName": "canStartCall",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "description",
|
||||
"columnName": "description",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasCall",
|
||||
"columnName": "hasCall",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasPassword",
|
||||
"columnName": "hasPassword",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasCustomAvatar",
|
||||
"columnName": "isCustomAvatar",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "favorite",
|
||||
"columnName": "isFavorite",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastActivity",
|
||||
"columnName": "lastActivity",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastCommonReadMessage",
|
||||
"columnName": "lastCommonReadMessage",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastMessage",
|
||||
"columnName": "lastMessage",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastPing",
|
||||
"columnName": "lastPing",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastReadMessage",
|
||||
"columnName": "lastReadMessage",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lobbyState",
|
||||
"columnName": "lobbyState",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lobbyTimer",
|
||||
"columnName": "lobbyTimer",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "messageExpiration",
|
||||
"columnName": "messageExpiration",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "name",
|
||||
"columnName": "name",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "notificationCalls",
|
||||
"columnName": "notificationCalls",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "notificationLevel",
|
||||
"columnName": "notificationLevel",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "objectType",
|
||||
"columnName": "objectType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "objectId",
|
||||
"columnName": "objectId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "participantType",
|
||||
"columnName": "participantType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "permissions",
|
||||
"columnName": "permissions",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "conversationReadOnlyState",
|
||||
"columnName": "readOnly",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "recordingConsentRequired",
|
||||
"columnName": "recordingConsent",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "remoteServer",
|
||||
"columnName": "remoteServer",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "remoteToken",
|
||||
"columnName": "remoteToken",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "sessionId",
|
||||
"columnName": "sessionId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "status",
|
||||
"columnName": "status",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "statusClearAt",
|
||||
"columnName": "statusClearAt",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "statusIcon",
|
||||
"columnName": "statusIcon",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "statusMessage",
|
||||
"columnName": "statusMessage",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "type",
|
||||
"columnName": "type",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "unreadMention",
|
||||
"columnName": "unreadMention",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "unreadMentionDirect",
|
||||
"columnName": "unreadMentionDirect",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "unreadMessages",
|
||||
"columnName": "unreadMessages",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasArchived",
|
||||
"columnName": "hasArchived",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasSensitive",
|
||||
"columnName": "hasSensitive",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasImportant",
|
||||
"columnName": "hasImportant",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": false,
|
||||
"columnNames": [
|
||||
"internalId"
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_Conversations_accountId",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"accountId"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_Conversations_accountId` ON `${TABLE_NAME}` (`accountId`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": [
|
||||
{
|
||||
"table": "User",
|
||||
"onDelete": "CASCADE",
|
||||
"onUpdate": "CASCADE",
|
||||
"columns": [
|
||||
"accountId"
|
||||
],
|
||||
"referencedColumns": [
|
||||
"id"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tableName": "ChatMessages",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`internalId` TEXT NOT NULL, `accountId` INTEGER NOT NULL, `token` TEXT NOT NULL, `id` INTEGER NOT NULL, `internalConversationId` TEXT NOT NULL, `actorDisplayName` TEXT NOT NULL, `message` TEXT NOT NULL, `actorId` TEXT NOT NULL, `actorType` TEXT NOT NULL, `deleted` INTEGER NOT NULL, `expirationTimestamp` INTEGER NOT NULL, `isReplyable` INTEGER NOT NULL, `isTemporary` INTEGER NOT NULL, `lastEditActorDisplayName` TEXT, `lastEditActorId` TEXT, `lastEditActorType` TEXT, `lastEditTimestamp` INTEGER, `markdown` INTEGER, `messageParameters` TEXT, `messageType` TEXT NOT NULL, `parent` INTEGER, `reactions` TEXT, `reactionsSelf` TEXT, `referenceId` TEXT, `sendStatus` TEXT, `silent` INTEGER NOT NULL, `systemMessage` TEXT NOT NULL, `timestamp` INTEGER NOT NULL, PRIMARY KEY(`internalId`), FOREIGN KEY(`internalConversationId`) REFERENCES `Conversations`(`internalId`) ON UPDATE CASCADE ON DELETE CASCADE )",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "internalId",
|
||||
"columnName": "internalId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "accountId",
|
||||
"columnName": "accountId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "token",
|
||||
"columnName": "token",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "internalConversationId",
|
||||
"columnName": "internalConversationId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorDisplayName",
|
||||
"columnName": "actorDisplayName",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "message",
|
||||
"columnName": "message",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorId",
|
||||
"columnName": "actorId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "actorType",
|
||||
"columnName": "actorType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "deleted",
|
||||
"columnName": "deleted",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "expirationTimestamp",
|
||||
"columnName": "expirationTimestamp",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "replyable",
|
||||
"columnName": "isReplyable",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "isTemporary",
|
||||
"columnName": "isTemporary",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastEditActorDisplayName",
|
||||
"columnName": "lastEditActorDisplayName",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastEditActorId",
|
||||
"columnName": "lastEditActorId",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastEditActorType",
|
||||
"columnName": "lastEditActorType",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "lastEditTimestamp",
|
||||
"columnName": "lastEditTimestamp",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "renderMarkdown",
|
||||
"columnName": "markdown",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "messageParameters",
|
||||
"columnName": "messageParameters",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "messageType",
|
||||
"columnName": "messageType",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "parentMessageId",
|
||||
"columnName": "parent",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "reactions",
|
||||
"columnName": "reactions",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "reactionsSelf",
|
||||
"columnName": "reactionsSelf",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "referenceId",
|
||||
"columnName": "referenceId",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "sendStatus",
|
||||
"columnName": "sendStatus",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "silent",
|
||||
"columnName": "silent",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "systemMessageType",
|
||||
"columnName": "systemMessage",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "timestamp",
|
||||
"columnName": "timestamp",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": false,
|
||||
"columnNames": [
|
||||
"internalId"
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_ChatMessages_internalId",
|
||||
"unique": true,
|
||||
"columnNames": [
|
||||
"internalId"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_ChatMessages_internalId` ON `${TABLE_NAME}` (`internalId`)"
|
||||
},
|
||||
{
|
||||
"name": "index_ChatMessages_internalConversationId",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"internalConversationId"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_ChatMessages_internalConversationId` ON `${TABLE_NAME}` (`internalConversationId`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": [
|
||||
{
|
||||
"table": "Conversations",
|
||||
"onDelete": "CASCADE",
|
||||
"onUpdate": "CASCADE",
|
||||
"columns": [
|
||||
"internalConversationId"
|
||||
],
|
||||
"referencedColumns": [
|
||||
"internalId"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tableName": "ChatBlocks",
|
||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `internalConversationId` TEXT NOT NULL, `accountId` INTEGER, `token` TEXT, `oldestMessageId` INTEGER NOT NULL, `newestMessageId` INTEGER NOT NULL, `hasHistory` INTEGER NOT NULL, FOREIGN KEY(`internalConversationId`) REFERENCES `Conversations`(`internalId`) ON UPDATE CASCADE ON DELETE CASCADE )",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
"columnName": "id",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "internalConversationId",
|
||||
"columnName": "internalConversationId",
|
||||
"affinity": "TEXT",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "accountId",
|
||||
"columnName": "accountId",
|
||||
"affinity": "INTEGER"
|
||||
},
|
||||
{
|
||||
"fieldPath": "token",
|
||||
"columnName": "token",
|
||||
"affinity": "TEXT"
|
||||
},
|
||||
{
|
||||
"fieldPath": "oldestMessageId",
|
||||
"columnName": "oldestMessageId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "newestMessageId",
|
||||
"columnName": "newestMessageId",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
},
|
||||
{
|
||||
"fieldPath": "hasHistory",
|
||||
"columnName": "hasHistory",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
}
|
||||
],
|
||||
"primaryKey": {
|
||||
"autoGenerate": true,
|
||||
"columnNames": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"name": "index_ChatBlocks_internalConversationId",
|
||||
"unique": false,
|
||||
"columnNames": [
|
||||
"internalConversationId"
|
||||
],
|
||||
"orders": [],
|
||||
"createSql": "CREATE INDEX IF NOT EXISTS `index_ChatBlocks_internalConversationId` ON `${TABLE_NAME}` (`internalConversationId`)"
|
||||
}
|
||||
],
|
||||
"foreignKeys": [
|
||||
{
|
||||
"table": "Conversations",
|
||||
"onDelete": "CASCADE",
|
||||
"onUpdate": "CASCADE",
|
||||
"columns": [
|
||||
"internalConversationId"
|
||||
],
|
||||
"referencedColumns": [
|
||||
"internalId"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"setupQueries": [
|
||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '5bc4247e179307faa995552da5d34324')"
|
||||
]
|
||||
}
|
||||
}
|
@ -91,7 +91,7 @@ class AccountVerificationActivity : BaseActivity() {
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
setContentView(binding.root)
|
||||
actionBar?.hide()
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
|
||||
handleIntent()
|
||||
}
|
||||
@ -490,9 +490,9 @@ class AccountVerificationActivity : BaseActivity() {
|
||||
WorkManager.getInstance(applicationContext).enqueue(accountRemovalWork)
|
||||
|
||||
WorkManager.getInstance(context).getWorkInfoByIdLiveData(accountRemovalWork.id)
|
||||
.observeForever { workInfo: WorkInfo ->
|
||||
.observeForever { workInfo: WorkInfo? ->
|
||||
|
||||
when (workInfo.state) {
|
||||
when (workInfo?.state) {
|
||||
WorkInfo.State.SUCCEEDED -> {
|
||||
val intent = Intent(this, ServerSelectionActivity::class.java)
|
||||
startActivity(intent)
|
||||
|
@ -78,7 +78,7 @@ class ServerSelectionActivity : BaseActivity() {
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
setContentView(binding.root)
|
||||
actionBar?.hide()
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
|
||||
onBackPressedDispatcher.addCallback(this, onBackPressedCallback)
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ class SwitchAccountActivity : BaseActivity() {
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
setContentView(binding.root)
|
||||
setupActionBar()
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
|
||||
Configuration.getInstance().load(context, PreferenceManager.getDefaultSharedPreferences(context))
|
||||
|
||||
|
@ -114,7 +114,7 @@ class WebViewLoginActivity : BaseActivity() {
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
setContentView(binding.root)
|
||||
actionBar?.hide()
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
|
||||
onBackPressedDispatcher.addCallback(this, onBackPressedCallback)
|
||||
handleIntent()
|
||||
@ -286,6 +286,7 @@ class WebViewLoginActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("DiscouragedPrivateApi")
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
override fun onReceivedSslError(view: WebView, handler: SslErrorHandler, error: SslError) {
|
||||
try {
|
||||
@ -388,9 +389,9 @@ class WebViewLoginActivity : BaseActivity() {
|
||||
WorkManager.getInstance(applicationContext).enqueue(accountRemovalWork)
|
||||
|
||||
WorkManager.getInstance(context).getWorkInfoByIdLiveData(accountRemovalWork.id)
|
||||
.observeForever { workInfo: WorkInfo ->
|
||||
.observeForever { workInfo: WorkInfo? ->
|
||||
|
||||
when (workInfo.state) {
|
||||
when (workInfo?.state) {
|
||||
WorkInfo.State.SUCCEEDED, WorkInfo.State.FAILED, WorkInfo.State.CANCELLED -> {
|
||||
restartApp()
|
||||
}
|
||||
|
@ -11,11 +11,13 @@ package com.nextcloud.talk.activities
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowInsets
|
||||
import android.view.WindowManager
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.webkit.SslErrorHandler
|
||||
@ -37,6 +39,7 @@ import com.nextcloud.talk.ui.theme.ViewThemeUtils
|
||||
import com.nextcloud.talk.utils.DisplayUtils
|
||||
import com.nextcloud.talk.utils.FileViewerUtils
|
||||
import com.nextcloud.talk.utils.UriUtils
|
||||
import com.nextcloud.talk.utils.adjustUIForAPILevel35
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys
|
||||
import com.nextcloud.talk.utils.database.user.CurrentUserProviderNew
|
||||
import com.nextcloud.talk.utils.preferences.AppPreferences
|
||||
@ -81,6 +84,7 @@ open class BaseActivity : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this)
|
||||
adjustUIForAPILevel35()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
cleanTempCertPreference()
|
||||
@ -111,9 +115,22 @@ open class BaseActivity : AppCompatActivity() {
|
||||
eventBus.unregister(this)
|
||||
}
|
||||
|
||||
fun setupSystemColors() {
|
||||
colorizeStatusBar()
|
||||
colorizeNavigationBar()
|
||||
/*
|
||||
* May be aligned with android-common lib in the future: .../ui/util/extensions/AppCompatActivityExtensions.kt
|
||||
*/
|
||||
fun initSystemBars() {
|
||||
window.decorView.setOnApplyWindowInsetsListener { view, insets ->
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
||||
val statusBarHeight = insets.getInsets(WindowInsets.Type.statusBars()).top
|
||||
view.setPadding(0, statusBarHeight, 0, 0)
|
||||
val color = ResourcesCompat.getColor(resources, R.color.bg_default, context.theme)
|
||||
view.setBackgroundColor(color)
|
||||
} else {
|
||||
colorizeStatusBar()
|
||||
colorizeNavigationBar()
|
||||
}
|
||||
insets
|
||||
}
|
||||
}
|
||||
|
||||
open fun colorizeStatusBar() {
|
||||
|
@ -376,6 +376,8 @@ class CallActivity : CallBaseActivity() {
|
||||
Log.d(TAG, "onCreate")
|
||||
super.onCreate(savedInstanceState)
|
||||
sharedApplication!!.componentApplication.inject(this)
|
||||
|
||||
rootEglBase = EglBase.create()
|
||||
binding = CallActivityBinding.inflate(layoutInflater)
|
||||
setContentView(binding!!.root)
|
||||
hideNavigationIfNoPipAvailable()
|
||||
@ -765,7 +767,6 @@ class CallActivity : CallBaseActivity() {
|
||||
}
|
||||
|
||||
private fun basicInitialization() {
|
||||
rootEglBase = EglBase.create()
|
||||
createCameraEnumerator()
|
||||
|
||||
// Create a new PeerConnectionFactory instance.
|
||||
@ -947,8 +948,7 @@ class CallActivity : CallBaseActivity() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = participantUiStates,
|
||||
eglBase = rootEglBase!!,
|
||||
isVoiceOnlyCall = isVoiceOnlyCall,
|
||||
isInPipMode = isInPipMode
|
||||
isVoiceOnlyCall = isVoiceOnlyCall
|
||||
) {
|
||||
animateCallControls(true, 0)
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import android.text.TextUtils
|
||||
import android.text.format.DateUtils
|
||||
import android.text.style.ImageSpan
|
||||
import android.view.View
|
||||
import android.widget.RelativeLayout
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import com.nextcloud.talk.R
|
||||
@ -155,6 +156,30 @@ class ConversationItem(
|
||||
} else {
|
||||
holder.binding.userStatusImage.visibility = View.GONE
|
||||
}
|
||||
|
||||
val dialogNameParams = holder.binding.dialogName.layoutParams as RelativeLayout.LayoutParams
|
||||
val unreadBubbleParams = holder.binding.dialogUnreadBubble.layoutParams as RelativeLayout.LayoutParams
|
||||
val relativeLayoutParams = holder.binding.relativeLayout.layoutParams as RelativeLayout.LayoutParams
|
||||
|
||||
if (model.hasSensitive == true) {
|
||||
dialogNameParams.addRule(RelativeLayout.CENTER_VERTICAL)
|
||||
relativeLayoutParams.addRule(RelativeLayout.ALIGN_TOP, R.id.dialogAvatarFrameLayout)
|
||||
dialogNameParams.marginEnd =
|
||||
context.resources.getDimensionPixelSize(R.dimen.standard_double_padding)
|
||||
unreadBubbleParams.topMargin =
|
||||
context.resources.getDimensionPixelSize(R.dimen.double_margin_between_elements)
|
||||
unreadBubbleParams.addRule(RelativeLayout.CENTER_VERTICAL)
|
||||
} else {
|
||||
dialogNameParams.removeRule(RelativeLayout.CENTER_VERTICAL)
|
||||
relativeLayoutParams.removeRule(RelativeLayout.ALIGN_TOP)
|
||||
dialogNameParams.marginEnd = 0
|
||||
unreadBubbleParams.topMargin = 0
|
||||
unreadBubbleParams.removeRule(RelativeLayout.CENTER_VERTICAL)
|
||||
}
|
||||
holder.binding.relativeLayout.layoutParams = relativeLayoutParams
|
||||
holder.binding.dialogUnreadBubble.layoutParams = unreadBubbleParams
|
||||
holder.binding.dialogName.layoutParams = dialogNameParams
|
||||
|
||||
setLastMessage(holder, appContext)
|
||||
showAvatar(holder)
|
||||
}
|
||||
@ -406,9 +431,9 @@ class ConversationItem(
|
||||
)
|
||||
return lastMessage
|
||||
} else if (MessageType.SINGLE_NC_ATTACHMENT_MESSAGE == chatMessage?.getCalculateMessageType()) {
|
||||
var attachmentName = chatMessage.message
|
||||
var attachmentName = chatMessage.text
|
||||
if (attachmentName == "{file}") {
|
||||
attachmentName = chatMessage.messageParameters?.get("file")?.get("name")
|
||||
attachmentName = chatMessage.messageParameters?.get("file")?.get("name") ?: ""
|
||||
}
|
||||
val author = authorName(chatMessage)
|
||||
|
||||
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
package com.nextcloud.talk.adapters.items
|
||||
|
||||
import android.view.View
|
||||
import com.nextcloud.talk.R
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem
|
||||
import eu.davidea.flexibleadapter.items.IFlexible
|
||||
import eu.davidea.viewholders.FlexibleViewHolder
|
||||
|
||||
class SpacerItem(private val height: Int) : AbstractFlexibleItem<SpacerItem.ViewHolder>() {
|
||||
|
||||
override fun getLayoutRes(): Int = R.layout.item_spacer
|
||||
|
||||
override fun createViewHolder(view: View?, adapter: FlexibleAdapter<IFlexible<*>?>?): ViewHolder {
|
||||
return ViewHolder(view!!, adapter!!)
|
||||
}
|
||||
|
||||
override fun bindViewHolder(
|
||||
adapter: FlexibleAdapter<IFlexible<*>?>?,
|
||||
holder: ViewHolder,
|
||||
position: Int,
|
||||
payloads: MutableList<Any>?
|
||||
) {
|
||||
holder.itemView.layoutParams.height = height
|
||||
}
|
||||
|
||||
override fun equals(other: Any?) = other is SpacerItem
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
class ViewHolder(view: View, adapter: FlexibleAdapter<*>) :
|
||||
FlexibleViewHolder(view, adapter)
|
||||
}
|
@ -18,7 +18,9 @@ import androidx.core.content.ContextCompat
|
||||
import androidx.core.text.toSpanned
|
||||
import autodagger.AutoInjector
|
||||
import coil.load
|
||||
import com.google.android.flexbox.FlexboxLayout
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.nextcloud.android.common.ui.theme.utils.ColorRole
|
||||
import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication
|
||||
@ -103,10 +105,33 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
|
||||
true,
|
||||
viewThemeUtils
|
||||
)
|
||||
|
||||
val spansFromString: Array<Any> = processedMessageText!!.getSpans(
|
||||
0,
|
||||
processedMessageText.length,
|
||||
Any::class.java
|
||||
)
|
||||
|
||||
if (spansFromString.isNotEmpty()) {
|
||||
binding.bubble.layoutParams.apply {
|
||||
width = FlexboxLayout.LayoutParams.MATCH_PARENT
|
||||
}
|
||||
binding.messageText.layoutParams.apply {
|
||||
width = FlexboxLayout.LayoutParams.MATCH_PARENT
|
||||
}
|
||||
} else {
|
||||
binding.bubble.layoutParams.apply {
|
||||
width = FlexboxLayout.LayoutParams.WRAP_CONTENT
|
||||
}
|
||||
binding.messageText.layoutParams.apply {
|
||||
width = FlexboxLayout.LayoutParams.WRAP_CONTENT
|
||||
}
|
||||
}
|
||||
|
||||
processedMessageText = messageUtils.processMessageParameters(
|
||||
binding.messageText.context,
|
||||
viewThemeUtils,
|
||||
processedMessageText!!,
|
||||
processedMessageText,
|
||||
message,
|
||||
itemView
|
||||
)
|
||||
@ -133,7 +158,7 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
|
||||
binding.messageEditIndicator.visibility = View.GONE
|
||||
binding.messageTime.text = dateUtils.getLocalTimeStringFromTimestamp(message.timestamp)
|
||||
}
|
||||
binding.messageTime.setTextColor(ContextCompat.getColor(context, R.color.no_emphasis_text))
|
||||
viewThemeUtils.platform.colorTextView(binding.messageTime, ColorRole.ON_SURFACE_VARIANT)
|
||||
// parent message handling
|
||||
if (!message.isDeleted && message.parentMessageId != null) {
|
||||
processParentMessage(message)
|
||||
|
@ -29,6 +29,7 @@ import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedA
|
||||
import com.nextcloud.talk.chat.ChatActivity
|
||||
import com.nextcloud.talk.chat.data.ChatMessageRepository
|
||||
import com.nextcloud.talk.chat.data.model.ChatMessage
|
||||
import com.nextcloud.talk.data.database.model.SendStatus
|
||||
import com.nextcloud.talk.data.network.NetworkMonitor
|
||||
import com.nextcloud.talk.data.user.model.User
|
||||
import com.nextcloud.talk.databinding.ItemCustomOutcomingTextMessageBinding
|
||||
@ -105,7 +106,6 @@ class OutcomingTextMessageViewHolder(itemView: View) :
|
||||
if (!hasCheckboxes) {
|
||||
realView.isSelected = false
|
||||
layoutParams.isWrapBefore = false
|
||||
viewThemeUtils.platform.colorTextView(binding.messageTime, ColorRole.ON_SURFACE_VARIANT)
|
||||
|
||||
binding.messageText.visibility = View.VISIBLE
|
||||
binding.checkboxContainer.visibility = View.GONE
|
||||
@ -116,10 +116,33 @@ class OutcomingTextMessageViewHolder(itemView: View) :
|
||||
false,
|
||||
viewThemeUtils
|
||||
)
|
||||
|
||||
val spansFromString: Array<Any> = processedMessageText!!.getSpans(
|
||||
0,
|
||||
processedMessageText.length,
|
||||
Any::class.java
|
||||
)
|
||||
|
||||
if (spansFromString.isNotEmpty()) {
|
||||
binding.bubble.layoutParams.apply {
|
||||
width = FlexboxLayout.LayoutParams.MATCH_PARENT
|
||||
}
|
||||
binding.messageText.layoutParams.apply {
|
||||
width = FlexboxLayout.LayoutParams.MATCH_PARENT
|
||||
}
|
||||
} else {
|
||||
binding.bubble.layoutParams.apply {
|
||||
width = FlexboxLayout.LayoutParams.WRAP_CONTENT
|
||||
}
|
||||
binding.messageText.layoutParams.apply {
|
||||
width = FlexboxLayout.LayoutParams.WRAP_CONTENT
|
||||
}
|
||||
}
|
||||
|
||||
processedMessageText = messageUtils.processMessageParameters(
|
||||
binding.messageText.context,
|
||||
viewThemeUtils,
|
||||
processedMessageText!!,
|
||||
processedMessageText,
|
||||
message,
|
||||
itemView
|
||||
)
|
||||
@ -149,7 +172,7 @@ class OutcomingTextMessageViewHolder(itemView: View) :
|
||||
binding.messageEditIndicator.visibility = View.GONE
|
||||
binding.messageTime.text = dateUtils.getLocalTimeStringFromTimestamp(message.timestamp)
|
||||
}
|
||||
binding.messageTime.setTextColor(ContextCompat.getColor(context, R.color.no_emphasis_text))
|
||||
viewThemeUtils.platform.colorTextView(binding.messageTime, ColorRole.ON_SURFACE_VARIANT)
|
||||
setBubbleOnChatMessage(message)
|
||||
// parent message handling
|
||||
if (!message.isDeleted && message.parentMessageId != null) {
|
||||
@ -162,7 +185,7 @@ class OutcomingTextMessageViewHolder(itemView: View) :
|
||||
binding.checkMark.visibility = View.INVISIBLE
|
||||
binding.sendingProgress.visibility = View.GONE
|
||||
|
||||
if (message.sendingFailed) {
|
||||
if (message.sendStatus == SendStatus.FAILED) {
|
||||
updateStatus(R.drawable.baseline_error_outline_24, context.resources?.getString(R.string.nc_message_failed))
|
||||
} else if (message.isTemporary) {
|
||||
updateStatus(R.drawable.baseline_schedule_24, context.resources?.getString(R.string.nc_message_sending))
|
||||
|
@ -17,6 +17,7 @@ import com.nextcloud.talk.models.json.generic.GenericOverall
|
||||
import com.nextcloud.talk.models.json.participants.AddParticipantOverall
|
||||
import com.nextcloud.talk.models.json.participants.TalkBan
|
||||
import com.nextcloud.talk.models.json.participants.TalkBanOverall
|
||||
import com.nextcloud.talk.models.json.profile.ProfileOverall
|
||||
import com.nextcloud.talk.models.json.testNotification.TestNotificationOverall
|
||||
import com.nextcloud.talk.models.json.userAbsence.UserAbsenceOverall
|
||||
import okhttp3.MultipartBody
|
||||
@ -178,12 +179,36 @@ interface NcApiCoroutines {
|
||||
@Url url: String
|
||||
): GenericOverall
|
||||
|
||||
@POST
|
||||
suspend fun markConversationAsImportant(
|
||||
@Header("Authorization") authorization: String,
|
||||
@Url url: String
|
||||
): GenericOverall
|
||||
|
||||
@DELETE
|
||||
suspend fun markConversationAsUnimportant(
|
||||
@Header("Authorization") authorization: String,
|
||||
@Url url: String
|
||||
): GenericOverall
|
||||
|
||||
@DELETE
|
||||
suspend fun removeConversationFromFavorites(
|
||||
@Header("Authorization") authorization: String,
|
||||
@Url url: String
|
||||
): GenericOverall
|
||||
|
||||
@POST
|
||||
suspend fun markConversationAsSensitive(
|
||||
@Header("Authorization") authorization: String,
|
||||
@Url url: String
|
||||
): GenericOverall
|
||||
|
||||
@DELETE
|
||||
suspend fun markConversationAsInsensitive(
|
||||
@Header("Authorization") authorization: String,
|
||||
@Url url: String
|
||||
): GenericOverall
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST
|
||||
suspend fun notificationCalls(
|
||||
@ -254,4 +279,10 @@ interface NcApiCoroutines {
|
||||
|
||||
@GET
|
||||
suspend fun getNoteToSelfRoom(@Header("Authorization") authorization: String, @Url url: String): RoomOverall
|
||||
|
||||
@GET
|
||||
suspend fun getProfile(@Header("Authorization") authorization: String, @Url url: String): ProfileOverall
|
||||
|
||||
@DELETE
|
||||
suspend fun unbindRoom(@Header("Authorization") authorization: String, @Url url: String): GenericOverall
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ import coil.decode.SvgDecoder
|
||||
import coil.memory.MemoryCache
|
||||
import coil.util.DebugLogger
|
||||
import com.nextcloud.talk.BuildConfig
|
||||
import com.nextcloud.talk.filebrowser.webdav.DavUtils
|
||||
import com.nextcloud.talk.dagger.modules.BusModule
|
||||
import com.nextcloud.talk.dagger.modules.ContextModule
|
||||
import com.nextcloud.talk.dagger.modules.DaosModule
|
||||
@ -43,6 +42,7 @@ import com.nextcloud.talk.dagger.modules.RepositoryModule
|
||||
import com.nextcloud.talk.dagger.modules.RestModule
|
||||
import com.nextcloud.talk.dagger.modules.UtilsModule
|
||||
import com.nextcloud.talk.dagger.modules.ViewModelModule
|
||||
import com.nextcloud.talk.filebrowser.webdav.DavUtils
|
||||
import com.nextcloud.talk.jobs.AccountRemovalWorker
|
||||
import com.nextcloud.talk.jobs.CapabilitiesWorker
|
||||
import com.nextcloud.talk.jobs.SignalingSettingsWorker
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
package com.nextcloud.talk.bottomsheet.items
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
@ -65,6 +66,7 @@ internal class ListIconDialogAdapter<IT : ListItemWithImage>(
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("RestrictedApi")
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ListItemViewHolder {
|
||||
val listItemView: View = parent.inflate(dialog.windowContext, R.layout.menu_item_sheet)
|
||||
val viewHolder = ListItemViewHolder(
|
||||
|
@ -9,14 +9,15 @@
|
||||
|
||||
package com.nextcloud.talk.call.components
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.res.Configuration
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.BoxWithConstraints
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.grid.GridCells
|
||||
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
|
||||
import androidx.compose.foundation.lazy.grid.items
|
||||
@ -29,6 +30,7 @@ import com.nextcloud.talk.adapters.ParticipantUiState
|
||||
import org.webrtc.EglBase
|
||||
import kotlin.math.ceil
|
||||
|
||||
@SuppressLint("UnusedBoxWithConstraintsScope")
|
||||
@Suppress("LongParameterList")
|
||||
@Composable
|
||||
fun ParticipantGrid(
|
||||
@ -36,7 +38,6 @@ fun ParticipantGrid(
|
||||
eglBase: EglBase?,
|
||||
participantUiStates: List<ParticipantUiState>,
|
||||
isVoiceOnlyCall: Boolean,
|
||||
isInPipMode: Boolean,
|
||||
onClick: () -> Unit
|
||||
) {
|
||||
val configuration = LocalConfiguration.current
|
||||
@ -44,63 +45,61 @@ fun ParticipantGrid(
|
||||
|
||||
val minItemHeight = 100.dp
|
||||
|
||||
val columns =
|
||||
if (isPortrait) {
|
||||
when (participantUiStates.size) {
|
||||
1, 2, 3 -> 1
|
||||
else -> 2
|
||||
}
|
||||
} else {
|
||||
when (participantUiStates.size) {
|
||||
1 -> 1
|
||||
2, 4 -> 2
|
||||
else -> 3
|
||||
}
|
||||
if (participantUiStates.isEmpty()) return
|
||||
|
||||
val columns = if (isPortrait) {
|
||||
when (participantUiStates.size) {
|
||||
1, 2, 3 -> 1
|
||||
else -> 2
|
||||
}
|
||||
|
||||
val rows = ceil(participantUiStates.size / columns.toFloat()).toInt()
|
||||
|
||||
val heightForNonGridComponents = if (isVoiceOnlyCall && !isInPipMode) {
|
||||
// this is a workaround for now. It should ~summarize the height of callInfosLinearLayout and callControls
|
||||
// Once everything is migrated to jetpack, this workaround should be obsolete or solved in a better way
|
||||
240.dp
|
||||
} else {
|
||||
0.dp
|
||||
}
|
||||
when (participantUiStates.size) {
|
||||
1 -> 1
|
||||
2, 4 -> 2
|
||||
else -> 3
|
||||
}
|
||||
}.coerceAtLeast(1) // Prevent 0
|
||||
|
||||
val rows = ceil(participantUiStates.size / columns.toFloat()).toInt().coerceAtLeast(1)
|
||||
|
||||
val gridHeight = LocalConfiguration.current.screenHeightDp.dp - heightForNonGridComponents
|
||||
val itemSpacing = 8.dp
|
||||
val edgePadding = 8.dp
|
||||
|
||||
val totalVerticalSpacing = itemSpacing * (rows - 1)
|
||||
val totalVerticalPadding = edgePadding * 2
|
||||
val availableHeight = gridHeight - totalVerticalSpacing - totalVerticalPadding
|
||||
|
||||
val rawItemHeight = availableHeight / rows
|
||||
val itemHeight = maxOf(rawItemHeight, minItemHeight)
|
||||
|
||||
LazyVerticalGrid(
|
||||
columns = GridCells.Fixed(columns),
|
||||
modifier = Modifier
|
||||
BoxWithConstraints(
|
||||
modifier = modifier
|
||||
.fillMaxSize()
|
||||
.padding(horizontal = edgePadding)
|
||||
.clickable { onClick() },
|
||||
verticalArrangement = Arrangement.spacedBy(itemSpacing),
|
||||
horizontalArrangement = Arrangement.spacedBy(itemSpacing),
|
||||
contentPadding = PaddingValues(vertical = edgePadding)
|
||||
.clickable { onClick() }
|
||||
) {
|
||||
items(
|
||||
participantUiStates,
|
||||
key = { it.sessionKey }
|
||||
) { participant ->
|
||||
ParticipantTile(
|
||||
participantUiState = participant,
|
||||
modifier = Modifier
|
||||
.height(itemHeight)
|
||||
.fillMaxWidth(),
|
||||
eglBase = eglBase,
|
||||
isVoiceOnlyCall = isVoiceOnlyCall
|
||||
)
|
||||
val availableHeight = maxHeight
|
||||
|
||||
val gridAvailableHeight = availableHeight - totalVerticalSpacing - totalVerticalPadding
|
||||
val rawItemHeight = gridAvailableHeight / rows
|
||||
val itemHeight = maxOf(rawItemHeight, minItemHeight)
|
||||
|
||||
LazyVerticalGrid(
|
||||
columns = GridCells.Fixed(columns),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(availableHeight),
|
||||
verticalArrangement = Arrangement.spacedBy(itemSpacing),
|
||||
horizontalArrangement = Arrangement.spacedBy(itemSpacing),
|
||||
contentPadding = PaddingValues(vertical = edgePadding, horizontal = edgePadding)
|
||||
) {
|
||||
items(
|
||||
participantUiStates,
|
||||
key = { it.sessionKey }
|
||||
) { participant ->
|
||||
ParticipantTile(
|
||||
participantUiState = participant,
|
||||
modifier = Modifier
|
||||
.height(itemHeight)
|
||||
.fillMaxWidth(),
|
||||
eglBase = eglBase,
|
||||
isVoiceOnlyCall = isVoiceOnlyCall
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -111,8 +110,7 @@ fun ParticipantGridPreview() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(1),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -122,8 +120,7 @@ fun TwoParticipants() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(2),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -133,8 +130,7 @@ fun ThreeParticipants() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(3),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -144,8 +140,7 @@ fun FourParticipants() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(4),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -155,8 +150,7 @@ fun FiveParticipants() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(5),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -166,8 +160,7 @@ fun SevenParticipants() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(7),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -177,8 +170,7 @@ fun FiftyParticipants() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(50),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -192,8 +184,7 @@ fun OneParticipantLandscape() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(1),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -207,8 +198,7 @@ fun TwoParticipantsLandscape() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(2),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -222,8 +212,7 @@ fun ThreeParticipantsLandscape() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(3),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -237,8 +226,7 @@ fun FourParticipantsLandscape() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(4),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -252,8 +240,7 @@ fun SevenParticipantsLandscape() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(7),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
@ -267,8 +254,7 @@ fun FiftyParticipantsLandscape() {
|
||||
ParticipantGrid(
|
||||
participantUiStates = getTestParticipants(50),
|
||||
eglBase = null,
|
||||
isVoiceOnlyCall = false,
|
||||
isInPipMode = false
|
||||
isVoiceOnlyCall = false
|
||||
) {}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
package com.nextcloud.talk.call.components
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.BoxWithConstraints
|
||||
@ -40,6 +41,7 @@ const val NICK_OFFSET = 4f
|
||||
const val NICK_BLUR_RADIUS = 4f
|
||||
const val AVATAR_SIZE_FACTOR = 0.6f
|
||||
|
||||
@SuppressLint("UnusedBoxWithConstraintsScope")
|
||||
@Suppress("Detekt.LongMethod")
|
||||
@Composable
|
||||
fun ParticipantTile(
|
||||
|
@ -16,7 +16,6 @@ package com.nextcloud.talk.chat
|
||||
|
||||
import android.Manifest
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
@ -53,6 +52,7 @@ import androidx.activity.result.ActivityResult
|
||||
import androidx.activity.result.ActivityResultLauncher
|
||||
import androidx.activity.result.PickVisualMediaRequest
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.activity.result.contract.ActivityResultContracts.PickVisualMedia
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.view.ContextThemeWrapper
|
||||
import androidx.cardview.widget.CardView
|
||||
@ -66,6 +66,8 @@ import androidx.core.graphics.drawable.toDrawable
|
||||
import androidx.core.net.toUri
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.core.text.bold
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.emoji2.text.EmojiCompat
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.fragment.app.commit
|
||||
@ -85,6 +87,7 @@ import coil.request.CachePolicy
|
||||
import coil.request.ImageRequest
|
||||
import coil.target.Target
|
||||
import coil.transform.CircleCropTransformation
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.nextcloud.android.common.ui.color.ColorUtil
|
||||
@ -124,6 +127,7 @@ import com.nextcloud.talk.chat.data.model.ChatMessage
|
||||
import com.nextcloud.talk.chat.viewmodels.ChatViewModel
|
||||
import com.nextcloud.talk.chat.viewmodels.MessageInputViewModel
|
||||
import com.nextcloud.talk.conversationinfo.ConversationInfoActivity
|
||||
import com.nextcloud.talk.conversationinfo.viewmodel.ConversationInfoViewModel
|
||||
import com.nextcloud.talk.conversationlist.ConversationsListActivity
|
||||
import com.nextcloud.talk.data.network.NetworkMonitor
|
||||
import com.nextcloud.talk.data.user.model.User
|
||||
@ -142,6 +146,7 @@ import com.nextcloud.talk.models.domain.ConversationModel
|
||||
import com.nextcloud.talk.models.json.capabilities.SpreedCapability
|
||||
import com.nextcloud.talk.models.json.chat.ReadStatus
|
||||
import com.nextcloud.talk.models.json.conversations.ConversationEnums
|
||||
import com.nextcloud.talk.models.json.participants.Participant
|
||||
import com.nextcloud.talk.models.json.signaling.settings.SignalingSettingsOverall
|
||||
import com.nextcloud.talk.polls.ui.PollCreateDialogFragment
|
||||
import com.nextcloud.talk.remotefilebrowser.activities.RemoteFileBrowserActivity
|
||||
@ -153,6 +158,7 @@ import com.nextcloud.talk.ui.PlaybackSpeed
|
||||
import com.nextcloud.talk.ui.PlaybackSpeedControl
|
||||
import com.nextcloud.talk.ui.StatusDrawable
|
||||
import com.nextcloud.talk.ui.bottom.sheet.ProfileBottomSheet
|
||||
import com.nextcloud.talk.ui.dialog.ContextChatCompose
|
||||
import com.nextcloud.talk.ui.dialog.DateTimeCompose
|
||||
import com.nextcloud.talk.ui.dialog.FileAttachmentPreviewFragment
|
||||
import com.nextcloud.talk.ui.dialog.MessageActionsDialog
|
||||
@ -164,6 +170,10 @@ import com.nextcloud.talk.ui.recyclerview.MessageSwipeCallback
|
||||
import com.nextcloud.talk.utils.ApiUtils
|
||||
import com.nextcloud.talk.utils.AudioUtils
|
||||
import com.nextcloud.talk.utils.CapabilitiesUtil
|
||||
import com.nextcloud.talk.utils.CapabilitiesUtil.hasSpreedFeatureCapability
|
||||
import com.nextcloud.talk.utils.CapabilitiesUtil.retentionOfEventRooms
|
||||
import com.nextcloud.talk.utils.CapabilitiesUtil.retentionOfInstantMeetingRoom
|
||||
import com.nextcloud.talk.utils.CapabilitiesUtil.retentionOfSIPRoom
|
||||
import com.nextcloud.talk.utils.ContactUtils
|
||||
import com.nextcloud.talk.utils.ConversationUtils
|
||||
import com.nextcloud.talk.utils.DateConstants
|
||||
@ -208,6 +218,7 @@ import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.flow.collect
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.coroutines.withContext
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
@ -224,10 +235,8 @@ import java.util.Locale
|
||||
import java.util.concurrent.ExecutionException
|
||||
import javax.inject.Inject
|
||||
import kotlin.math.roundToInt
|
||||
import androidx.activity.result.contract.ActivityResultContracts.PickVisualMedia
|
||||
import com.nextcloud.talk.conversationinfo.viewmodel.ConversationInfoViewModel
|
||||
import com.nextcloud.talk.models.json.participants.Participant
|
||||
|
||||
@Suppress("TooManyFunctions")
|
||||
@AutoInjector(NextcloudTalkApplication::class)
|
||||
class ChatActivity :
|
||||
BaseActivity(),
|
||||
@ -268,6 +277,8 @@ class ChatActivity :
|
||||
lateinit var conversationInfoViewModel: ConversationInfoViewModel
|
||||
lateinit var messageInputViewModel: MessageInputViewModel
|
||||
|
||||
private var chatMenu: Menu? = null
|
||||
|
||||
private val startSelectContactForResult = registerForActivityResult(
|
||||
ActivityResultContracts
|
||||
.StartActivityForResult()
|
||||
@ -296,10 +307,34 @@ class ChatActivity :
|
||||
private val startMessageSearchForResult =
|
||||
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
|
||||
executeIfResultOk(it) { intent ->
|
||||
onMessageSearchResult(intent)
|
||||
runBlocking {
|
||||
val id = intent?.getStringExtra(MessageSearchActivity.RESULT_KEY_MESSAGE_ID)
|
||||
id?.let {
|
||||
startContextChatWindowForMessage(id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun startContextChatWindowForMessage(id: String?) {
|
||||
binding.genericComposeView.apply {
|
||||
val shouldDismiss = mutableStateOf(false)
|
||||
setContent {
|
||||
val bundle = bundleOf()
|
||||
bundle.putString(BundleKeys.KEY_CREDENTIALS, credentials!!)
|
||||
bundle.putString(BundleKeys.KEY_BASE_URL, conversationUser!!.baseUrl)
|
||||
bundle.putString(KEY_ROOM_TOKEN, roomToken)
|
||||
bundle.putString(BundleKeys.KEY_MESSAGE_ID, id)
|
||||
bundle.putString(
|
||||
KEY_CONVERSATION_NAME,
|
||||
currentConversation!!.displayName
|
||||
)
|
||||
ContextChatCompose(bundle).GetDialogView(shouldDismiss, context)
|
||||
}
|
||||
}
|
||||
Log.d(TAG, "Should open something else")
|
||||
}
|
||||
|
||||
private val startPickCameraIntentForResult = registerForActivityResult(
|
||||
ActivityResultContracts.StartActivityForResult()
|
||||
) {
|
||||
@ -329,6 +364,7 @@ class ChatActivity :
|
||||
var startCallFromRoomSwitch: Boolean = false
|
||||
|
||||
var voiceOnly: Boolean = true
|
||||
var focusInput: Boolean = false
|
||||
private lateinit var path: String
|
||||
|
||||
var myFirstMessage: CharSequence? = null
|
||||
@ -424,7 +460,28 @@ class ChatActivity :
|
||||
binding = ActivityChatBinding.inflate(layoutInflater)
|
||||
setupActionBar()
|
||||
setContentView(binding.root)
|
||||
setupSystemColors()
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.chat_container)) { view, insets ->
|
||||
val statusBarInsets = insets.getInsets(WindowInsetsCompat.Type.statusBars())
|
||||
val navBarInsets = insets.getInsets(WindowInsetsCompat.Type.navigationBars())
|
||||
val imeInsets = insets.getInsets(WindowInsetsCompat.Type.ime())
|
||||
|
||||
val isKeyboardVisible = insets.isVisible(WindowInsetsCompat.Type.ime())
|
||||
val bottomPadding = if (isKeyboardVisible) imeInsets.bottom else navBarInsets.bottom
|
||||
|
||||
view.setPadding(
|
||||
view.paddingLeft,
|
||||
statusBarInsets.top,
|
||||
view.paddingRight,
|
||||
bottomPadding
|
||||
)
|
||||
WindowInsetsCompat.CONSUMED
|
||||
}
|
||||
} else {
|
||||
colorizeStatusBar()
|
||||
colorizeNavigationBar()
|
||||
}
|
||||
|
||||
conversationUser = currentUserProvider.currentUser.blockingGet()
|
||||
handleIntent(intent)
|
||||
@ -452,7 +509,7 @@ class ChatActivity :
|
||||
initObservers()
|
||||
|
||||
pickMultipleMedia = registerForActivityResult(
|
||||
ActivityResultContracts.PickMultipleVisualMedia(5)
|
||||
ActivityResultContracts.PickMultipleVisualMedia(MAX_AMOUNT_MEDIA_FILE_PICKER)
|
||||
) { uris ->
|
||||
if (uris.isNotEmpty()) {
|
||||
onChooseFileResult(uris)
|
||||
@ -512,6 +569,8 @@ class ChatActivity :
|
||||
startCallFromRoomSwitch = extras?.getBoolean(KEY_START_CALL_AFTER_ROOM_SWITCH, false) == true
|
||||
|
||||
voiceOnly = extras?.getBoolean(KEY_CALL_VOICE_ONLY, false) == true
|
||||
|
||||
focusInput = extras?.getBoolean(BundleKeys.KEY_FOCUS_INPUT) == true
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
@ -603,12 +662,17 @@ class ChatActivity :
|
||||
supportFragmentManager.commit {
|
||||
setReorderingAllowed(true) // optimizes out redundant replace operations
|
||||
replace(R.id.fragment_container_activity_chat, messageInputFragment)
|
||||
runOnCommit {
|
||||
if (focusInput) {
|
||||
messageInputFragment.binding.fragmentMessageInputView.requestFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
joinRoomWithPassword()
|
||||
|
||||
if (conversationUser?.userId != "?" &&
|
||||
CapabilitiesUtil.hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.MENTION_FLAG)
|
||||
hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.MENTION_FLAG)
|
||||
) {
|
||||
binding.chatToolbar.setOnClickListener { _ -> showConversationInfoScreen() }
|
||||
}
|
||||
@ -632,6 +696,59 @@ class ChatActivity :
|
||||
}
|
||||
}
|
||||
|
||||
if (currentConversation?.objectType == ConversationEnums.ObjectType.EVENT &&
|
||||
hasSpreedFeatureCapability(
|
||||
conversationUser?.capabilities!!.spreedCapability!!,
|
||||
SpreedFeatures.UNBIND_CONVERSATION
|
||||
)
|
||||
) {
|
||||
val eventEndTimeStamp =
|
||||
currentConversation?.objectId
|
||||
?.split("#")
|
||||
?.getOrNull(1)
|
||||
?.toLongOrNull()
|
||||
val currentTimeStamp = (System.currentTimeMillis() / ONE_SECOND_IN_MILLIS).toLong()
|
||||
val retentionPeriod = retentionOfEventRooms(spreedCapabilities)
|
||||
val isPastEvent = eventEndTimeStamp?.let { it < currentTimeStamp }
|
||||
if (isPastEvent == true && retentionPeriod != 0) {
|
||||
showConversationDeletionWarning(retentionPeriod)
|
||||
}
|
||||
}
|
||||
|
||||
if (currentConversation?.objectType == ConversationEnums.ObjectType.PHONE_TEMPORARY &&
|
||||
hasSpreedFeatureCapability(
|
||||
conversationUser?.capabilities!!.spreedCapability!!,
|
||||
SpreedFeatures.UNBIND_CONVERSATION
|
||||
)
|
||||
) {
|
||||
val retentionPeriod = retentionOfSIPRoom(spreedCapabilities)
|
||||
val systemMessage = currentConversation?.lastMessage?.systemMessageType
|
||||
if (retentionPeriod != 0 && (
|
||||
systemMessage == ChatMessage.SystemMessageType.CALL_ENDED ||
|
||||
systemMessage == ChatMessage.SystemMessageType.CALL_ENDED_EVERYONE
|
||||
)
|
||||
) {
|
||||
showConversationDeletionWarning(retentionPeriod)
|
||||
}
|
||||
}
|
||||
|
||||
if (currentConversation?.objectType == ConversationEnums.ObjectType.INSTANT_MEETING &&
|
||||
hasSpreedFeatureCapability(
|
||||
conversationUser?.capabilities!!.spreedCapability!!,
|
||||
SpreedFeatures.UNBIND_CONVERSATION
|
||||
)
|
||||
) {
|
||||
val retentionPeriod = retentionOfInstantMeetingRoom(spreedCapabilities)
|
||||
val systemMessage = currentConversation?.lastMessage?.systemMessageType
|
||||
if (retentionPeriod != 0 && (
|
||||
systemMessage == ChatMessage.SystemMessageType.CALL_ENDED ||
|
||||
systemMessage == ChatMessage.SystemMessageType.CALL_ENDED_EVERYONE
|
||||
)
|
||||
) {
|
||||
showConversationDeletionWarning(retentionPeriod)
|
||||
}
|
||||
}
|
||||
|
||||
updateRoomTimerHandler(MILLIS_250)
|
||||
|
||||
val urlForChatting =
|
||||
@ -958,8 +1075,10 @@ class ChatActivity :
|
||||
val newString = state.messageEdited.ocs?.data?.parentMessage?.message ?: "(null)"
|
||||
val id = state.messageEdited.ocs?.data?.parentMessage?.id.toString()
|
||||
val index = adapter?.getMessagePositionById(id) ?: 0
|
||||
val message = adapter?.items?.get(index)?.item as ChatMessage
|
||||
setMessageAsEdited(message, newString)
|
||||
val item = adapter?.items?.get(index)?.item
|
||||
item?.let {
|
||||
setMessageAsEdited(item as ChatMessage, newString)
|
||||
}
|
||||
}
|
||||
|
||||
is MessageInputViewModel.EditMessageErrorState -> {
|
||||
@ -1001,6 +1120,29 @@ class ChatActivity :
|
||||
binding.voiceRecordingLock.y -= y
|
||||
}
|
||||
|
||||
chatViewModel.unbindRoomResult.observe(this) { uiState ->
|
||||
when (uiState) {
|
||||
is ChatViewModel.UnbindRoomUiState.Success -> {
|
||||
binding.conversationDeleteNotice.visibility = View.GONE
|
||||
Snackbar.make(
|
||||
binding.root,
|
||||
context.getString(R.string.nc_room_retention),
|
||||
Snackbar.LENGTH_LONG
|
||||
).show()
|
||||
|
||||
chatMenu?.removeItem(R.id.conversation_event)
|
||||
}
|
||||
is ChatViewModel.UnbindRoomUiState.Error -> {
|
||||
Snackbar.make(
|
||||
binding.root,
|
||||
context.getString(R.string.nc_common_error_sorry),
|
||||
Snackbar.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
else -> { }
|
||||
}
|
||||
}
|
||||
|
||||
chatViewModel.outOfOfficeViewState.observe(this) { uiState ->
|
||||
when (uiState) {
|
||||
is ChatViewModel.OutOfOfficeUIState.Error -> {
|
||||
@ -1116,6 +1258,69 @@ class ChatActivity :
|
||||
}
|
||||
}
|
||||
|
||||
fun showConversationDeletionWarning(retentionPeriod: Int) {
|
||||
binding.conversationDeleteNotice.visibility = View.VISIBLE
|
||||
binding.conversationDeleteNotice.apply {
|
||||
isClickable = false
|
||||
isFocusable = false
|
||||
bringToFront()
|
||||
}
|
||||
val deleteNoticeText = binding.conversationDeleteNotice.findViewById<TextView>(R.id.deletion_message)
|
||||
viewThemeUtils.material.themeCardView(binding.conversationDeleteNotice)
|
||||
|
||||
deleteNoticeText.text = resources.getQuantityString(
|
||||
R.plurals.nc_conversation_auto_delete_info,
|
||||
retentionPeriod,
|
||||
retentionPeriod
|
||||
)
|
||||
viewThemeUtils.material.colorMaterialButtonPrimaryTonal(
|
||||
binding.conversationDeleteNotice
|
||||
.findViewById<MaterialButton>(R.id.keep_button)
|
||||
)
|
||||
|
||||
if (ConversationUtils.isParticipantOwnerOrModerator(currentConversation!!)) {
|
||||
binding.conversationDeleteNotice.findViewById<MaterialButton>(R.id.delete_now_button).visibility =
|
||||
View.VISIBLE
|
||||
binding.conversationDeleteNotice.findViewById<MaterialButton>(R.id.keep_button).visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.conversationDeleteNotice.findViewById<MaterialButton>(R.id.delete_now_button).visibility =
|
||||
View.GONE
|
||||
binding.conversationDeleteNotice.findViewById<MaterialButton>(R.id.keep_button).visibility = View.GONE
|
||||
}
|
||||
binding.conversationDeleteNotice.findViewById<MaterialButton>(R.id.delete_now_button).setOnClickListener {
|
||||
deleteConversationDialog(it.context)
|
||||
}
|
||||
|
||||
binding.conversationDeleteNotice.findViewById<MaterialButton>(R.id.keep_button).setOnClickListener {
|
||||
chatViewModel.unbindRoom(credentials!!, conversationUser?.baseUrl!!, currentConversation?.token!!)
|
||||
}
|
||||
}
|
||||
|
||||
fun deleteConversationDialog(context: Context) {
|
||||
val dialogBuilder = MaterialAlertDialogBuilder(context)
|
||||
.setIcon(
|
||||
viewThemeUtils.dialog
|
||||
.colorMaterialAlertDialogIcon(context, R.drawable.ic_delete_black_24dp)
|
||||
)
|
||||
.setTitle(R.string.nc_delete_call)
|
||||
.setMessage(R.string.nc_delete_conversation_more)
|
||||
.setPositiveButton(R.string.nc_delete) { _, _ ->
|
||||
currentConversation?.let { conversation ->
|
||||
deleteConversation(conversation)
|
||||
}
|
||||
}
|
||||
.setNegativeButton(R.string.nc_cancel) { _, _ ->
|
||||
}
|
||||
|
||||
viewThemeUtils.dialog
|
||||
.colorMaterialAlertDialogBackground(context, dialogBuilder)
|
||||
val dialog = dialogBuilder.show()
|
||||
viewThemeUtils.platform.colorTextButtons(
|
||||
dialog.getButton(AlertDialog.BUTTON_POSITIVE),
|
||||
dialog.getButton(AlertDialog.BUTTON_NEGATIVE)
|
||||
)
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
@ -1788,8 +1993,8 @@ class ChatActivity :
|
||||
WorkManager.getInstance().enqueue(downloadWorker)
|
||||
|
||||
WorkManager.getInstance(context).getWorkInfoByIdLiveData(downloadWorker.id)
|
||||
.observeForever { workInfo: WorkInfo ->
|
||||
if (workInfo.state == WorkInfo.State.SUCCEEDED) {
|
||||
.observeForever { workInfo: WorkInfo? ->
|
||||
if (workInfo?.state == WorkInfo.State.SUCCEEDED) {
|
||||
funToCallWhenDownloadSuccessful()
|
||||
}
|
||||
}
|
||||
@ -1872,7 +2077,7 @@ class ChatActivity :
|
||||
|
||||
private fun shouldShowLobby(): Boolean {
|
||||
if (currentConversation != null) {
|
||||
return CapabilitiesUtil.hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.WEBINARY_LOBBY) &&
|
||||
return hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.WEBINARY_LOBBY) &&
|
||||
currentConversation?.lobbyState == ConversationEnums.LobbyState.LOBBY_STATE_MODERATORS_ONLY &&
|
||||
!ConversationUtils.canModerate(currentConversation!!, spreedCapabilities) &&
|
||||
!participantPermissions.canIgnoreLobby()
|
||||
@ -2127,15 +2332,8 @@ class ChatActivity :
|
||||
}
|
||||
}
|
||||
|
||||
private fun onMessageSearchResult(intent: Intent?) {
|
||||
val messageId = intent?.getStringExtra(MessageSearchActivity.RESULT_KEY_MESSAGE_ID)
|
||||
messageId?.let { id ->
|
||||
scrollToAndCenterMessageWithId(id)
|
||||
}
|
||||
}
|
||||
|
||||
private fun executeIfResultOk(result: ActivityResult, onResult: (intent: Intent?) -> Unit) {
|
||||
if (result.resultCode == Activity.RESULT_OK) {
|
||||
if (result.resultCode == RESULT_OK) {
|
||||
onResult(result.data)
|
||||
} else {
|
||||
Log.e(TAG, "resultCode for received intent was != ok")
|
||||
@ -2164,8 +2362,8 @@ class ChatActivity :
|
||||
} else {
|
||||
Log.d(
|
||||
TAG,
|
||||
"message $messageId that should be scrolled to was not found " +
|
||||
"(scrollToAndCenterMessageWithId)"
|
||||
"message $messageId that should be scrolled " +
|
||||
"to was not found (scrollToAndCenterMessageWithId)"
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -2629,7 +2827,7 @@ class ChatActivity :
|
||||
}
|
||||
|
||||
if (this::spreedCapabilities.isInitialized) {
|
||||
if (CapabilitiesUtil.hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.MESSAGE_EXPIRATION)) {
|
||||
if (hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.MESSAGE_EXPIRATION)) {
|
||||
deleteExpiredMessages()
|
||||
}
|
||||
} else {
|
||||
@ -2876,6 +3074,7 @@ class ChatActivity :
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
super.onCreateOptionsMenu(menu)
|
||||
menuInflater.inflate(R.menu.menu_conversation, menu)
|
||||
chatMenu = menu
|
||||
|
||||
if (currentConversation?.objectType == ConversationEnums.ObjectType.EVENT) {
|
||||
eventConversationMenuItem = menu.findItem(R.id.conversation_event)
|
||||
@ -2889,7 +3088,6 @@ class ChatActivity :
|
||||
loadAvatarForStatusBar()
|
||||
setActionBarTitle()
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@ -2897,7 +3095,7 @@ class ChatActivity :
|
||||
super.onPrepareOptionsMenu(menu)
|
||||
|
||||
if (this::spreedCapabilities.isInitialized) {
|
||||
if (CapabilitiesUtil.hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.READ_ONLY_ROOMS)) {
|
||||
if (hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.READ_ONLY_ROOMS)) {
|
||||
checkShowCallButtons()
|
||||
}
|
||||
|
||||
@ -2918,7 +3116,7 @@ class ChatActivity :
|
||||
}.collect()
|
||||
}
|
||||
|
||||
if (CapabilitiesUtil.hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.SILENT_CALL)) {
|
||||
if (hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.SILENT_CALL)) {
|
||||
Handler().post {
|
||||
findViewById<View?>(R.id.conversation_voice_call)?.setOnLongClickListener {
|
||||
showCallButtonMenu(true)
|
||||
@ -2977,10 +3175,10 @@ class ChatActivity :
|
||||
else -> super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
private fun showPopupWindow(anchorView: View) {
|
||||
val popupView = layoutInflater.inflate(R.layout.item_event_schedule, null)
|
||||
|
||||
val titleTextView = popupView.findViewById<TextView>(R.id.event_scheduled)
|
||||
val subtitleTextView = popupView.findViewById<TextView>(R.id.meetingTime)
|
||||
|
||||
val popupWindow = PopupWindow(
|
||||
@ -3009,28 +3207,7 @@ class ChatActivity :
|
||||
deleteConversation.visibility = View.VISIBLE
|
||||
|
||||
deleteConversation.setOnClickListener {
|
||||
val dialogBuilder = MaterialAlertDialogBuilder(it.context)
|
||||
.setIcon(
|
||||
viewThemeUtils.dialog
|
||||
.colorMaterialAlertDialogIcon(context, R.drawable.ic_delete_black_24dp)
|
||||
)
|
||||
.setTitle(R.string.nc_delete_call)
|
||||
.setMessage(R.string.nc_delete_conversation_more)
|
||||
.setPositiveButton(R.string.nc_delete) { _, _ ->
|
||||
currentConversation?.let { conversation ->
|
||||
deleteConversation(conversation)
|
||||
}
|
||||
}
|
||||
.setNegativeButton(R.string.nc_cancel) { _, _ ->
|
||||
}
|
||||
|
||||
viewThemeUtils.dialog
|
||||
.colorMaterialAlertDialogBackground(it.context, dialogBuilder)
|
||||
val dialog = dialogBuilder.show()
|
||||
viewThemeUtils.platform.colorTextButtons(
|
||||
dialog.getButton(AlertDialog.BUTTON_POSITIVE),
|
||||
dialog.getButton(AlertDialog.BUTTON_NEGATIVE)
|
||||
)
|
||||
deleteConversationDialog(it.context)
|
||||
popupWindow.dismiss()
|
||||
}
|
||||
} else {
|
||||
@ -3159,9 +3336,11 @@ class ChatActivity :
|
||||
context.resources.getString(R.string.nc_tomorrow_meeting),
|
||||
startDateTime.format(DateTimeFormatter.ofPattern("HH:mm"))
|
||||
)
|
||||
|
||||
else -> startDateTime.format(DateTimeFormatter.ofPattern("MMM d, yyyy, HH:mm"))
|
||||
}
|
||||
}
|
||||
|
||||
currentTime.isAfter(endDateTime) -> context.resources.getString(R.string.nc_meeting_ended)
|
||||
else -> context.resources.getString(R.string.nc_ongoing_meeting)
|
||||
}
|
||||
@ -3448,7 +3627,7 @@ class ChatActivity :
|
||||
|
||||
fun copyMessage(message: IMessage?) {
|
||||
val clipboardManager =
|
||||
getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
|
||||
val clipData = ClipData.newPlainText(
|
||||
resources?.getString(R.string.nc_app_product_name),
|
||||
message?.text
|
||||
@ -3624,6 +3803,7 @@ class ChatActivity :
|
||||
)
|
||||
showSnackBar(roomToken)
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
@ -3644,6 +3824,7 @@ class ChatActivity :
|
||||
chatIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
startActivity(chatIntent)
|
||||
}
|
||||
|
||||
fun openInFilesApp(message: ChatMessage) {
|
||||
val keyID = message.selectedIndividualHashMap!![PreviewMessageViewHolder.KEY_ID]
|
||||
val link = message.selectedIndividualHashMap!!["link"]
|
||||
@ -3760,7 +3941,7 @@ class ChatActivity :
|
||||
val isOlderThanSixHours = message
|
||||
.createdAt
|
||||
.before(Date(System.currentTimeMillis() - AGE_THRESHOLD_FOR_DELETE_MESSAGE))
|
||||
val hasDeleteMessagesUnlimitedCapability = CapabilitiesUtil.hasSpreedFeatureCapability(
|
||||
val hasDeleteMessagesUnlimitedCapability = hasSpreedFeatureCapability(
|
||||
spreedCapabilities,
|
||||
SpreedFeatures.DELETE_MESSAGES_UNLIMITED
|
||||
)
|
||||
@ -3770,7 +3951,7 @@ class ChatActivity :
|
||||
!hasDeleteMessagesUnlimitedCapability && isOlderThanSixHours -> false
|
||||
message.systemMessageType != ChatMessage.SystemMessageType.DUMMY -> false
|
||||
message.isDeleted -> false
|
||||
!CapabilitiesUtil.hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.DELETE_MESSAGES) -> false
|
||||
!hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.DELETE_MESSAGES) -> false
|
||||
!participantPermissions.hasChatPermission() -> false
|
||||
hasDeleteMessagesUnlimitedCapability -> true
|
||||
else -> true
|
||||
@ -3927,9 +4108,7 @@ class ChatActivity :
|
||||
}
|
||||
if (!foundMessage) {
|
||||
Log.d(TAG, "quoted message with id " + parentMessage.id + " was not found in adapter")
|
||||
// TODO: show better info
|
||||
// TODO: improve handling how this can be avoided. E.g. loading chat until message is reached...
|
||||
Snackbar.make(binding.root, "Message was not found", Snackbar.LENGTH_LONG).show()
|
||||
startContextChatWindowForMessage(parentMessage.id)
|
||||
}
|
||||
}
|
||||
|
||||
@ -4037,5 +4216,6 @@ class ChatActivity :
|
||||
const val OUT_OF_OFFICE_ALPHA = 76
|
||||
const val ZERO_INDEX = 0
|
||||
const val ONE_INDEX = 1
|
||||
const val MAX_AMOUNT_MEDIA_FILE_PICKER = 10
|
||||
}
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ class MessageInputFragment : Fragment() {
|
||||
val connectionGained = (!wasOnline && isOnline)
|
||||
Log.d(TAG, "isOnline: $isOnline\nwasOnline: $wasOnline\nconnectionGained: $connectionGained")
|
||||
if (connectionGained) {
|
||||
chatActivity.messageInputViewModel.sendTempMessages(
|
||||
chatActivity.messageInputViewModel.sendUnsentMessages(
|
||||
chatActivity.conversationUser!!.getCredentials(),
|
||||
ApiUtils.getUrlForChat(
|
||||
chatActivity.chatApiVersion,
|
||||
|
@ -110,7 +110,7 @@ interface ChatMessageRepository : LifecycleAwareManager {
|
||||
|
||||
suspend fun editTempChatMessage(message: ChatMessage, editedMessageText: String): Flow<Boolean>
|
||||
|
||||
suspend fun sendTempChatMessages(credentials: String, url: String)
|
||||
suspend fun sendUnsentChatMessages(credentials: String, url: String)
|
||||
|
||||
suspend fun deleteTempMessage(chatMessage: ChatMessage)
|
||||
}
|
||||
|
@ -183,19 +183,26 @@ class MediaPlayerManager : LifecycleAwareManager {
|
||||
continue
|
||||
}
|
||||
|
||||
if (mediaPlayer != null && mediaPlayer?.isPlaying == true) {
|
||||
val pos = mediaPlayer!!.currentPosition
|
||||
mediaPlayer?.let { player ->
|
||||
try {
|
||||
if (!player.isPlaying) return@let
|
||||
} catch (e: IllegalStateException) {
|
||||
Log.e(TAG, "Seekbar updated during an improper state: $e")
|
||||
return@let
|
||||
}
|
||||
|
||||
val pos = player.currentPosition
|
||||
mediaPlayerPosition = pos
|
||||
val progress = (pos.toFloat() / mediaPlayerDuration) * DIVIDER
|
||||
val progressI = ceil(progress).toInt()
|
||||
val seconds = (pos / ONE_SEC)
|
||||
_mediaPlayerSeekBarPosition.emit(progressI)
|
||||
currentCycledMessage?.let {
|
||||
it.isPlayingVoiceMessage = true
|
||||
it.voiceMessageSeekbarProgress = progressI
|
||||
it.voiceMessagePlayedSeconds = seconds
|
||||
if (progressI >= IS_PLAYED_CUTOFF) it.wasPlayedVoiceMessage = true
|
||||
_mediaPlayerSeekBarPositionMsg.emit(it)
|
||||
currentCycledMessage?.let { msg ->
|
||||
msg.isPlayingVoiceMessage = true
|
||||
msg.voiceMessageSeekbarProgress = progressI
|
||||
msg.voiceMessagePlayedSeconds = seconds
|
||||
if (progressI >= IS_PLAYED_CUTOFF) msg.wasPlayedVoiceMessage = true
|
||||
_mediaPlayerSeekBarPositionMsg.emit(msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ import android.util.Log
|
||||
import com.bluelinelabs.logansquare.annotation.JsonIgnore
|
||||
import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication
|
||||
import com.nextcloud.talk.data.database.model.SendStatus
|
||||
import com.nextcloud.talk.data.user.model.User
|
||||
import com.nextcloud.talk.models.json.chat.ChatUtils.Companion.getParsedMessage
|
||||
import com.nextcloud.talk.models.json.chat.ReadStatus
|
||||
@ -119,7 +120,7 @@ data class ChatMessage(
|
||||
|
||||
var referenceId: String? = null,
|
||||
|
||||
var sendingFailed: Boolean = true,
|
||||
var sendStatus: SendStatus? = null,
|
||||
|
||||
var silent: Boolean = false
|
||||
|
||||
|
@ -76,4 +76,5 @@ interface ChatNetworkDataSource {
|
||||
limit: Int
|
||||
): List<ChatMessageJson>
|
||||
suspend fun getOpenGraph(credentials: String, baseUrl: String, extractedLinkToPreview: String): Reference?
|
||||
suspend fun unbindRoom(credentials: String, baseUrl: String, roomToken: String): GenericOverall
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import com.nextcloud.talk.data.database.mappers.asEntity
|
||||
import com.nextcloud.talk.data.database.mappers.asModel
|
||||
import com.nextcloud.talk.data.database.model.ChatBlockEntity
|
||||
import com.nextcloud.talk.data.database.model.ChatMessageEntity
|
||||
import com.nextcloud.talk.data.database.model.SendStatus
|
||||
import com.nextcloud.talk.data.network.NetworkMonitor
|
||||
import com.nextcloud.talk.data.user.model.User
|
||||
import com.nextcloud.talk.extensions.toIntOrZero
|
||||
@ -214,7 +215,8 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
)
|
||||
}
|
||||
|
||||
sendTempChatMessages(credentials, urlForChatting)
|
||||
// this call could be deleted when we have a worker to send messages..
|
||||
sendUnsentChatMessages(credentials, urlForChatting)
|
||||
|
||||
// delay is a dirty workaround to make sure messages are added to adapter on initial load before dealing
|
||||
// with them (otherwise there is a race condition).
|
||||
@ -365,11 +367,18 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
lookIntoFuture: Boolean,
|
||||
showUnreadMessagesMarker: Boolean
|
||||
) {
|
||||
receivedChatMessages.forEach {
|
||||
Log.d(TAG, "receivedChatMessage: " + it.message)
|
||||
}
|
||||
|
||||
// remove all temp messages from UI
|
||||
val oldTempMessages = chatDao.getTempMessagesForConversation(internalConversationId)
|
||||
.first()
|
||||
.map(ChatMessageEntity::asModel)
|
||||
oldTempMessages.forEach { _removeMessageFlow.emit(it) }
|
||||
oldTempMessages.forEach {
|
||||
Log.d(TAG, "oldTempMessage to be removed from UI: " + it.message)
|
||||
_removeMessageFlow.emit(it)
|
||||
}
|
||||
|
||||
// add new messages to UI
|
||||
val tripleChatMessages = Triple(lookIntoFuture, showUnreadMessagesMarker, receivedChatMessages)
|
||||
@ -378,6 +387,9 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
// remove temp messages from DB that are now found in the new messages
|
||||
val chatMessagesReferenceIds = receivedChatMessages.mapTo(HashSet(receivedChatMessages.size)) { it.referenceId }
|
||||
val tempChatMessagesThatCanBeReplaced = oldTempMessages.filter { it.referenceId in chatMessagesReferenceIds }
|
||||
tempChatMessagesThatCanBeReplaced.forEach {
|
||||
Log.d(TAG, "oldTempMessage that was identified in newMessages: " + it.message)
|
||||
}
|
||||
chatDao.deleteTempChatMessages(
|
||||
internalConversationId,
|
||||
tempChatMessagesThatCanBeReplaced.map { it.referenceId!! }
|
||||
@ -389,6 +401,10 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
.sortedBy { it.internalId }
|
||||
.map(ChatMessageEntity::asModel)
|
||||
|
||||
remainingTempMessages.forEach {
|
||||
Log.d(TAG, "remainingTempMessage: " + it.message)
|
||||
}
|
||||
|
||||
val triple = Triple(true, false, remainingTempMessages)
|
||||
_messageFlow.emit(triple)
|
||||
}
|
||||
@ -843,6 +859,17 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
|
||||
val chatMessageModel = response.ocs?.data?.asModel()
|
||||
|
||||
val sentMessage = chatDao.getTempMessageForConversation(
|
||||
internalConversationId,
|
||||
referenceId
|
||||
).firstOrNull()
|
||||
|
||||
sentMessage?.let {
|
||||
it.sendStatus = SendStatus.SENT_PENDING_ACK
|
||||
chatDao.updateChatMessage(it)
|
||||
}
|
||||
|
||||
Log.d(TAG, "sending chat message succeeded: " + message)
|
||||
emit(Result.success(chatMessageModel))
|
||||
}
|
||||
.catch { e ->
|
||||
@ -853,7 +880,7 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
referenceId
|
||||
).firstOrNull()
|
||||
failedMessage?.let {
|
||||
it.sendingFailed = true
|
||||
it.sendStatus = SendStatus.FAILED
|
||||
chatDao.updateChatMessage(it)
|
||||
|
||||
val failedMessageModel = it.asModel()
|
||||
@ -873,22 +900,28 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
sendWithoutNotification: Boolean,
|
||||
referenceId: String
|
||||
): Flow<Result<ChatMessage?>> {
|
||||
val messageToResend = chatDao.getTempMessageForConversation(internalConversationId, referenceId).first()
|
||||
messageToResend.sendingFailed = false
|
||||
chatDao.updateChatMessage(messageToResend)
|
||||
val messageToResend = chatDao.getTempMessageForConversation(internalConversationId, referenceId).firstOrNull()
|
||||
return if (messageToResend != null) {
|
||||
messageToResend.sendStatus = SendStatus.PENDING
|
||||
chatDao.updateChatMessage(messageToResend)
|
||||
|
||||
val messageToResendModel = messageToResend.asModel()
|
||||
_updateMessageFlow.emit(messageToResendModel)
|
||||
val messageToResendModel = messageToResend.asModel()
|
||||
_updateMessageFlow.emit(messageToResendModel)
|
||||
|
||||
return sendChatMessage(
|
||||
credentials,
|
||||
url,
|
||||
message,
|
||||
displayName,
|
||||
replyTo,
|
||||
sendWithoutNotification,
|
||||
referenceId
|
||||
)
|
||||
sendChatMessage(
|
||||
credentials,
|
||||
url,
|
||||
message,
|
||||
displayName,
|
||||
replyTo,
|
||||
sendWithoutNotification,
|
||||
referenceId
|
||||
)
|
||||
} else {
|
||||
flow {
|
||||
emit(Result.failure(IllegalStateException("No temporary message found to resend")))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
@ -930,8 +963,8 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override suspend fun sendTempChatMessages(credentials: String, url: String) {
|
||||
val tempMessages = chatDao.getTempMessagesForConversation(internalConversationId).first()
|
||||
override suspend fun sendUnsentChatMessages(credentials: String, url: String) {
|
||||
val tempMessages = chatDao.getTempUnsentMessagesForConversation(internalConversationId).first()
|
||||
tempMessages.sortedBy { it.internalId }.onEach {
|
||||
sendChatMessage(
|
||||
credentials,
|
||||
@ -1025,7 +1058,7 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
actorDisplayName = currentUser.displayName!!,
|
||||
referenceId = referenceId,
|
||||
isTemporary = true,
|
||||
sendingFailed = false,
|
||||
sendStatus = SendStatus.PENDING,
|
||||
silent = sendWithoutNotification
|
||||
)
|
||||
return entity
|
||||
|
@ -217,4 +217,9 @@ class RetrofitChatNetwork(
|
||||
extractedLinkToPreview
|
||||
).blockingFirst().ocs?.data?.references?.entries?.iterator()?.next()?.value
|
||||
}
|
||||
|
||||
override suspend fun unbindRoom(credentials: String, baseUrl: String, roomToken: String): GenericOverall {
|
||||
val url = ApiUtils.getUrlForUnbindingRoom(baseUrl, roomToken)
|
||||
return ncApiCoroutines.unbindRoom(credentials, url)
|
||||
}
|
||||
}
|
||||
|
@ -146,6 +146,10 @@ class ChatViewModel @Inject constructor(
|
||||
val outOfOfficeViewState: LiveData<OutOfOfficeUIState>
|
||||
get() = _outOfOfficeViewState
|
||||
|
||||
private val _unbindRoomResult = MutableLiveData<UnbindRoomUiState>(UnbindRoomUiState.None)
|
||||
val unbindRoomResult: LiveData<UnbindRoomUiState>
|
||||
get() = _unbindRoomResult
|
||||
|
||||
private val _voiceMessagePlaybackSpeedPreferences: MutableLiveData<Map<String, PlaybackSpeed>> = MutableLiveData()
|
||||
val voiceMessagePlaybackSpeedPreferences: LiveData<Map<String, PlaybackSpeed>>
|
||||
get() = _voiceMessagePlaybackSpeedPreferences
|
||||
@ -800,6 +804,18 @@ class ChatViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
fun unbindRoom(credentials: String, baseUrl: String, roomToken: String) {
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
val response = chatNetworkDataSource.unbindRoom(credentials, baseUrl, roomToken)
|
||||
_unbindRoomResult.value = UnbindRoomUiState.Success(response.ocs?.meta?.statusCode!!)
|
||||
} catch (exception: Exception) {
|
||||
_unbindRoomResult.value = UnbindRoomUiState.Error(exception.message.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun resendMessage(credentials: String, urlForChat: String, message: ChatMessage) {
|
||||
viewModelScope.launch {
|
||||
chatRepository.resendChatMessage(
|
||||
@ -851,4 +867,10 @@ class ChatViewModel @Inject constructor(
|
||||
data class Success(val userAbsence: UserAbsenceData) : OutOfOfficeUIState()
|
||||
data class Error(val exception: Exception) : OutOfOfficeUIState()
|
||||
}
|
||||
|
||||
sealed class UnbindRoomUiState {
|
||||
data object None : UnbindRoomUiState()
|
||||
data class Success(val statusCode: Int) : UnbindRoomUiState()
|
||||
data class Error(val message: String) : UnbindRoomUiState()
|
||||
}
|
||||
}
|
||||
|
@ -169,9 +169,9 @@ class MessageInputViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun sendTempMessages(credentials: String, url: String) {
|
||||
fun sendUnsentMessages(credentials: String, url: String) {
|
||||
viewModelScope.launch {
|
||||
chatRepository.sendTempChatMessages(
|
||||
chatRepository.sendUnsentChatMessages(
|
||||
credentials,
|
||||
url
|
||||
)
|
||||
|
@ -1,7 +1,6 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2024 Sowjanya Kota <sowjanya.kch@gmail.com>
|
||||
* SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
@ -9,16 +8,41 @@
|
||||
package com.nextcloud.talk.components
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.statusBars
|
||||
import androidx.compose.foundation.layout.windowInsetsTopHeight
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.core.view.WindowCompat
|
||||
|
||||
@Composable
|
||||
fun SetupSystemBars() {
|
||||
fun ColoredStatusBar() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
||||
Box(modifier = Modifier.fillMaxSize()) {
|
||||
Box(
|
||||
Modifier
|
||||
.windowInsetsTopHeight(WindowInsets.statusBars)
|
||||
.fillMaxWidth()
|
||||
.background(MaterialTheme.colorScheme.surface)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
ColorLegacyStatusBar()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ColorLegacyStatusBar() {
|
||||
val view = LocalView.current
|
||||
val isDarkMode = isSystemInDarkTheme()
|
||||
val statusBarColor = MaterialTheme.colorScheme.surface.toArgb()
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2025 Your Name <your@email.com>
|
||||
* SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.components
|
||||
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.RowScope
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
|
||||
@Composable
|
||||
fun VerticallyCenteredRow(content: @Composable RowScope.() -> Unit) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxHeight(),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
content = content
|
||||
)
|
||||
}
|
@ -18,9 +18,9 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import autodagger.AutoInjector
|
||||
import com.nextcloud.talk.activities.BaseActivity
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication
|
||||
import com.nextcloud.talk.components.ColoredStatusBar
|
||||
import com.nextcloud.talk.contacts.CompanionClass.Companion.KEY_HIDE_ALREADY_EXISTING_PARTICIPANTS
|
||||
import com.nextcloud.talk.extensions.getParcelableArrayListExtraProvider
|
||||
import com.nextcloud.talk.components.SetupSystemBars
|
||||
import com.nextcloud.talk.models.json.autocomplete.AutocompleteUser
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys
|
||||
import javax.inject.Inject
|
||||
@ -64,11 +64,11 @@ class ContactsActivity : BaseActivity() {
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme
|
||||
) {
|
||||
ColoredStatusBar()
|
||||
ContactsScreen(
|
||||
contactsViewModel = contactsViewModel,
|
||||
uiState = uiState.value
|
||||
)
|
||||
SetupSystemBars()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,16 +11,18 @@ package com.nextcloud.talk.contacts
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.statusBarsPadding
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.contacts.components.AppBar
|
||||
import com.nextcloud.talk.contacts.components.ContactsAppBar
|
||||
import com.nextcloud.talk.contacts.components.ContactsList
|
||||
import com.nextcloud.talk.contacts.components.ContactsSearchAppBar
|
||||
import com.nextcloud.talk.contacts.components.ConversationCreationOptions
|
||||
|
||||
@Composable
|
||||
@ -29,33 +31,40 @@ fun ContactsScreen(contactsViewModel: ContactsViewModel, uiState: ContactsUiStat
|
||||
val isSearchActive by contactsViewModel.isSearchActive.collectAsStateWithLifecycle()
|
||||
val isAddParticipants by contactsViewModel.isAddParticipantsView.collectAsStateWithLifecycle()
|
||||
val autocompleteUsers by contactsViewModel.selectedParticipantsList.collectAsStateWithLifecycle()
|
||||
val enableAddButton by contactsViewModel.enableAddButton.collectAsStateWithLifecycle()
|
||||
|
||||
Scaffold(
|
||||
modifier = Modifier
|
||||
.statusBarsPadding(),
|
||||
topBar = {
|
||||
AppBar(
|
||||
title = stringResource(R.string.nc_app_product_name),
|
||||
searchQuery = searchQuery,
|
||||
isSearchActive = isSearchActive,
|
||||
isAddParticipants = isAddParticipants,
|
||||
autocompleteUsers = autocompleteUsers,
|
||||
onEnableSearch = {
|
||||
contactsViewModel.setSearchActive(true)
|
||||
},
|
||||
onDisableSearch = {
|
||||
contactsViewModel.setSearchActive(false)
|
||||
},
|
||||
onUpdateSearchQuery = {
|
||||
contactsViewModel.updateSearchQuery(query = it)
|
||||
},
|
||||
onUpdateAutocompleteUsers = {
|
||||
contactsViewModel.getContactsFromSearchParams()
|
||||
}
|
||||
)
|
||||
if (isSearchActive) {
|
||||
ContactsSearchAppBar(
|
||||
searchQuery = searchQuery,
|
||||
onTextChange = {
|
||||
contactsViewModel.updateSearchQuery(it)
|
||||
contactsViewModel.getContactsFromSearchParams()
|
||||
},
|
||||
onCloseSearch = {
|
||||
contactsViewModel.updateSearchQuery("")
|
||||
contactsViewModel.setSearchActive(false)
|
||||
contactsViewModel.getContactsFromSearchParams()
|
||||
},
|
||||
enableAddButton = enableAddButton,
|
||||
isAddParticipants = isAddParticipants,
|
||||
clickAddButton = { contactsViewModel.modifyClickAddButton(true) }
|
||||
)
|
||||
} else {
|
||||
ContactsAppBar(
|
||||
isAddParticipants = isAddParticipants,
|
||||
autocompleteUsers = autocompleteUsers,
|
||||
onStartSearch = { contactsViewModel.setSearchActive(true) }
|
||||
)
|
||||
}
|
||||
},
|
||||
content = {
|
||||
content = { paddingValues ->
|
||||
Column(
|
||||
Modifier
|
||||
.padding(it)
|
||||
.padding(0.dp, paddingValues.calculateTopPadding(), 0.dp, 0.dp)
|
||||
.background(colorResource(id = R.color.bg_default))
|
||||
) {
|
||||
if (!isAddParticipants) {
|
||||
|
@ -36,6 +36,15 @@ class ContactsViewModel @Inject constructor(
|
||||
private val _isAddParticipantsView = MutableStateFlow(false)
|
||||
val isAddParticipantsView: StateFlow<Boolean> = _isAddParticipantsView
|
||||
|
||||
private val _enableAddButton = MutableStateFlow(false)
|
||||
val enableAddButton: StateFlow<Boolean> = _enableAddButton
|
||||
|
||||
@Suppress("PropertyName")
|
||||
private val _selectedContacts = MutableStateFlow<List<AutocompleteUser>>(emptyList())
|
||||
|
||||
@Suppress("PropertyName")
|
||||
private val _clickAddButton = MutableStateFlow(false)
|
||||
|
||||
private var hideAlreadyAddedParticipants: Boolean = false
|
||||
|
||||
init {
|
||||
@ -46,14 +55,28 @@ class ContactsViewModel @Inject constructor(
|
||||
_searchQuery.value = query
|
||||
}
|
||||
|
||||
fun modifyClickAddButton(value: Boolean) {
|
||||
_clickAddButton.value = value
|
||||
}
|
||||
|
||||
fun selectContact(contact: AutocompleteUser) {
|
||||
val updatedParticipants = selectedParticipants.value + contact
|
||||
selectedParticipants.value = updatedParticipants
|
||||
_selectedContacts.value = _selectedContacts.value + contact
|
||||
}
|
||||
|
||||
fun updateAddButtonState() {
|
||||
if (_selectedContacts.value.isEmpty()) {
|
||||
_enableAddButton.value = false
|
||||
} else {
|
||||
_enableAddButton.value = true
|
||||
}
|
||||
}
|
||||
|
||||
fun deselectContact(contact: AutocompleteUser) {
|
||||
val updatedParticipants = selectedParticipants.value - contact
|
||||
selectedParticipants.value = updatedParticipants
|
||||
_selectedContacts.value = _selectedContacts.value - contact
|
||||
}
|
||||
|
||||
fun updateSelectedParticipants(participants: List<AutocompleteUser>) {
|
||||
@ -76,20 +99,23 @@ class ContactsViewModel @Inject constructor(
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
fun getContactsFromSearchParams() {
|
||||
fun getContactsFromSearchParams(query: String = "") {
|
||||
_contactsViewState.value = ContactsUiState.Loading
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
val contacts = repository.getContacts(
|
||||
searchQuery.value,
|
||||
if (query != "") query else searchQuery.value,
|
||||
shareTypeList
|
||||
)
|
||||
val contactsList: MutableList<AutocompleteUser>? = contacts.ocs!!.data?.toMutableList()
|
||||
|
||||
if (hideAlreadyAddedParticipants) {
|
||||
if (hideAlreadyAddedParticipants && !_clickAddButton.value) {
|
||||
contactsList?.removeAll(selectedParticipants.value)
|
||||
}
|
||||
|
||||
if (_clickAddButton.value) {
|
||||
contactsList?.removeAll(selectedParticipants.value)
|
||||
contactsList?.addAll(_selectedContacts.value)
|
||||
}
|
||||
_contactsViewState.value = ContactsUiState.Success(contactsList)
|
||||
} catch (exception: Exception) {
|
||||
_contactsViewState.value = ContactsUiState.Error(exception.message ?: "")
|
||||
|
@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2024 Sowjanya Kota <sowjanya.kch@gmail.com>
|
||||
* SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.contacts.components
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.Search
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.models.json.autocomplete.AutocompleteUser
|
||||
|
||||
@SuppressLint("UnrememberedMutableState")
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun AppBar(
|
||||
title: String,
|
||||
searchQuery: String,
|
||||
isSearchActive: Boolean,
|
||||
isAddParticipants: Boolean,
|
||||
autocompleteUsers: List<AutocompleteUser>,
|
||||
onEnableSearch: () -> Unit,
|
||||
onDisableSearch: () -> Unit,
|
||||
onUpdateSearchQuery: (String) -> Unit,
|
||||
onUpdateAutocompleteUsers: () -> Unit
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
|
||||
TopAppBar(
|
||||
title = { Text(text = title) },
|
||||
navigationIcon = {
|
||||
IconButton(onClick = {
|
||||
(context as? Activity)?.finish()
|
||||
}) {
|
||||
Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = stringResource(R.string.back_button))
|
||||
}
|
||||
},
|
||||
actions = {
|
||||
IconButton(onClick = onEnableSearch) {
|
||||
Icon(Icons.Filled.Search, contentDescription = stringResource(R.string.search_icon))
|
||||
}
|
||||
if (isAddParticipants) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.nc_contacts_done),
|
||||
modifier = Modifier.clickable {
|
||||
val resultIntent = Intent().apply {
|
||||
putParcelableArrayListExtra(
|
||||
"selectedParticipants",
|
||||
ArrayList(autocompleteUsers)
|
||||
)
|
||||
}
|
||||
(context as? Activity)?.setResult(Activity.RESULT_OK, resultIntent)
|
||||
(context as? Activity)?.finish()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
if (isSearchActive) {
|
||||
Row {
|
||||
SearchComponent(
|
||||
text = searchQuery,
|
||||
onTextChange = { searchQuery ->
|
||||
onUpdateSearchQuery(searchQuery)
|
||||
onUpdateAutocompleteUsers()
|
||||
},
|
||||
onDisableSearch = onDisableSearch
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
@ -65,8 +65,10 @@ fun ContactItemRow(contact: AutocompleteUser, contactsViewModel: ContactsViewMod
|
||||
isSelected = !isSelected
|
||||
if (isSelected) {
|
||||
contactsViewModel.selectContact(contact)
|
||||
contactsViewModel.updateAddButtonState()
|
||||
} else {
|
||||
contactsViewModel.deselectContact(contact)
|
||||
contactsViewModel.updateAddButtonState()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2024 Sowjanya Kota <sowjanya.kch@gmail.com>
|
||||
* SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.contacts.components
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.Search
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.components.VerticallyCenteredRow
|
||||
import com.nextcloud.talk.models.json.autocomplete.AutocompleteUser
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun ContactsAppBar(isAddParticipants: Boolean, autocompleteUsers: List<AutocompleteUser>, onStartSearch: () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
TopAppBar(
|
||||
modifier = Modifier
|
||||
.height(60.dp),
|
||||
title = {
|
||||
VerticallyCenteredRow {
|
||||
Text(
|
||||
text = if (isAddParticipants) {
|
||||
stringResource(R.string.nc_participants_add)
|
||||
} else {
|
||||
stringResource(R.string.nc_new_conversation)
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
navigationIcon = {
|
||||
VerticallyCenteredRow {
|
||||
IconButton(onClick = { (context as? Activity)?.finish() }) {
|
||||
Icon(Icons.AutoMirrored.Filled.ArrowBack, contentDescription = stringResource(R.string.back_button))
|
||||
}
|
||||
}
|
||||
},
|
||||
actions = {
|
||||
VerticallyCenteredRow {
|
||||
IconButton(onClick = onStartSearch) {
|
||||
Icon(Icons.Filled.Search, contentDescription = stringResource(R.string.search_icon))
|
||||
}
|
||||
if (isAddParticipants) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.nc_contacts_done),
|
||||
modifier = Modifier.clickable {
|
||||
val resultIntent = Intent().apply {
|
||||
putParcelableArrayListExtra("selectedParticipants", ArrayList(autocompleteUsers))
|
||||
}
|
||||
(context as? Activity)?.setResult(Activity.RESULT_OK, resultIntent)
|
||||
(context as? Activity)?.finish()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material3.HorizontalDivider
|
||||
@ -44,9 +43,13 @@ fun ContactsItem(contacts: List<AutocompleteUser>, contactsViewModel: ContactsVi
|
||||
}
|
||||
LazyColumn(
|
||||
modifier = Modifier
|
||||
.padding(8.dp)
|
||||
.fillMaxWidth(),
|
||||
contentPadding = PaddingValues(all = 10.dp),
|
||||
contentPadding = PaddingValues(
|
||||
top = 10.dp,
|
||||
bottom = 40.dp,
|
||||
start = 10.dp,
|
||||
end = 10.dp
|
||||
),
|
||||
verticalArrangement = Arrangement.spacedBy(10.dp)
|
||||
) {
|
||||
groupedContacts.forEach { (initial, contactsForInitial) ->
|
||||
|
@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2024 Sowjanya Kota <sowjanya.kch@gmail.com>
|
||||
* SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.contacts.components
|
||||
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.Close
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
import androidx.compose.material3.TextField
|
||||
import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
||||
import androidx.compose.ui.platform.SoftwareKeyboardController
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.input.ImeAction
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.components.VerticallyCenteredRow
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun ContactsSearchAppBar(
|
||||
searchQuery: String,
|
||||
onTextChange: (String) -> Unit,
|
||||
onCloseSearch: () -> Unit,
|
||||
enableAddButton: Boolean,
|
||||
isAddParticipants: Boolean,
|
||||
clickAddButton: (Boolean) -> Unit
|
||||
) {
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
|
||||
Surface(
|
||||
modifier = Modifier.height(60.dp)
|
||||
) {
|
||||
VerticallyCenteredRow {
|
||||
IconButton(
|
||||
modifier = Modifier.padding(start = 4.dp),
|
||||
onClick = onCloseSearch
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
||||
contentDescription = stringResource(R.string.back_button)
|
||||
)
|
||||
}
|
||||
|
||||
TextField(
|
||||
value = searchQuery,
|
||||
onValueChange = onTextChange,
|
||||
placeholder = { Text(text = stringResource(R.string.nc_search)) },
|
||||
singleLine = true,
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.padding(horizontal = 8.dp),
|
||||
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Search),
|
||||
keyboardActions = searchKeyboardActions(searchQuery, keyboardController),
|
||||
colors = searchTextFieldColors(),
|
||||
trailingIcon = {
|
||||
if (searchQuery.isNotEmpty()) {
|
||||
IconButton(onClick = { onTextChange("") }) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Close,
|
||||
contentDescription = stringResource(R.string.nc_search_clear)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
if (isAddParticipants) {
|
||||
TextButton(
|
||||
onClick = {
|
||||
onCloseSearch()
|
||||
clickAddButton(true)
|
||||
},
|
||||
enabled = enableAddButton
|
||||
) {
|
||||
Text(text = stringResource(R.string.add_participants))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun searchTextFieldColors() =
|
||||
TextFieldDefaults.colors(
|
||||
focusedIndicatorColor = Color.Transparent,
|
||||
unfocusedIndicatorColor = Color.Transparent,
|
||||
disabledIndicatorColor = Color.Transparent
|
||||
)
|
||||
|
||||
fun searchKeyboardActions(text: String, keyboardController: SoftwareKeyboardController?) =
|
||||
KeyboardActions(
|
||||
onSearch = {
|
||||
if (text.trim().isNotEmpty()) {
|
||||
keyboardController?.hide()
|
||||
}
|
||||
}
|
||||
)
|
@ -1,103 +0,0 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2025 Your Name <your@email.com>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.contacts.components
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.Close
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextField
|
||||
import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
|
||||
import androidx.compose.ui.platform.SoftwareKeyboardController
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.input.ImeAction
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.nextcloud.talk.R
|
||||
|
||||
@Composable
|
||||
fun SearchComponent(text: String, onTextChange: (String) -> Unit, onDisableSearch: () -> Unit) {
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
|
||||
TextField(
|
||||
modifier = Modifier
|
||||
.background(MaterialTheme.colorScheme.background)
|
||||
.fillMaxWidth()
|
||||
.height(60.dp),
|
||||
value = text,
|
||||
onValueChange = { onTextChange(it) },
|
||||
placeholder = { Text(text = stringResource(R.string.nc_search)) },
|
||||
textStyle = TextStyle(fontSize = 16.sp),
|
||||
singleLine = true,
|
||||
leadingIcon = { LeadingIcon(onTextChange, onDisableSearch) },
|
||||
trailingIcon = { TrailingIcon(text, onTextChange) },
|
||||
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Search),
|
||||
keyboardActions = searchKeyboardActions(text, keyboardController),
|
||||
colors = searchTextFieldColors(),
|
||||
maxLines = 1
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun searchTextFieldColors() =
|
||||
TextFieldDefaults.colors(
|
||||
focusedIndicatorColor = Color.Transparent,
|
||||
unfocusedIndicatorColor = Color.Transparent,
|
||||
disabledIndicatorColor = Color.Transparent
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun LeadingIcon(onTextChange: (String) -> Unit, onDisableSearch: () -> Unit) {
|
||||
IconButton(
|
||||
onClick = {
|
||||
onTextChange("")
|
||||
onDisableSearch()
|
||||
}
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.AutoMirrored.Default.ArrowBack,
|
||||
contentDescription = stringResource(R.string.back_button)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun TrailingIcon(text: String, onTextChange: (String) -> Unit) {
|
||||
if (text.isNotEmpty()) {
|
||||
IconButton(
|
||||
onClick = { onTextChange("") }
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Close,
|
||||
contentDescription = stringResource(R.string.close_icon)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun searchKeyboardActions(text: String, keyboardController: SoftwareKeyboardController?) =
|
||||
KeyboardActions(
|
||||
onSearch = {
|
||||
if (text.trim().isNotEmpty()) {
|
||||
keyboardController?.hide()
|
||||
}
|
||||
}
|
||||
)
|
@ -84,8 +84,8 @@ import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.activities.BaseActivity
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication
|
||||
import com.nextcloud.talk.chat.ChatActivity
|
||||
import com.nextcloud.talk.components.ColoredStatusBar
|
||||
import com.nextcloud.talk.contacts.ContactsActivity
|
||||
import com.nextcloud.talk.components.SetupSystemBars
|
||||
import com.nextcloud.talk.contacts.loadImage
|
||||
import com.nextcloud.talk.extensions.getParcelableArrayListExtraProvider
|
||||
import com.nextcloud.talk.models.json.autocomplete.AutocompleteUser
|
||||
@ -117,7 +117,6 @@ class ConversationCreationActivity : BaseActivity() {
|
||||
colorScheme = colorScheme
|
||||
) {
|
||||
ConversationCreationScreen(conversationCreationViewModel, context, pickImage)
|
||||
SetupSystemBars()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -172,6 +171,7 @@ fun ConversationCreationScreen(
|
||||
}
|
||||
)
|
||||
|
||||
ColoredStatusBar()
|
||||
Scaffold(
|
||||
topBar = {
|
||||
TopAppBar(
|
||||
@ -191,7 +191,7 @@ fun ConversationCreationScreen(
|
||||
content = { paddingValues ->
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.padding(paddingValues)
|
||||
.padding(0.dp, paddingValues.calculateTopPadding(), 0.dp, 0.dp)
|
||||
.background(colorResource(id = R.color.bg_default))
|
||||
.fillMaxSize()
|
||||
.verticalScroll(rememberScrollState())
|
||||
@ -289,7 +289,7 @@ fun UploadAvatar(
|
||||
}
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_mimetype_folder),
|
||||
painter = painterResource(id = R.drawable.ic_folder),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.size(24.dp)
|
||||
)
|
||||
|
@ -103,6 +103,11 @@ import io.reactivex.schedulers.Schedulers
|
||||
import kotlinx.coroutines.launch
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import java.time.Instant
|
||||
import java.time.ZoneOffset
|
||||
import java.time.ZonedDateTime
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.time.format.FormatStyle
|
||||
import java.util.Calendar
|
||||
import java.util.Collections
|
||||
import java.util.Locale
|
||||
@ -150,7 +155,7 @@ class ConversationInfoActivity :
|
||||
get() {
|
||||
if (!TextUtils.isEmpty(conversationToken)) {
|
||||
val data = Data.Builder()
|
||||
data.putString(BundleKeys.KEY_ROOM_TOKEN, conversationToken)
|
||||
data.putString(KEY_ROOM_TOKEN, conversationToken)
|
||||
data.putLong(BundleKeys.KEY_INTERNAL_USER_ID, conversationUser.id!!)
|
||||
return data.build()
|
||||
}
|
||||
@ -185,14 +190,14 @@ class ConversationInfoActivity :
|
||||
binding = ActivityConversationInfoBinding.inflate(layoutInflater)
|
||||
setupActionBar()
|
||||
setContentView(binding.root)
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
|
||||
viewModel =
|
||||
ViewModelProvider(this, viewModelFactory)[ConversationInfoViewModel::class.java]
|
||||
|
||||
conversationUser = currentUserProvider.currentUser.blockingGet()
|
||||
|
||||
conversationToken = intent.getStringExtra(BundleKeys.KEY_ROOM_TOKEN)!!
|
||||
conversationToken = intent.getStringExtra(KEY_ROOM_TOKEN)!!
|
||||
hasAvatarSpacing = intent.getBooleanExtra(BundleKeys.KEY_ROOM_ONE_TO_ONE, false)
|
||||
credentials = ApiUtils.getCredentials(conversationUser.username, conversationUser.token)!!
|
||||
}
|
||||
@ -245,8 +250,51 @@ class ConversationInfoActivity :
|
||||
initBanActorObserver()
|
||||
initConversationReadOnlyObserver()
|
||||
initClearChatHistoryObserver()
|
||||
initMarkConversationAsSensitiveObserver()
|
||||
initMarkConversationAsInsensitiveObserver()
|
||||
initMarkConversationAsImportantObserver()
|
||||
initMarkConversationAsUnimportantObserver()
|
||||
}
|
||||
|
||||
private fun initMarkConversationAsSensitiveObserver() {
|
||||
viewModel.markAsSensitiveResult.observe(this) { uiState ->
|
||||
when (uiState) {
|
||||
is ConversationInfoViewModel.MarkConversationAsSensitiveViewState.Success -> {
|
||||
Snackbar.make(
|
||||
binding.root,
|
||||
context.getString(R.string.nc_mark_conversation_as_sensitive),
|
||||
Snackbar.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
is ConversationInfoViewModel.MarkConversationAsSensitiveViewState.Error -> {
|
||||
Snackbar.make(binding.root, R.string.nc_common_error_sorry, Snackbar.LENGTH_LONG).show()
|
||||
Log.e(TAG, "failed to mark conversation as insensitive", uiState.exception)
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun initMarkConversationAsInsensitiveObserver() {
|
||||
viewModel.markAsInsensitiveResult.observe(this) { uiState ->
|
||||
when (uiState) {
|
||||
is ConversationInfoViewModel.MarkConversationAsInsensitiveViewState.Success -> {
|
||||
Snackbar.make(
|
||||
binding.root,
|
||||
context.getString(R.string.nc_mark_conversation_as_insensitive),
|
||||
Snackbar.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
is ConversationInfoViewModel.MarkConversationAsInsensitiveViewState.Error -> {
|
||||
Snackbar.make(binding.root, R.string.nc_common_error_sorry, Snackbar.LENGTH_LONG).show()
|
||||
Log.e(TAG, "failed to mark conversation as sensitive", uiState.exception)
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private fun initClearChatHistoryObserver() {
|
||||
viewModel.clearChatHistoryViewState.observe(this) { uiState ->
|
||||
when (uiState) {
|
||||
@ -335,6 +383,47 @@ class ConversationInfoActivity :
|
||||
}
|
||||
}
|
||||
|
||||
private fun initMarkConversationAsImportantObserver() {
|
||||
viewModel.markAsImportantResult.observe(this) { uiState ->
|
||||
when (uiState) {
|
||||
is ConversationInfoViewModel.MarkConversationAsImportantViewState.Success -> {
|
||||
Snackbar.make(
|
||||
binding.root,
|
||||
context.getString(R.string.nc_mark_conversation_as_important),
|
||||
Snackbar.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
is ConversationInfoViewModel.MarkConversationAsImportantViewState.Error -> {
|
||||
Snackbar.make(binding.root, R.string.nc_common_error_sorry, Snackbar.LENGTH_LONG).show()
|
||||
Log.e(TAG, "failed to mark conversation as important", uiState.exception)
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun initMarkConversationAsUnimportantObserver() {
|
||||
viewModel.markAsUnimportantResult.observe(this) { uiState ->
|
||||
when (uiState) {
|
||||
is ConversationInfoViewModel.MarkConversationAsUnimportantViewState.Success -> {
|
||||
Snackbar.make(
|
||||
binding.root,
|
||||
context.getString(R.string.nc_mark_conversation_as_unimportant),
|
||||
Snackbar.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
is ConversationInfoViewModel.MarkConversationAsUnimportantViewState.Error -> {
|
||||
Snackbar.make(binding.root, R.string.nc_common_error_sorry, Snackbar.LENGTH_LONG).show()
|
||||
Log.e(TAG, "failed to mark conversation as unimportant", uiState.exception)
|
||||
}
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
private fun initViewStateObserver() {
|
||||
viewModel.viewState.observe(this) { state ->
|
||||
when (state) {
|
||||
@ -354,6 +443,12 @@ class ConversationInfoActivity :
|
||||
canGeneratePrettyURL
|
||||
)
|
||||
}
|
||||
|
||||
conversation?.let {
|
||||
if (it.type == ConversationEnums.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) {
|
||||
viewModel.getProfileData(conversationUser, it.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
is ConversationInfoViewModel.GetRoomErrorState -> {
|
||||
@ -363,6 +458,57 @@ class ConversationInfoActivity :
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.getProfileViewState.observe(this) { state ->
|
||||
when (state) {
|
||||
is ConversationInfoViewModel.GetProfileSuccessState -> {
|
||||
try {
|
||||
// Pronouns
|
||||
val profile = state.profile
|
||||
val pronouns = profile.pronouns ?: ""
|
||||
binding.pronouns.text = pronouns
|
||||
|
||||
// Role @ Organization
|
||||
val concat1 = if (profile.role != null && profile.company != null) " @ " else ""
|
||||
val role = profile.role ?: ""
|
||||
val company = profile.company ?: ""
|
||||
val professionCompanyText = "$role$concat1$company"
|
||||
binding.professionCompany.text = professionCompanyText
|
||||
|
||||
// Local Time: xX:xX · Address
|
||||
val profileZoneOffset = ZoneOffset.ofTotalSeconds(0)
|
||||
val secondsToAdd = profile.timezoneOffset?.toLong() ?: 0
|
||||
val localTime = ZonedDateTime.ofInstant(
|
||||
Instant.now().plusSeconds(secondsToAdd),
|
||||
profileZoneOffset
|
||||
)
|
||||
val localTimeString = localTime.format(
|
||||
DateTimeFormatter
|
||||
.ofLocalizedTime(FormatStyle.SHORT)
|
||||
.withLocale(Locale.getDefault())
|
||||
)
|
||||
val concat2 = if (profile.address != null) " · " else ""
|
||||
val address = profile.address ?: ""
|
||||
val localTimeLocation = "$localTimeString$concat2$address"
|
||||
binding.locationTime.text = resources.getString(R.string.local_time, localTimeLocation)
|
||||
|
||||
binding.pronouns.visibility = VISIBLE
|
||||
binding.professionCompany.visibility = if (professionCompanyText.isNotEmpty()) VISIBLE else GONE
|
||||
binding.locationTime.visibility = VISIBLE
|
||||
} catch (e: Exception) {
|
||||
Log.e(TAG, "Exception getting profile information", e)
|
||||
Snackbar.make(binding.root, R.string.nc_common_error_sorry, Snackbar.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
is ConversationInfoViewModel.GetProfileErrorState -> {
|
||||
Log.e(TAG, "Network error occurred getting profile information")
|
||||
Snackbar.make(binding.root, R.string.nc_common_error_sorry, Snackbar.LENGTH_LONG).show()
|
||||
}
|
||||
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupActionBar() {
|
||||
@ -404,7 +550,7 @@ class ConversationInfoActivity :
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
if (item.itemId == R.id.edit) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(BundleKeys.KEY_ROOM_TOKEN, conversationToken)
|
||||
bundle.putString(KEY_ROOM_TOKEN, conversationToken)
|
||||
|
||||
val intent = Intent(this, ConversationInfoEditActivity::class.java)
|
||||
intent.putExtras(bundle)
|
||||
@ -421,7 +567,9 @@ class ConversationInfoActivity :
|
||||
binding.notificationSettingsView.importantConversationSwitch,
|
||||
binding.guestAccessView.allowGuestsSwitch,
|
||||
binding.guestAccessView.passwordProtectionSwitch,
|
||||
binding.recordingConsentView.recordingConsentForConversationSwitch
|
||||
binding.recordingConsentView.recordingConsentForConversationSwitch,
|
||||
binding.lockConversationSwitch,
|
||||
binding.notificationSettingsView.sensitiveConversationSwitch
|
||||
).forEach(viewThemeUtils.talk::colorSwitch)
|
||||
}
|
||||
}
|
||||
@ -445,7 +593,7 @@ class ConversationInfoActivity :
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
|
||||
intent.putExtra(BundleKeys.KEY_CONVERSATION_NAME, conversation?.displayName)
|
||||
intent.putExtra(BundleKeys.KEY_ROOM_TOKEN, conversationToken)
|
||||
intent.putExtra(KEY_ROOM_TOKEN, conversationToken)
|
||||
intent.putExtra(
|
||||
SharedItemsActivity.KEY_USER_IS_OWNER_OR_MODERATOR,
|
||||
ConversationUtils.isParticipantOwnerOrModerator(conversation!!)
|
||||
@ -538,7 +686,7 @@ class ConversationInfoActivity :
|
||||
) {
|
||||
binding.webinarInfoView.startTimeButtonSummary.text = (
|
||||
dateUtils.getLocalDateTimeStringFromTimestamp(
|
||||
conversation!!.lobbyTimer!! * DateConstants.SECOND_DIVIDER
|
||||
conversation!!.lobbyTimer * DateConstants.SECOND_DIVIDER
|
||||
)
|
||||
)
|
||||
} else {
|
||||
@ -734,16 +882,13 @@ class ConversationInfoActivity :
|
||||
private fun selectParticipantsToAdd() {
|
||||
val bundle = Bundle()
|
||||
val existingParticipants = ArrayList<AutocompleteUser>()
|
||||
|
||||
for (userItem in userItems) {
|
||||
if (userItem.model.calculatedActorType == USERS) {
|
||||
val user = AutocompleteUser(
|
||||
userItem.model.calculatedActorId!!,
|
||||
userItem.model.displayName,
|
||||
userItem.model.calculatedActorType.name.lowercase()
|
||||
)
|
||||
existingParticipants.add(user)
|
||||
}
|
||||
val user = AutocompleteUser(
|
||||
userItem.model.calculatedActorId!!,
|
||||
userItem.model.displayName,
|
||||
userItem.model.calculatedActorType.name.lowercase()
|
||||
)
|
||||
existingParticipants.add(user)
|
||||
}
|
||||
|
||||
bundle.putBoolean(BundleKeys.KEY_ADD_PARTICIPANTS, true)
|
||||
@ -920,21 +1065,13 @@ class ConversationInfoActivity :
|
||||
) {
|
||||
binding.addParticipantsAction.visibility = GONE
|
||||
binding.startGroupChat.visibility = VISIBLE
|
||||
showDeleteAllMessagesOption(conversationCopy)
|
||||
} else if (ConversationUtils.canModerate(conversationCopy, spreedCapabilities)) {
|
||||
binding.addParticipantsAction.visibility = VISIBLE
|
||||
if (hasSpreedFeatureCapability(
|
||||
spreedCapabilities,
|
||||
SpreedFeatures.CLEAR_HISTORY
|
||||
) && conversationCopy.canDeleteConversation
|
||||
) {
|
||||
binding.clearConversationHistory.visibility = VISIBLE
|
||||
} else {
|
||||
binding.clearConversationHistory.visibility = GONE
|
||||
}
|
||||
showDeleteAllMessagesOption(conversationCopy)
|
||||
showOptionsMenu()
|
||||
} else {
|
||||
binding.addParticipantsAction.visibility = GONE
|
||||
|
||||
if (ConversationUtils.isNoteToSelfConversation(conversation)) {
|
||||
binding.notificationSettingsView.notificationSettings.visibility = VISIBLE
|
||||
} else {
|
||||
@ -942,6 +1079,31 @@ class ConversationInfoActivity :
|
||||
}
|
||||
}
|
||||
|
||||
binding.notificationSettingsView.importantConversationSwitch.isChecked = conversation!!.hasImportant
|
||||
|
||||
binding.notificationSettingsView.notificationSettingsImportantConversation.setOnClickListener {
|
||||
val isChecked = binding.notificationSettingsView.importantConversationSwitch.isChecked
|
||||
binding.notificationSettingsView.importantConversationSwitch.isChecked = !isChecked
|
||||
if (!isChecked) {
|
||||
viewModel.markConversationAsImportant(
|
||||
credentials,
|
||||
conversationUser.baseUrl!!,
|
||||
conversation?.token!!
|
||||
)
|
||||
} else {
|
||||
viewModel.markConversationAsUnimportant(
|
||||
credentials,
|
||||
conversationUser.baseUrl!!,
|
||||
conversation?.token!!
|
||||
)
|
||||
}
|
||||
}
|
||||
if (hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.IMPORTANT_CONVERSATIONS)) {
|
||||
binding.notificationSettingsView.notificationSettingsImportantConversation.visibility = VISIBLE
|
||||
} else {
|
||||
binding.notificationSettingsView.notificationSettingsImportantConversation.visibility = GONE
|
||||
}
|
||||
|
||||
if (!hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.ARCHIVE_CONVERSATIONS)) {
|
||||
binding.archiveConversationBtn.visibility = GONE
|
||||
binding.archiveConversationTextHint.visibility = GONE
|
||||
@ -977,6 +1139,31 @@ class ConversationInfoActivity :
|
||||
binding.archiveConversationText.text = resources.getString(R.string.archive_conversation)
|
||||
binding.archiveConversationTextHint.text = resources.getString(R.string.archive_hint)
|
||||
}
|
||||
|
||||
binding.notificationSettingsView.sensitiveConversationSwitch.isChecked = conversation!!.hasSensitive
|
||||
|
||||
binding.notificationSettingsView.notificationSettingsSensitiveConversation.setOnClickListener {
|
||||
val isChecked = !binding.notificationSettingsView.sensitiveConversationSwitch.isChecked
|
||||
binding.notificationSettingsView.sensitiveConversationSwitch.isChecked = isChecked
|
||||
if (isChecked) {
|
||||
viewModel.markConversationAsSensitive(
|
||||
credentials,
|
||||
conversationUser.baseUrl!!,
|
||||
conversation?.token!!
|
||||
)
|
||||
} else {
|
||||
viewModel.markConversationAsInsensitive(
|
||||
credentials,
|
||||
conversationUser.baseUrl!!,
|
||||
conversation?.token!!
|
||||
)
|
||||
}
|
||||
}
|
||||
if (hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.SENSITIVE_CONVERSATIONS)) {
|
||||
binding.notificationSettingsView.notificationSettingsSensitiveConversation.visibility = VISIBLE
|
||||
} else {
|
||||
binding.notificationSettingsView.notificationSettingsSensitiveConversation.visibility = GONE
|
||||
}
|
||||
if (ConversationUtils.isConversationReadOnlyAvailable(conversationCopy, spreedCapabilities)) {
|
||||
binding.lockConversation.visibility = VISIBLE
|
||||
binding.lockConversationSwitch.isChecked = databaseStorageModule!!.getBoolean("lock_switch", false)
|
||||
@ -1039,7 +1226,7 @@ class ConversationInfoActivity :
|
||||
|
||||
binding.displayNameText.text = conversation!!.displayName
|
||||
|
||||
if (conversation!!.description != null && conversation!!.description!!.isNotEmpty()) {
|
||||
if (conversation!!.description != null && conversation!!.description.isNotEmpty()) {
|
||||
binding.descriptionText.text = conversation!!.description
|
||||
binding.conversationDescription.visibility = VISIBLE
|
||||
}
|
||||
@ -1116,6 +1303,18 @@ class ConversationInfoActivity :
|
||||
}
|
||||
}
|
||||
|
||||
fun showDeleteAllMessagesOption(conversationCopy: ConversationModel) {
|
||||
if (hasSpreedFeatureCapability(
|
||||
spreedCapabilities,
|
||||
SpreedFeatures.CLEAR_HISTORY
|
||||
) && conversationCopy.canDeleteConversation
|
||||
) {
|
||||
binding.clearConversationHistory.visibility = VISIBLE
|
||||
} else {
|
||||
binding.clearConversationHistory.visibility = GONE
|
||||
}
|
||||
}
|
||||
|
||||
private fun submitRecordingConsentChanges() {
|
||||
val state = if (binding.recordingConsentView.recordingConsentForConversationSwitch.isChecked) {
|
||||
RECORDING_CONSENT_REQUIRED_FOR_CONVERSATION
|
||||
@ -1185,7 +1384,7 @@ class ConversationInfoActivity :
|
||||
val stringValue: String =
|
||||
when (
|
||||
DomainEnumNotificationLevelConverter()
|
||||
.convertToInt(conversation!!.notificationLevel!!)
|
||||
.convertToInt(conversation!!.notificationLevel)
|
||||
) {
|
||||
NOTIFICATION_LEVEL_ALWAYS -> resources.getString(R.string.nc_notify_me_always)
|
||||
NOTIFICATION_LEVEL_MENTION -> resources.getString(R.string.nc_notify_me_mention)
|
||||
@ -1234,7 +1433,7 @@ class ConversationInfoActivity :
|
||||
conversation!!.name
|
||||
)
|
||||
) {
|
||||
conversation!!.name?.let {
|
||||
conversation!!.name.let {
|
||||
binding.avatarImage.loadUserAvatar(
|
||||
conversationUser,
|
||||
it,
|
||||
@ -1648,13 +1847,6 @@ class ConversationInfoActivity :
|
||||
}
|
||||
|
||||
private fun setUpNotificationSettings(module: DatabaseStorageModule) {
|
||||
binding.notificationSettingsView.notificationSettingsImportantConversation.setOnClickListener {
|
||||
val isChecked = binding.notificationSettingsView.importantConversationSwitch.isChecked
|
||||
binding.notificationSettingsView.importantConversationSwitch.isChecked = !isChecked
|
||||
lifecycleScope.launch {
|
||||
module.saveBoolean("important_conversation_switch", !isChecked)
|
||||
}
|
||||
}
|
||||
binding.notificationSettingsView.notificationSettingsCallNotifications.setOnClickListener {
|
||||
val isChecked = binding.notificationSettingsView.callNotificationsSwitch.isChecked
|
||||
binding.notificationSettingsView.callNotificationsSwitch.isChecked = !isChecked
|
||||
@ -1662,6 +1854,7 @@ class ConversationInfoActivity :
|
||||
module.saveBoolean("call_notifications_switch", !isChecked)
|
||||
}
|
||||
}
|
||||
|
||||
binding.notificationSettingsView.conversationInfoMessageNotificationsDropdown
|
||||
.setOnItemClickListener { _, _, position, _ ->
|
||||
val value = resources.getStringArray(R.array.message_notification_levels_entry_values)[position]
|
||||
@ -1671,9 +1864,6 @@ class ConversationInfoActivity :
|
||||
}
|
||||
}
|
||||
|
||||
binding.notificationSettingsView.importantConversationSwitch.isChecked = module
|
||||
.getBoolean("important_conversation_switch", false)
|
||||
|
||||
if (conversation!!.remoteServer.isNullOrEmpty()) {
|
||||
binding.notificationSettingsView.notificationSettingsCallNotifications.visibility = VISIBLE
|
||||
binding.notificationSettingsView.callNotificationsSwitch.isChecked = module
|
||||
|
@ -28,6 +28,7 @@ import com.nextcloud.talk.models.json.participants.Participant.ActorType.EMAILS
|
||||
import com.nextcloud.talk.models.json.participants.Participant.ActorType.FEDERATED
|
||||
import com.nextcloud.talk.models.json.participants.Participant.ActorType.GROUPS
|
||||
import com.nextcloud.talk.models.json.participants.TalkBan
|
||||
import com.nextcloud.talk.models.json.profile.Profile
|
||||
import com.nextcloud.talk.repositories.conversations.ConversationsRepository
|
||||
import com.nextcloud.talk.utils.ApiUtils
|
||||
import com.nextcloud.talk.utils.ApiUtils.getUrlForRooms
|
||||
@ -123,10 +124,40 @@ class ConversationInfoViewModel @Inject constructor(
|
||||
val getConversationReadOnlyState: LiveData<SetConversationReadOnlyViewState>
|
||||
get() = _getConversationReadOnlyState
|
||||
|
||||
@Suppress("PropertyName")
|
||||
private val _markConversationAsImportantResult =
|
||||
MutableLiveData<MarkConversationAsImportantViewState>(MarkConversationAsImportantViewState.None)
|
||||
val markAsImportantResult: LiveData<MarkConversationAsImportantViewState>
|
||||
get() = _markConversationAsImportantResult
|
||||
|
||||
@Suppress("PropertyName")
|
||||
private val _markConversationAsUnimportantResult =
|
||||
MutableLiveData<MarkConversationAsUnimportantViewState>(MarkConversationAsUnimportantViewState.None)
|
||||
val markAsUnimportantResult: LiveData<MarkConversationAsUnimportantViewState>
|
||||
get() = _markConversationAsUnimportantResult
|
||||
|
||||
private val _createRoomViewState = MutableLiveData<CreateRoomUIState>(CreateRoomUIState.None)
|
||||
val createRoomViewState: LiveData<CreateRoomUIState>
|
||||
get() = _createRoomViewState
|
||||
|
||||
object GetProfileErrorState : ViewState
|
||||
class GetProfileSuccessState(val profile: Profile) : ViewState
|
||||
private val _getProfileViewState = MutableLiveData<ViewState>()
|
||||
val getProfileViewState: LiveData<ViewState>
|
||||
get() = _getProfileViewState
|
||||
|
||||
@Suppress("PropertyName")
|
||||
private val _markConversationAsSensitiveResult =
|
||||
MutableLiveData<MarkConversationAsSensitiveViewState>(MarkConversationAsSensitiveViewState.None)
|
||||
val markAsSensitiveResult: LiveData<MarkConversationAsSensitiveViewState>
|
||||
get() = _markConversationAsSensitiveResult
|
||||
|
||||
@Suppress("PropertyName")
|
||||
private val _markConversationAsInsensitiveResult =
|
||||
MutableLiveData<MarkConversationAsInsensitiveViewState>(MarkConversationAsInsensitiveViewState.None)
|
||||
val markAsInsensitiveResult: LiveData<MarkConversationAsInsensitiveViewState>
|
||||
get() = _markConversationAsInsensitiveResult
|
||||
|
||||
fun getRoom(user: User, token: String) {
|
||||
_viewState.value = GetRoomStartState
|
||||
chatNetworkDataSource.getRoom(user, token)
|
||||
@ -288,6 +319,23 @@ class ConversationInfoViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
fun getProfileData(user: User, userId: String) {
|
||||
val url = ApiUtils.getUrlForProfile(user.baseUrl!!, userId)
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
val profile = conversationsRepository.getProfile(user.getCredentials(), url)
|
||||
if (profile != null) {
|
||||
_getProfileViewState.value = GetProfileSuccessState(profile)
|
||||
} else {
|
||||
_getProfileViewState.value = GetProfileErrorState
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "Failed to get profile data (if not supported there wil be http405)", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
fun allowGuests(token: String, allow: Boolean) {
|
||||
viewModelScope.launch {
|
||||
@ -325,6 +373,34 @@ class ConversationInfoViewModel @Inject constructor(
|
||||
conversationsRepository.unarchiveConversation(user.getCredentials(), url)
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
fun markConversationAsImportant(credentials: String, baseUrl: String, roomToken: String) {
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
val response = conversationsRepository.markConversationAsImportant(credentials, baseUrl, roomToken)
|
||||
_markConversationAsImportantResult.value =
|
||||
MarkConversationAsImportantViewState.Success(response.ocs?.meta?.statusCode!!)
|
||||
} catch (exception: Exception) {
|
||||
_markConversationAsImportantResult.value =
|
||||
MarkConversationAsImportantViewState.Error(exception)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
fun markConversationAsUnimportant(credentials: String, baseUrl: String, roomToken: String) {
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
val response = conversationsRepository.markConversationAsUnImportant(credentials, baseUrl, roomToken)
|
||||
_markConversationAsUnimportantResult.value =
|
||||
MarkConversationAsUnimportantViewState.Success(response.ocs?.meta?.statusCode!!)
|
||||
} catch (exception: Exception) {
|
||||
_markConversationAsUnimportantResult.value =
|
||||
MarkConversationAsUnimportantViewState.Error(exception)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
fun clearChatHistory(apiVersion: Int, roomToken: String) {
|
||||
viewModelScope.launch {
|
||||
@ -337,6 +413,34 @@ class ConversationInfoViewModel @Inject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
fun markConversationAsSensitive(credentials: String, baseUrl: String, roomToken: String) {
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
val response = conversationsRepository.markConversationAsSensitive(credentials, baseUrl, roomToken)
|
||||
_markConversationAsSensitiveResult.value =
|
||||
MarkConversationAsSensitiveViewState.Success(response.ocs?.meta?.statusCode!!)
|
||||
} catch (exception: Exception) {
|
||||
_markConversationAsSensitiveResult.value =
|
||||
MarkConversationAsSensitiveViewState.Error(exception)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
fun markConversationAsInsensitive(credentials: String, baseUrl: String, roomToken: String) {
|
||||
viewModelScope.launch {
|
||||
try {
|
||||
val response = conversationsRepository.markConversationAsInsensitive(credentials, baseUrl, roomToken)
|
||||
_markConversationAsInsensitiveResult.value =
|
||||
MarkConversationAsInsensitiveViewState.Success(response.ocs?.meta?.statusCode!!)
|
||||
} catch (exception: Exception) {
|
||||
_markConversationAsInsensitiveResult.value =
|
||||
MarkConversationAsInsensitiveViewState.Error(exception)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inner class GetRoomObserver : Observer<ConversationModel> {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
// unused atm
|
||||
@ -386,6 +490,18 @@ class ConversationInfoViewModel @Inject constructor(
|
||||
data class Error(val exception: Exception) : ClearChatHistoryViewState()
|
||||
}
|
||||
|
||||
sealed class MarkConversationAsSensitiveViewState {
|
||||
data object None : MarkConversationAsSensitiveViewState()
|
||||
data class Success(val statusCode: Int) : MarkConversationAsSensitiveViewState()
|
||||
data class Error(val exception: Exception) : MarkConversationAsSensitiveViewState()
|
||||
}
|
||||
|
||||
sealed class MarkConversationAsInsensitiveViewState {
|
||||
data object None : MarkConversationAsInsensitiveViewState()
|
||||
data class Success(val statusCode: Int) : MarkConversationAsInsensitiveViewState()
|
||||
data class Error(val exception: Exception) : MarkConversationAsInsensitiveViewState()
|
||||
}
|
||||
|
||||
sealed class SetConversationReadOnlyViewState {
|
||||
data object None : SetConversationReadOnlyViewState()
|
||||
data object Success : SetConversationReadOnlyViewState()
|
||||
@ -409,4 +525,16 @@ class ConversationInfoViewModel @Inject constructor(
|
||||
data object Success : PasswordUiState()
|
||||
data class Error(val exception: Exception) : PasswordUiState()
|
||||
}
|
||||
|
||||
sealed class MarkConversationAsImportantViewState {
|
||||
data object None : MarkConversationAsImportantViewState()
|
||||
data class Success(val statusCode: Int) : MarkConversationAsImportantViewState()
|
||||
data class Error(val exception: Exception) : MarkConversationAsImportantViewState()
|
||||
}
|
||||
|
||||
sealed class MarkConversationAsUnimportantViewState {
|
||||
data object None : MarkConversationAsUnimportantViewState()
|
||||
data class Success(val statusCode: Int) : MarkConversationAsUnimportantViewState()
|
||||
data class Error(val exception: Exception) : MarkConversationAsUnimportantViewState()
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ class ConversationInfoEditActivity : BaseActivity() {
|
||||
binding = ActivityConversationInfoEditBinding.inflate(layoutInflater)
|
||||
setupActionBar()
|
||||
setContentView(binding.root)
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
|
||||
val extras: Bundle? = intent.extras
|
||||
|
||||
|
@ -16,7 +16,6 @@ import android.animation.AnimatorInflater
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.SearchManager
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.graphics.drawable.Drawable
|
||||
@ -41,9 +40,12 @@ import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.widget.SearchView
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.ui.platform.ViewCompositionStrategy
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.core.content.pm.ShortcutInfoCompat
|
||||
import androidx.core.content.pm.ShortcutManagerCompat
|
||||
import androidx.core.graphics.drawable.IconCompat
|
||||
import androidx.core.graphics.drawable.toDrawable
|
||||
import androidx.core.net.toUri
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.core.view.MenuItemCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.fragment.app.DialogFragment
|
||||
@ -79,6 +81,7 @@ import com.nextcloud.talk.adapters.items.GenericTextHeaderItem
|
||||
import com.nextcloud.talk.adapters.items.LoadMoreResultsItem
|
||||
import com.nextcloud.talk.adapters.items.MessageResultItem
|
||||
import com.nextcloud.talk.adapters.items.MessagesTextHeaderItem
|
||||
import com.nextcloud.talk.adapters.items.SpacerItem
|
||||
import com.nextcloud.talk.api.NcApi
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication
|
||||
import com.nextcloud.talk.arbitrarystorage.ArbitraryStorageManager
|
||||
@ -114,6 +117,9 @@ import com.nextcloud.talk.ui.dialog.ChooseAccountShareToDialogFragment
|
||||
import com.nextcloud.talk.ui.dialog.ContextChatCompose
|
||||
import com.nextcloud.talk.ui.dialog.ConversationsListBottomDialog
|
||||
import com.nextcloud.talk.ui.dialog.FilterConversationFragment
|
||||
import com.nextcloud.talk.ui.dialog.FilterConversationFragment.Companion.ARCHIVE
|
||||
import com.nextcloud.talk.ui.dialog.FilterConversationFragment.Companion.MENTION
|
||||
import com.nextcloud.talk.ui.dialog.FilterConversationFragment.Companion.UNREAD
|
||||
import com.nextcloud.talk.users.UserManager
|
||||
import com.nextcloud.talk.utils.ApiUtils
|
||||
import com.nextcloud.talk.utils.BrandingUtils
|
||||
@ -208,7 +214,7 @@ class ConversationsListActivity :
|
||||
private var adapter: FlexibleAdapter<AbstractFlexibleItem<*>>? = null
|
||||
private var conversationItems: MutableList<AbstractFlexibleItem<*>> = ArrayList()
|
||||
private var conversationItemsWithHeader: MutableList<AbstractFlexibleItem<*>> = ArrayList()
|
||||
private val searchableConversationItems: MutableList<AbstractFlexibleItem<*>> = ArrayList()
|
||||
private var searchableConversationItems: MutableList<AbstractFlexibleItem<*>> = ArrayList()
|
||||
private var filterableConversationItems: MutableList<AbstractFlexibleItem<*>> = ArrayList()
|
||||
private var nearFutureEventConversationItems: MutableList<AbstractFlexibleItem<*>> = ArrayList()
|
||||
private var searchItem: MenuItem? = null
|
||||
@ -232,9 +238,9 @@ class ConversationsListActivity :
|
||||
private var searchViewDisposable: Disposable? = null
|
||||
private var filterState =
|
||||
mutableMapOf(
|
||||
FilterConversationFragment.MENTION to false,
|
||||
FilterConversationFragment.UNREAD to false,
|
||||
FilterConversationFragment.ARCHIVE to false,
|
||||
MENTION to false,
|
||||
UNREAD to false,
|
||||
ARCHIVE to false,
|
||||
FilterConversationFragment.DEFAULT to true
|
||||
)
|
||||
val searchBehaviorSubject = BehaviorSubject.createDefault(false)
|
||||
@ -261,7 +267,7 @@ class ConversationsListActivity :
|
||||
binding = ActivityConversationsBinding.inflate(layoutInflater)
|
||||
setupActionBar()
|
||||
setContentView(binding.root)
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
viewThemeUtils.material.themeCardView(binding.searchToolbar)
|
||||
viewThemeUtils.material.themeSearchBarText(binding.searchText)
|
||||
|
||||
@ -288,14 +294,13 @@ class ConversationsListActivity :
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
// actionBar?.show()
|
||||
if (adapter == null) {
|
||||
adapter = FlexibleAdapter(conversationItems, this, true)
|
||||
addEmptyItemForEdgeToEdgeIfNecessary()
|
||||
} else {
|
||||
binding.loadingContent.visibility = View.GONE
|
||||
}
|
||||
adapter!!.addListener(this)
|
||||
adapter?.addListener(this)
|
||||
prepareViews()
|
||||
|
||||
showNotificationWarning()
|
||||
@ -311,8 +316,10 @@ class ConversationsListActivity :
|
||||
showServerEOLDialog()
|
||||
return
|
||||
}
|
||||
if (isUnifiedSearchAvailable(currentUser!!.capabilities!!.spreedCapability!!)) {
|
||||
searchHelper = MessageSearchHelper(unifiedSearchRepository)
|
||||
currentUser?.capabilities?.spreedCapability?.let { spreedCapabilities ->
|
||||
if (isUnifiedSearchAvailable(spreedCapabilities)) {
|
||||
searchHelper = MessageSearchHelper(unifiedSearchRepository)
|
||||
}
|
||||
}
|
||||
credentials = ApiUtils.getCredentials(currentUser!!.username, currentUser!!.token)
|
||||
|
||||
@ -337,6 +344,14 @@ class ConversationsListActivity :
|
||||
showSearchOrToolbar()
|
||||
}
|
||||
|
||||
// if edge to edge is used, add an empty item at the bottom of the list
|
||||
@Suppress("MagicNumber")
|
||||
private fun addEmptyItemForEdgeToEdgeIfNecessary() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) {
|
||||
adapter?.addScrollableFooter(SpacerItem(200))
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("LongMethod")
|
||||
private fun initObservers() {
|
||||
this.lifecycleScope.launch {
|
||||
@ -406,6 +421,10 @@ class ConversationsListActivity :
|
||||
conversationsListViewModel.getRoomsFlow
|
||||
.onEach { list ->
|
||||
setConversationList(list)
|
||||
val noteToSelf = list
|
||||
.firstOrNull { ConversationUtils.isNoteToSelfConversation(it) }
|
||||
val isNoteToSelfAvailable = noteToSelf != null
|
||||
handleNoteToSelfShortcut(isNoteToSelfAvailable, noteToSelf?.token ?: "")
|
||||
}.collect()
|
||||
}
|
||||
|
||||
@ -458,7 +477,13 @@ class ConversationsListActivity :
|
||||
userItems.add(contactItem)
|
||||
}
|
||||
|
||||
searchableConversationItems.addAll(userItems)
|
||||
val list = searchableConversationItems.filter {
|
||||
it !is ContactItem
|
||||
}.toMutableList()
|
||||
|
||||
list.addAll(userItems)
|
||||
|
||||
searchableConversationItems = list
|
||||
}
|
||||
|
||||
else -> {}
|
||||
@ -516,6 +541,29 @@ class ConversationsListActivity :
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleNoteToSelfShortcut(noteToSelfAvailable: Boolean, noteToSelfToken: String) {
|
||||
if (noteToSelfAvailable) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ROOM_TOKEN, noteToSelfToken)
|
||||
bundle.putBoolean(BundleKeys.KEY_FOCUS_INPUT, true)
|
||||
val intent = Intent(context, ChatActivity::class.java)
|
||||
intent.putExtras(bundle)
|
||||
intent.action = Intent.ACTION_VIEW
|
||||
val openNotesString = resources.getString(R.string.open_notes)
|
||||
|
||||
val shortcut = ShortcutInfoCompat.Builder(context, NOTE_TO_SELF_SHORTCUT_ID)
|
||||
.setShortLabel(openNotesString)
|
||||
.setLongLabel(openNotesString)
|
||||
.setIcon(IconCompat.createWithResource(context, R.drawable.ic_pencil_grey600_24dp))
|
||||
.setIntent(intent)
|
||||
.build()
|
||||
|
||||
ShortcutManagerCompat.pushDynamicShortcut(context, shortcut)
|
||||
} else {
|
||||
ShortcutManagerCompat.removeDynamicShortcuts(context, listOf(NOTE_TO_SELF_SHORTCUT_ID))
|
||||
}
|
||||
}
|
||||
|
||||
private fun setConversationList(list: List<ConversationModel>) {
|
||||
// Update Conversations
|
||||
conversationItems.clear()
|
||||
@ -523,26 +571,29 @@ class ConversationsListActivity :
|
||||
nearFutureEventConversationItems.clear()
|
||||
|
||||
for (conversation in list) {
|
||||
if (!futureEvent(conversation)) {
|
||||
if (!isFutureEvent(conversation) && !conversation.hasArchived) {
|
||||
addToNearFutureEventConversationItems(conversation)
|
||||
}
|
||||
addToConversationItems(conversation)
|
||||
}
|
||||
|
||||
getFilterStates()
|
||||
val noFiltersActive = !(
|
||||
filterState[MENTION] == true ||
|
||||
filterState[UNREAD] == true ||
|
||||
filterState[ARCHIVE] == true
|
||||
)
|
||||
|
||||
sortConversations(conversationItems)
|
||||
sortConversations(conversationItemsWithHeader)
|
||||
sortConversations(nearFutureEventConversationItems)
|
||||
|
||||
if (!hasFilterEnabled() && searchBehaviorSubject.value == false) {
|
||||
if (noFiltersActive && searchBehaviorSubject.value == false) {
|
||||
adapter?.updateDataSet(nearFutureEventConversationItems, false)
|
||||
} else {
|
||||
// Filter Conversations
|
||||
if (!hasFilterEnabled()) {
|
||||
filterableConversationItems = conversationItems
|
||||
}
|
||||
filterConversation()
|
||||
adapter?.updateDataSet(filterableConversationItems, false)
|
||||
applyFilter()
|
||||
}
|
||||
|
||||
Handler().postDelayed({ checkToShowUnreadBubble() }, UNREAD_BUBBLE_DELAY.toLong())
|
||||
|
||||
// Fetch Open Conversations
|
||||
@ -551,9 +602,14 @@ class ConversationsListActivity :
|
||||
intArrayOf(ApiUtils.API_V4, ApiUtils.API_V3, 1)
|
||||
)
|
||||
fetchOpenConversations(apiVersion)
|
||||
}
|
||||
|
||||
// Get users
|
||||
fetchUsers()
|
||||
fun applyFilter() {
|
||||
if (!hasFilterEnabled()) {
|
||||
filterableConversationItems = conversationItems
|
||||
}
|
||||
filterConversation()
|
||||
adapter?.updateDataSet(filterableConversationItems, false)
|
||||
}
|
||||
|
||||
private fun hasFilterEnabled(): Boolean {
|
||||
@ -564,13 +620,14 @@ class ConversationsListActivity :
|
||||
return false
|
||||
}
|
||||
|
||||
private fun futureEvent(conversation: ConversationModel): Boolean {
|
||||
private fun isFutureEvent(conversation: ConversationModel): Boolean {
|
||||
if (!conversation.objectId.contains("#")) {
|
||||
return false
|
||||
}
|
||||
return conversation.objectType == ConversationEnums.ObjectType.EVENT &&
|
||||
(conversation.objectId.split("#")[0].toLong() - (System.currentTimeMillis() / LONG_1000)) >
|
||||
AGE_THRESHOLD_FOR_EVENT_CONVERSATIONS
|
||||
val eventTimeStart = conversation.objectId.split("#")[0].toLong()
|
||||
val currentTimeStampInSeconds = System.currentTimeMillis() / LONG_1000
|
||||
val sixteenHoursAfterTimeStamp = (eventTimeStart - currentTimeStampInSeconds) > SIXTEEN_HOURS_IN_SECONDS
|
||||
return conversation.objectType == ConversationEnums.ObjectType.EVENT && sixteenHoursAfterTimeStamp
|
||||
}
|
||||
|
||||
fun showOnlyNearFutureEvents() {
|
||||
@ -584,32 +641,35 @@ class ConversationsListActivity :
|
||||
nearFutureEventConversationItems.add(conversationItem)
|
||||
}
|
||||
|
||||
fun filterConversation() {
|
||||
fun getFilterStates() {
|
||||
val accountId = UserIdUtils.getIdForUser(currentUser)
|
||||
filterState[FilterConversationFragment.UNREAD] = (
|
||||
filterState[UNREAD] = (
|
||||
arbitraryStorageManager.getStorageSetting(
|
||||
accountId,
|
||||
FilterConversationFragment.UNREAD,
|
||||
UNREAD,
|
||||
""
|
||||
).blockingGet()?.value ?: ""
|
||||
) == "true"
|
||||
|
||||
filterState[FilterConversationFragment.MENTION] = (
|
||||
filterState[MENTION] = (
|
||||
arbitraryStorageManager.getStorageSetting(
|
||||
accountId,
|
||||
FilterConversationFragment.MENTION,
|
||||
MENTION,
|
||||
""
|
||||
).blockingGet()?.value ?: ""
|
||||
) == "true"
|
||||
|
||||
filterState[FilterConversationFragment.ARCHIVE] = (
|
||||
filterState[ARCHIVE] = (
|
||||
arbitraryStorageManager.getStorageSetting(
|
||||
accountId,
|
||||
FilterConversationFragment.ARCHIVE,
|
||||
ARCHIVE,
|
||||
""
|
||||
).blockingGet()?.value ?: ""
|
||||
) == "true"
|
||||
}
|
||||
|
||||
fun filterConversation() {
|
||||
getFilterStates()
|
||||
val newItems: MutableList<AbstractFlexibleItem<*>> = ArrayList()
|
||||
val items = conversationItems
|
||||
for (i in items) {
|
||||
@ -619,7 +679,7 @@ class ConversationsListActivity :
|
||||
}
|
||||
}
|
||||
|
||||
val archiveFilterOn = filterState[FilterConversationFragment.ARCHIVE] ?: false
|
||||
val archiveFilterOn = filterState[ARCHIVE] == true
|
||||
if (archiveFilterOn && newItems.isEmpty()) {
|
||||
binding.noArchivedConversationLayout.visibility = View.VISIBLE
|
||||
} else {
|
||||
@ -641,7 +701,7 @@ class ConversationsListActivity :
|
||||
for ((k, v) in filterState) {
|
||||
if (v) {
|
||||
when (k) {
|
||||
FilterConversationFragment.MENTION -> result = (result && conversation.unreadMention) ||
|
||||
MENTION -> result = (result && conversation.unreadMention) ||
|
||||
(
|
||||
result &&
|
||||
(
|
||||
@ -651,10 +711,10 @@ class ConversationsListActivity :
|
||||
(conversation.unreadMessages > 0)
|
||||
)
|
||||
|
||||
FilterConversationFragment.UNREAD -> result = result && (conversation.unreadMessages > 0)
|
||||
UNREAD -> result = result && (conversation.unreadMessages > 0)
|
||||
|
||||
FilterConversationFragment.DEFAULT -> {
|
||||
result = if (filterState[FilterConversationFragment.ARCHIVE] == true) {
|
||||
result = if (filterState[ARCHIVE] == true) {
|
||||
result && conversation.hasArchived
|
||||
} else {
|
||||
result && !conversation.hasArchived
|
||||
@ -734,7 +794,7 @@ class ConversationsListActivity :
|
||||
}
|
||||
|
||||
private fun initSearchView() {
|
||||
val searchManager = getSystemService(Context.SEARCH_SERVICE) as SearchManager?
|
||||
val searchManager = getSystemService(SEARCH_SERVICE) as SearchManager?
|
||||
if (searchItem != null) {
|
||||
searchView = MenuItemCompat.getActionView(searchItem) as SearchView
|
||||
viewThemeUtils.talk.themeSearchView(searchView!!)
|
||||
@ -913,8 +973,7 @@ class ConversationsListActivity :
|
||||
} else {
|
||||
showToolbar()
|
||||
}
|
||||
colorizeStatusBar()
|
||||
colorizeNavigationBar()
|
||||
initSystemBars()
|
||||
}
|
||||
}
|
||||
|
||||
@ -1150,8 +1209,8 @@ class ConversationsListActivity :
|
||||
}
|
||||
}
|
||||
|
||||
private fun fetchUsers() {
|
||||
contactsViewModel.getContactsFromSearchParams()
|
||||
private fun fetchUsers(query: String = "") {
|
||||
contactsViewModel.getContactsFromSearchParams(query)
|
||||
}
|
||||
|
||||
private fun handleHttpExceptions(throwable: Throwable) {
|
||||
@ -1196,7 +1255,7 @@ class ConversationsListActivity :
|
||||
})
|
||||
binding.recyclerView.setOnTouchListener { v: View, _: MotionEvent? ->
|
||||
if (!isDestroyed) {
|
||||
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
val imm = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imm.hideSoftInputFromWindow(v.windowToken, 0)
|
||||
}
|
||||
false
|
||||
@ -1349,6 +1408,9 @@ class ConversationsListActivity :
|
||||
private fun performFilterAndSearch(filter: String?) {
|
||||
if (filter!!.length >= SEARCH_MIN_CHARS) {
|
||||
clearMessageSearchResults()
|
||||
binding.noArchivedConversationLayout.visibility = View.GONE
|
||||
|
||||
fetchUsers(filter)
|
||||
|
||||
if (hasFilterEnabled()) {
|
||||
adapter?.updateDataSet(conversationItems)
|
||||
@ -1356,6 +1418,7 @@ class ConversationsListActivity :
|
||||
adapter?.filterItems()
|
||||
adapter?.updateDataSet(filterableConversationItems)
|
||||
} else {
|
||||
adapter?.updateDataSet(searchableConversationItems)
|
||||
adapter?.setFilter(filter)
|
||||
adapter?.filterItems()
|
||||
}
|
||||
@ -1370,8 +1433,15 @@ class ConversationsListActivity :
|
||||
|
||||
private fun resetSearchResults() {
|
||||
clearMessageSearchResults()
|
||||
adapter?.updateDataSet(conversationItems)
|
||||
adapter?.setFilter("")
|
||||
adapter?.filterItems()
|
||||
val archiveFilterOn = filterState[ARCHIVE] == true
|
||||
if (archiveFilterOn && adapter!!.isEmpty) {
|
||||
binding.noArchivedConversationLayout.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.noArchivedConversationLayout.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
private fun clearMessageSearchResults() {
|
||||
@ -1380,6 +1450,7 @@ class ConversationsListActivity :
|
||||
adapter?.removeSection(firstHeader)
|
||||
} else {
|
||||
adapter?.removeItemsOfType(MessageResultItem.VIEW_TYPE)
|
||||
adapter?.removeItemsOfType(MessagesTextHeaderItem.VIEW_TYPE)
|
||||
}
|
||||
adapter?.removeItemsOfType(LoadMoreResultsItem.VIEW_TYPE)
|
||||
}
|
||||
@ -1776,7 +1847,7 @@ class ConversationsListActivity :
|
||||
val callsChannelNotEnabled = !NotificationUtils.isCallsNotificationChannelEnabled(this)
|
||||
|
||||
val serverNotificationAppInstalled =
|
||||
currentUser?.capabilities?.notificationsCapability?.features?.isNotEmpty() ?: false
|
||||
currentUser?.capabilities?.notificationsCapability?.features?.isNotEmpty() == true
|
||||
|
||||
val settingsOfUserAreWrong = notificationPermissionNotGranted ||
|
||||
batteryOptimizationNotIgnored ||
|
||||
@ -1905,9 +1976,9 @@ class ConversationsListActivity :
|
||||
WorkManager.getInstance(applicationContext).enqueue(accountRemovalWork)
|
||||
|
||||
WorkManager.getInstance(context).getWorkInfoByIdLiveData(accountRemovalWork.id)
|
||||
.observeForever { workInfo: WorkInfo ->
|
||||
.observeForever { workInfo: WorkInfo? ->
|
||||
|
||||
when (workInfo.state) {
|
||||
when (workInfo?.state) {
|
||||
WorkInfo.State.SUCCEEDED -> {
|
||||
val text = String.format(
|
||||
context.resources.getString(R.string.nc_deleted_user),
|
||||
@ -2077,29 +2148,25 @@ class ConversationsListActivity :
|
||||
val entries = results.messages
|
||||
if (entries.isNotEmpty()) {
|
||||
val adapterItems: MutableList<AbstractFlexibleItem<*>> = ArrayList(entries.size + 1)
|
||||
|
||||
for (i in entries.indices) {
|
||||
val showHeader = i == 0
|
||||
adapterItems.add(
|
||||
MessageResultItem(
|
||||
context,
|
||||
currentUser!!,
|
||||
entries[i],
|
||||
showHeader,
|
||||
viewThemeUtils = viewThemeUtils
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
if (results.hasMore) {
|
||||
adapterItems.add(LoadMoreResultsItem)
|
||||
}
|
||||
|
||||
adapter?.addItems(Int.MAX_VALUE, adapterItems)
|
||||
val pos = adapter?.currentItems?.indexOfFirst {
|
||||
it is MessageResultItem
|
||||
}
|
||||
val item = (adapter?.currentItems?.get(pos!!) as MessageResultItem).apply { showHeader = true }
|
||||
adapter?.addItem(pos!!, item)
|
||||
adapter?.notifyItemInserted(pos!!)
|
||||
adapter?.removeItem(pos!! - 1)
|
||||
adapter?.notifyItemRemoved(pos!! - 1)
|
||||
binding.recyclerView.scrollToPosition(0)
|
||||
}
|
||||
}
|
||||
@ -2112,8 +2179,8 @@ class ConversationsListActivity :
|
||||
}
|
||||
|
||||
fun updateFilterState(mention: Boolean, unread: Boolean) {
|
||||
filterState[FilterConversationFragment.MENTION] = mention
|
||||
filterState[FilterConversationFragment.UNREAD] = unread
|
||||
filterState[MENTION] = mention
|
||||
filterState[UNREAD] = unread
|
||||
}
|
||||
|
||||
fun setFilterableItems(items: MutableList<AbstractFlexibleItem<*>>) {
|
||||
@ -2152,7 +2219,8 @@ class ConversationsListActivity :
|
||||
const val NOTIFICATION_WARNING_DATE_NOT_SET = 0L
|
||||
const val OFFSET_HEIGHT_DIVIDER: Int = 3
|
||||
const val ROOM_TYPE_ONE_ONE = "1"
|
||||
private const val AGE_THRESHOLD_FOR_EVENT_CONVERSATIONS: Long = 57600
|
||||
private const val SIXTEEN_HOURS_IN_SECONDS: Long = 57600
|
||||
const val LONG_1000: Long = 1000
|
||||
private const val NOTE_TO_SELF_SHORTCUT_ID = "NOTE_TO_SELF_SHORTCUT_ID"
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,18 @@ interface ChatMessagesDao {
|
||||
)
|
||||
fun getTempMessagesForConversation(internalConversationId: String): Flow<List<ChatMessageEntity>>
|
||||
|
||||
@Query(
|
||||
"""
|
||||
SELECT *
|
||||
FROM ChatMessages
|
||||
WHERE internalConversationId = :internalConversationId
|
||||
AND isTemporary = 1
|
||||
AND sendStatus != 'SENT_PENDING_ACK'
|
||||
ORDER BY timestamp DESC, id DESC
|
||||
"""
|
||||
)
|
||||
fun getTempUnsentMessagesForConversation(internalConversationId: String): Flow<List<ChatMessageEntity>>
|
||||
|
||||
@Query(
|
||||
"""
|
||||
SELECT *
|
||||
@ -60,7 +72,7 @@ interface ChatMessagesDao {
|
||||
ORDER BY timestamp DESC, id DESC
|
||||
"""
|
||||
)
|
||||
fun getTempMessageForConversation(internalConversationId: String, referenceId: String): Flow<ChatMessageEntity>
|
||||
fun getTempMessageForConversation(internalConversationId: String, referenceId: String): Flow<ChatMessageEntity?>
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun upsertChatMessages(chatMessages: List<ChatMessageEntity>)
|
||||
|
@ -68,7 +68,7 @@ fun ChatMessageEntity.asModel() =
|
||||
isDeleted = deleted,
|
||||
referenceId = referenceId,
|
||||
isTemporary = isTemporary,
|
||||
sendingFailed = sendingFailed,
|
||||
sendStatus = sendStatus,
|
||||
readStatus = ReadStatus.NONE,
|
||||
silent = silent
|
||||
)
|
||||
|
@ -61,7 +61,9 @@ fun ConversationModel.asEntity() =
|
||||
recordingConsentRequired = recordingConsentRequired,
|
||||
remoteServer = remoteServer,
|
||||
remoteToken = remoteToken,
|
||||
hasArchived = hasArchived
|
||||
hasArchived = hasArchived,
|
||||
hasSensitive = hasSensitive,
|
||||
hasImportant = hasImportant
|
||||
)
|
||||
|
||||
fun ConversationEntity.asModel() =
|
||||
@ -113,7 +115,9 @@ fun ConversationEntity.asModel() =
|
||||
recordingConsentRequired = recordingConsentRequired,
|
||||
remoteServer = remoteServer,
|
||||
remoteToken = remoteToken,
|
||||
hasArchived = hasArchived
|
||||
hasArchived = hasArchived,
|
||||
hasSensitive = hasSensitive,
|
||||
hasImportant = hasImportant
|
||||
)
|
||||
|
||||
fun Conversation.asEntity(accountId: Long) =
|
||||
@ -164,5 +168,7 @@ fun Conversation.asEntity(accountId: Long) =
|
||||
recordingConsentRequired = recordingConsentRequired,
|
||||
remoteServer = remoteServer,
|
||||
remoteToken = remoteToken,
|
||||
hasArchived = hasArchived
|
||||
hasArchived = hasArchived,
|
||||
hasSensitive = hasSensitive,
|
||||
hasImportant = hasImportant
|
||||
)
|
||||
|
@ -64,7 +64,7 @@ data class ChatMessageEntity(
|
||||
@ColumnInfo(name = "reactions") var reactions: LinkedHashMap<String, Int>? = null,
|
||||
@ColumnInfo(name = "reactionsSelf") var reactionsSelf: ArrayList<String>? = null,
|
||||
@ColumnInfo(name = "referenceId") var referenceId: String? = null,
|
||||
@ColumnInfo(name = "sendingFailed") var sendingFailed: Boolean = false,
|
||||
@ColumnInfo(name = "sendStatus") var sendStatus: SendStatus? = null,
|
||||
@ColumnInfo(name = "silent") var silent: Boolean = false,
|
||||
@ColumnInfo(name = "systemMessage") var systemMessageType: ChatMessage.SystemMessageType,
|
||||
@ColumnInfo(name = "timestamp") var timestamp: Long = 0
|
||||
|
@ -94,7 +94,9 @@ data class ConversationEntity(
|
||||
@ColumnInfo(name = "unreadMention") var unreadMention: Boolean = false,
|
||||
@ColumnInfo(name = "unreadMentionDirect") var unreadMentionDirect: Boolean,
|
||||
@ColumnInfo(name = "unreadMessages") var unreadMessages: Int = 0,
|
||||
@ColumnInfo(name = "hasArchived") var hasArchived: Boolean = false
|
||||
@ColumnInfo(name = "hasArchived") var hasArchived: Boolean = false,
|
||||
@ColumnInfo(name = "hasSensitive") var hasSensitive: Boolean = false,
|
||||
@ColumnInfo(name = "hasImportant") var hasImportant: Boolean = false
|
||||
// missing/not needed: attendeeId
|
||||
// missing/not needed: attendeePin
|
||||
// missing/not needed: attendeePermissions
|
||||
|
@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.data.database.model
|
||||
|
||||
enum class SendStatus {
|
||||
PENDING,
|
||||
SENT_PENDING_ACK,
|
||||
FAILED
|
||||
}
|
@ -1,18 +1,31 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2024-2025 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-FileCopyrightText: 2022 Andy Scherzinger <info@andy-scherzinger.de>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
package com.nextcloud.talk.data.source.local
|
||||
|
||||
import android.util.Log
|
||||
import androidx.room.DeleteColumn
|
||||
import androidx.room.migration.AutoMigrationSpec
|
||||
import androidx.room.migration.Migration
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
import java.sql.SQLException
|
||||
|
||||
@Suppress("MagicNumber")
|
||||
object Migrations {
|
||||
|
||||
//region Auto migrations
|
||||
|
||||
@DeleteColumn(tableName = "ChatMessages", columnName = "sendingFailed")
|
||||
class AutoMigration16To17 : AutoMigrationSpec
|
||||
|
||||
//endregion
|
||||
|
||||
//region Manual migrations
|
||||
|
||||
val MIGRATION_6_8 = object : Migration(6, 8) {
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
Log.i("Migrations", "Migrating 6 to 8")
|
||||
@ -62,6 +75,22 @@ object Migrations {
|
||||
}
|
||||
}
|
||||
|
||||
val MIGRATION_14_15 = object : Migration(14, 15) {
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
Log.i("Migrations", "Migrating 14 to 15")
|
||||
addIsSensitive(db)
|
||||
}
|
||||
}
|
||||
|
||||
val MIGRATION_15_16 = object : Migration(15, 16) {
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
Log.i("Migrations", "Migrating 15 to 16")
|
||||
addIsImportant(db)
|
||||
}
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
fun migrateToRoom(db: SupportSQLiteDatabase) {
|
||||
db.execSQL(
|
||||
"CREATE TABLE User_new (" +
|
||||
@ -283,6 +312,28 @@ object Migrations {
|
||||
}
|
||||
}
|
||||
|
||||
fun addIsSensitive(db: SupportSQLiteDatabase) {
|
||||
try {
|
||||
db.execSQL(
|
||||
"ALTER TABLE Conversations " +
|
||||
"ADD COLUMN hasSensitive INTEGER NOT NULL DEFAULT 0;"
|
||||
)
|
||||
} catch (e: SQLException) {
|
||||
Log.i("Migrations", "Something went wrong when adding column hasSensitive to table Conversations")
|
||||
}
|
||||
}
|
||||
|
||||
fun addIsImportant(db: SupportSQLiteDatabase) {
|
||||
try {
|
||||
db.execSQL(
|
||||
"ALTER TABLE Conversations " +
|
||||
"ADD COLUMN hasImportant INTEGER NOT NULL DEFAULT 0;"
|
||||
)
|
||||
} catch (e: SQLException) {
|
||||
Log.i("Migrations", "Something went wrong when adding column hasImportant to table Conversations")
|
||||
}
|
||||
}
|
||||
|
||||
fun addTempMessagesSupport(db: SupportSQLiteDatabase) {
|
||||
try {
|
||||
db.execSQL(
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2023-2024 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-FileCopyrightText: 2023-2025 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-FileCopyrightText: 2022 Andy Scherzinger <info@andy-scherzinger.de>
|
||||
* SPDX-FileCopyrightText: 2017-2020 Mario Danic <mario@lovelyhq.com>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
@ -23,12 +23,14 @@ import com.nextcloud.talk.data.database.dao.ConversationsDao
|
||||
import com.nextcloud.talk.data.database.model.ChatBlockEntity
|
||||
import com.nextcloud.talk.data.database.model.ChatMessageEntity
|
||||
import com.nextcloud.talk.data.database.model.ConversationEntity
|
||||
import com.nextcloud.talk.data.source.local.Migrations.AutoMigration16To17
|
||||
import com.nextcloud.talk.data.source.local.converters.ArrayListConverter
|
||||
import com.nextcloud.talk.data.source.local.converters.CapabilitiesConverter
|
||||
import com.nextcloud.talk.data.source.local.converters.ExternalSignalingServerConverter
|
||||
import com.nextcloud.talk.data.source.local.converters.HashMapHashMapConverter
|
||||
import com.nextcloud.talk.data.source.local.converters.LinkedHashMapConverter
|
||||
import com.nextcloud.talk.data.source.local.converters.PushConfigurationConverter
|
||||
import com.nextcloud.talk.data.source.local.converters.SendStatusConverter
|
||||
import com.nextcloud.talk.data.source.local.converters.ServerVersionConverter
|
||||
import com.nextcloud.talk.data.source.local.converters.SignalingSettingsConverter
|
||||
import com.nextcloud.talk.data.storage.ArbitraryStoragesDao
|
||||
@ -49,9 +51,10 @@ import java.util.Locale
|
||||
ChatMessageEntity::class,
|
||||
ChatBlockEntity::class
|
||||
],
|
||||
version = 14,
|
||||
version = 17,
|
||||
autoMigrations = [
|
||||
AutoMigration(from = 9, to = 10)
|
||||
AutoMigration(from = 9, to = 10),
|
||||
AutoMigration(from = 16, to = 17, spec = AutoMigration16To17::class)
|
||||
],
|
||||
exportSchema = true
|
||||
)
|
||||
@ -63,7 +66,8 @@ import java.util.Locale
|
||||
SignalingSettingsConverter::class,
|
||||
HashMapHashMapConverter::class,
|
||||
LinkedHashMapConverter::class,
|
||||
ArrayListConverter::class
|
||||
ArrayListConverter::class,
|
||||
SendStatusConverter::class
|
||||
)
|
||||
abstract class TalkDatabase : RoomDatabase() {
|
||||
|
||||
@ -116,7 +120,9 @@ abstract class TalkDatabase : RoomDatabase() {
|
||||
Migrations.MIGRATION_10_11,
|
||||
Migrations.MIGRATION_11_12,
|
||||
Migrations.MIGRATION_12_13,
|
||||
Migrations.MIGRATION_13_14
|
||||
Migrations.MIGRATION_13_14,
|
||||
Migrations.MIGRATION_14_15,
|
||||
Migrations.MIGRATION_15_16
|
||||
)
|
||||
.allowMainThreadQueries()
|
||||
.addCallback(
|
||||
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.data.source.local.converters
|
||||
|
||||
import androidx.room.TypeConverter
|
||||
import com.nextcloud.talk.data.database.model.SendStatus
|
||||
|
||||
class SendStatusConverter {
|
||||
@TypeConverter
|
||||
fun fromStatus(value: SendStatus): String {
|
||||
return value.name
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
fun toStatus(value: String): SendStatus {
|
||||
return SendStatus.valueOf(value)
|
||||
}
|
||||
}
|
@ -21,6 +21,7 @@ import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.statusBarsPadding
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.runtime.collectAsState
|
||||
@ -28,8 +29,9 @@ import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.core.net.toUri
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import autodagger.AutoInjector
|
||||
import com.nextcloud.talk.BuildConfig
|
||||
import com.nextcloud.talk.R
|
||||
@ -37,8 +39,8 @@ import com.nextcloud.talk.activities.BaseActivity
|
||||
import com.nextcloud.talk.api.NcApi
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication
|
||||
import com.nextcloud.talk.arbitrarystorage.ArbitraryStorageManager
|
||||
import com.nextcloud.talk.components.ColoredStatusBar
|
||||
import com.nextcloud.talk.components.StandardAppBar
|
||||
import com.nextcloud.talk.components.SetupSystemBars
|
||||
import com.nextcloud.talk.users.UserManager
|
||||
import com.nextcloud.talk.utils.BrandingUtils
|
||||
import com.nextcloud.talk.utils.ClosedInterfaceImpl
|
||||
@ -109,18 +111,22 @@ class DiagnoseActivity : BaseActivity() {
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme
|
||||
) {
|
||||
ColoredStatusBar()
|
||||
Scaffold(
|
||||
modifier = Modifier
|
||||
.statusBarsPadding(),
|
||||
topBar = {
|
||||
StandardAppBar(
|
||||
title = stringResource(R.string.nc_settings_diagnose_title),
|
||||
menuItems
|
||||
)
|
||||
},
|
||||
content = {
|
||||
content = { paddingValues ->
|
||||
val viewState = diagnoseViewModel.notificationViewState.collectAsState().value
|
||||
|
||||
Column(
|
||||
Modifier
|
||||
.padding(it)
|
||||
.padding(0.dp, paddingValues.calculateTopPadding(), 0.dp, 0.dp)
|
||||
.background(backgroundColor)
|
||||
.fillMaxSize()
|
||||
) {
|
||||
@ -136,7 +142,6 @@ class DiagnoseActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
)
|
||||
SetupSystemBars()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,12 @@ fun DiagnoseContentComposable(
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(16.dp)
|
||||
.padding(
|
||||
start = 16.dp,
|
||||
top = 0.dp,
|
||||
end = 16.dp,
|
||||
bottom = 0.dp
|
||||
)
|
||||
.verticalScroll(rememberScrollState())
|
||||
) {
|
||||
data.value.forEach { element ->
|
||||
@ -100,6 +105,7 @@ fun DiagnoseContentComposable(
|
||||
ShowTestPushButton(onTestPushClick)
|
||||
}
|
||||
ShowNotificationData(isLoading, showDialog, context, viewState, onDismissDialog)
|
||||
Spacer(modifier = Modifier.height(40.dp))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,6 +190,7 @@ class FullScreenMediaActivity : AppCompatActivity() {
|
||||
supportActionBar?.show()
|
||||
}
|
||||
|
||||
@OptIn(UnstableApi::class)
|
||||
private fun applyWindowInsets() {
|
||||
val playerView = binding.playerView
|
||||
val exoControls = playerView.findViewById<FrameLayout>(R.id.exo_bottom_bar)
|
||||
|
@ -65,7 +65,7 @@ class InvitationsActivity : BaseActivity() {
|
||||
binding = ActivityInvitationsBinding.inflate(layoutInflater)
|
||||
setupActionBar()
|
||||
setContentView(binding.root)
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
|
||||
adapter = InvitationsAdapter(currentUser) { invitation, action ->
|
||||
handleInvitation(invitation, action)
|
||||
|
@ -67,7 +67,7 @@ class GeocodingActivity :
|
||||
binding = ActivityGeocodingBinding.inflate(layoutInflater)
|
||||
setupActionBar()
|
||||
setContentView(binding.root)
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
|
||||
Configuration.getInstance().load(context, PreferenceManager.getDefaultSharedPreferences(context))
|
||||
|
||||
|
@ -129,7 +129,7 @@ class LocationPickerActivity :
|
||||
binding = ActivityLocationBinding.inflate(layoutInflater)
|
||||
setupActionBar()
|
||||
setContentView(binding.root)
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
|
||||
getInstance().load(context, PreferenceManager.getDefaultSharedPreferences(context))
|
||||
|
||||
|
@ -70,7 +70,7 @@ class MessageSearchActivity : BaseActivity() {
|
||||
binding = ActivityMessageSearchBinding.inflate(layoutInflater)
|
||||
setupActionBar()
|
||||
setContentView(binding.root)
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
|
||||
viewModel = ViewModelProvider(this, viewModelFactory)[MessageSearchViewModel::class.java]
|
||||
user = currentUserProvider.currentUser.blockingGet()
|
||||
|
@ -61,6 +61,8 @@ class ConversationModel(
|
||||
var remoteServer: String? = null,
|
||||
var remoteToken: String? = null,
|
||||
var hasArchived: Boolean = false,
|
||||
var hasSensitive: Boolean = false,
|
||||
var hasImportant: Boolean = false,
|
||||
|
||||
// attributes that don't come from API. This should be changed?!
|
||||
var password: String? = null
|
||||
@ -125,7 +127,9 @@ class ConversationModel(
|
||||
recordingConsentRequired = conversation.recordingConsentRequired,
|
||||
remoteServer = conversation.remoteServer,
|
||||
remoteToken = conversation.remoteToken,
|
||||
hasArchived = conversation.hasArchived
|
||||
hasArchived = conversation.hasArchived,
|
||||
hasSensitive = conversation.hasSensitive,
|
||||
hasImportant = conversation.hasImportant
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class ChatUtils {
|
||||
return message
|
||||
}
|
||||
|
||||
@Suppress("Detekt.ComplexMethod")
|
||||
@Suppress("Detekt.ComplexMethod", "Detekt.ComplexCondition")
|
||||
private fun parse(messageParameters: HashMap<String?, HashMap<String?, String?>>, message: String?): String? {
|
||||
var resultMessage = message
|
||||
for (key in messageParameters.keys) {
|
||||
@ -29,7 +29,9 @@ class ChatUtils {
|
||||
|
||||
if (individualHashMap != null) {
|
||||
val type = individualHashMap["type"]
|
||||
resultMessage = if (type == "user" || type == "guest" || type == "call" || type == "email") {
|
||||
resultMessage = if (type == "user" || type == "guest" || type == "call" || type == "email" ||
|
||||
type == "user-group" || type == "circle"
|
||||
) {
|
||||
resultMessage?.replace("{$key}", "@" + individualHashMap["name"])
|
||||
} else if (type == "geo-location") {
|
||||
individualHashMap["name"]
|
||||
|
@ -165,5 +165,11 @@ data class Conversation(
|
||||
var remoteToken: String? = "",
|
||||
|
||||
@JsonField(name = ["isArchived"])
|
||||
var hasArchived: Boolean = false
|
||||
var hasArchived: Boolean = false,
|
||||
|
||||
@JsonField(name = ["isSensitive"])
|
||||
var hasSensitive: Boolean = false,
|
||||
|
||||
@JsonField(name = ["isImportant"])
|
||||
var hasImportant: Boolean = false
|
||||
) : Parcelable
|
||||
|
@ -44,6 +44,9 @@ class ConversationEnums {
|
||||
SHARE_PASSWORD,
|
||||
FILE,
|
||||
ROOM,
|
||||
EVENT
|
||||
EVENT,
|
||||
PHONE_TEMPORARY,
|
||||
PHONE_PERSIST,
|
||||
INSTANT_MEETING
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,9 @@ class ConversationObjectTypeConverter : StringBasedTypeConverter<ConversationEnu
|
||||
"room" -> ConversationEnums.ObjectType.ROOM
|
||||
"file" -> ConversationEnums.ObjectType.FILE
|
||||
"event" -> ConversationEnums.ObjectType.EVENT
|
||||
"phone_persist" -> ConversationEnums.ObjectType.PHONE_PERSIST
|
||||
"phone_temporary" -> ConversationEnums.ObjectType.PHONE_TEMPORARY
|
||||
"instant_meeting" -> ConversationEnums.ObjectType.INSTANT_MEETING
|
||||
else -> ConversationEnums.ObjectType.DEFAULT
|
||||
}
|
||||
}
|
||||
@ -30,6 +33,9 @@ class ConversationObjectTypeConverter : StringBasedTypeConverter<ConversationEnu
|
||||
ConversationEnums.ObjectType.ROOM -> "room"
|
||||
ConversationEnums.ObjectType.FILE -> "file"
|
||||
ConversationEnums.ObjectType.EVENT -> "event"
|
||||
ConversationEnums.ObjectType.PHONE_PERSIST -> "phone_persist"
|
||||
ConversationEnums.ObjectType.PHONE_TEMPORARY -> "phone_temporary"
|
||||
ConversationEnums.ObjectType.INSTANT_MEETING -> "instant_meeting"
|
||||
else -> ""
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2025 Julius Linus <juliuslinus1@gmail.com>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.models.json.profile
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.bluelinelabs.logansquare.annotation.JsonField
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@JsonObject
|
||||
data class CoreProfileAction(
|
||||
@JsonField(name = ["id"])
|
||||
var id: String? = null,
|
||||
@JsonField(name = ["icon"])
|
||||
var icon: String? = null,
|
||||
@JsonField(name = ["title"])
|
||||
var title: String? = null,
|
||||
@JsonField(name = ["target"])
|
||||
var target: String? = null
|
||||
) : Parcelable {
|
||||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||
constructor() : this(null, null, null, null)
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2025 Julius Linus <juliuslinus1@gmail.com>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.models.json.profile
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.bluelinelabs.logansquare.annotation.JsonField
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@JsonObject
|
||||
data class Profile(
|
||||
@JsonField(name = ["userId"]) var userId: String? = null,
|
||||
@JsonField(name = ["address"]) var address: String? = null,
|
||||
@JsonField(name = ["biography"]) var biography: Int? = null,
|
||||
@JsonField(name = ["displayname"]) var displayName: Int? = null,
|
||||
@JsonField(name = ["headline"]) var headline: String? = null,
|
||||
// @JsonField(name = ["isUserAvatarVisible"]) var isUserAvatarVisible: Boolean = false,
|
||||
@JsonField(name = ["organisation"]) var company: String? = null,
|
||||
@JsonField(name = ["pronouns"]) var pronouns: String? = null,
|
||||
@JsonField(name = ["role"]) var role: String? = null,
|
||||
@JsonField(name = ["actions"]) var actions: List<CoreProfileAction>? = null,
|
||||
@JsonField(name = ["timezone"]) var timezone: String? = null,
|
||||
@JsonField(name = ["timezoneOffset"]) var timezoneOffset: Int? = null
|
||||
) : Parcelable
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2025 Julius Linus <juliuslinus1@gmail.com>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.models.json.profile
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.bluelinelabs.logansquare.annotation.JsonField
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject
|
||||
import com.nextcloud.talk.models.json.generic.GenericMeta
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@JsonObject
|
||||
data class ProfileOCS(
|
||||
@JsonField(name = ["meta"])
|
||||
var meta: GenericMeta? = null,
|
||||
@JsonField(name = ["data"])
|
||||
var data: Profile? = null
|
||||
) : Parcelable {
|
||||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||
constructor() : this(null, null)
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2025 Julius Linus <juliuslinus1@gmail.com>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.models.json.profile
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.bluelinelabs.logansquare.annotation.JsonField
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
@JsonObject
|
||||
data class ProfileOverall(
|
||||
@JsonField(name = ["ocs"])
|
||||
var ocs: ProfileOCS? = null
|
||||
) : Parcelable {
|
||||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||
constructor() : this(null)
|
||||
}
|
@ -57,7 +57,7 @@ class ListOpenConversationsActivity : BaseActivity() {
|
||||
binding = ActivityOpenConversationsBinding.inflate(layoutInflater)
|
||||
setupActionBar()
|
||||
setContentView(binding.root)
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
viewThemeUtils.platform.colorImageView(binding.searchOpenConversations, ColorRole.ON_SURFACE)
|
||||
viewThemeUtils.material.colorTextInputLayout(binding.textInputLayout)
|
||||
|
||||
|
@ -119,7 +119,7 @@ class ProfileActivity : BaseActivity() {
|
||||
binding = ActivityProfileBinding.inflate(layoutInflater)
|
||||
setupActionBar()
|
||||
setContentView(binding.root)
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
@ -6,14 +6,17 @@
|
||||
*/
|
||||
package com.nextcloud.talk.receivers
|
||||
|
||||
import android.Manifest
|
||||
import android.app.Notification
|
||||
import android.app.NotificationManager
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.text.style.ForegroundColorSpan
|
||||
import android.util.Log
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.NotificationManagerCompat
|
||||
import androidx.core.app.Person
|
||||
@ -162,9 +165,15 @@ class DirectReplyReceiver : BroadcastReceiver() {
|
||||
// Set the updated style
|
||||
previousBuilder.setStyle(previousStyle)
|
||||
|
||||
// Check if notification still exists
|
||||
if (findActiveNotification(systemNotificationId!!) != null) {
|
||||
NotificationManagerCompat.from(context).notify(systemNotificationId!!, previousBuilder.build())
|
||||
if (ActivityCompat.checkSelfPermission(
|
||||
context,
|
||||
Manifest.permission.POST_NOTIFICATIONS
|
||||
) == PackageManager.PERMISSION_GRANTED
|
||||
) {
|
||||
// Check if notification still exists
|
||||
if (findActiveNotification(systemNotificationId!!) != null) {
|
||||
NotificationManagerCompat.from(context).notify(systemNotificationId!!, previousBuilder.build())
|
||||
}
|
||||
}
|
||||
}
|
||||
.subscribeOn(Schedulers.io())
|
||||
|
@ -11,6 +11,7 @@ import com.nextcloud.talk.conversationinfo.CreateRoomRequest
|
||||
import com.nextcloud.talk.models.json.conversations.RoomOverall
|
||||
import com.nextcloud.talk.models.json.generic.GenericOverall
|
||||
import com.nextcloud.talk.models.json.participants.TalkBan
|
||||
import com.nextcloud.talk.models.json.profile.Profile
|
||||
import io.reactivex.Observable
|
||||
|
||||
interface ConversationsRepository {
|
||||
@ -46,4 +47,14 @@ interface ConversationsRepository {
|
||||
suspend fun clearChatHistory(apiVersion: Int, roomToken: String): GenericOverall
|
||||
|
||||
suspend fun createRoom(credentials: String, url: String, body: CreateRoomRequest): RoomOverall
|
||||
|
||||
suspend fun getProfile(credentials: String, url: String): Profile?
|
||||
|
||||
suspend fun markConversationAsSensitive(credentials: String, baseUrl: String, roomToken: String): GenericOverall
|
||||
|
||||
suspend fun markConversationAsInsensitive(credentials: String, baseUrl: String, roomToken: String): GenericOverall
|
||||
|
||||
suspend fun markConversationAsImportant(credentials: String, baseUrl: String, roomToken: String): GenericOverall
|
||||
|
||||
suspend fun markConversationAsUnImportant(credentials: String, baseUrl: String, roomToken: String): GenericOverall
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import com.nextcloud.talk.data.user.model.User
|
||||
import com.nextcloud.talk.models.json.conversations.RoomOverall
|
||||
import com.nextcloud.talk.models.json.generic.GenericOverall
|
||||
import com.nextcloud.talk.models.json.participants.TalkBan
|
||||
import com.nextcloud.talk.models.json.profile.Profile
|
||||
import com.nextcloud.talk.repositories.conversations.ConversationsRepository.ResendInvitationsResult
|
||||
import com.nextcloud.talk.utils.ApiUtils
|
||||
import com.nextcloud.talk.utils.database.user.CurrentUserProviderNew
|
||||
@ -116,6 +117,46 @@ class ConversationsRepositoryImpl(
|
||||
return response
|
||||
}
|
||||
|
||||
override suspend fun getProfile(credentials: String, url: String): Profile? {
|
||||
return coroutineApi.getProfile(credentials, url).ocs?.data
|
||||
}
|
||||
|
||||
override suspend fun markConversationAsSensitive(
|
||||
credentials: String,
|
||||
baseUrl: String,
|
||||
roomToken: String
|
||||
): GenericOverall {
|
||||
val url = ApiUtils.getUrlForSensitiveConversation(baseUrl, roomToken)
|
||||
return coroutineApi.markConversationAsSensitive(credentials, url)
|
||||
}
|
||||
|
||||
override suspend fun markConversationAsInsensitive(
|
||||
credentials: String,
|
||||
baseUrl: String,
|
||||
roomToken: String
|
||||
): GenericOverall {
|
||||
val url = ApiUtils.getUrlForSensitiveConversation(baseUrl, roomToken)
|
||||
return coroutineApi.markConversationAsInsensitive(credentials, url)
|
||||
}
|
||||
|
||||
override suspend fun markConversationAsImportant(
|
||||
credentials: String,
|
||||
baseUrl: String,
|
||||
roomToken: String
|
||||
): GenericOverall {
|
||||
val url = ApiUtils.getUrlForImportantConversation(baseUrl, roomToken)
|
||||
return coroutineApi.markConversationAsImportant(credentials, url)
|
||||
}
|
||||
|
||||
override suspend fun markConversationAsUnImportant(
|
||||
credentials: String,
|
||||
baseUrl: String,
|
||||
roomToken: String
|
||||
): GenericOverall {
|
||||
val url = ApiUtils.getUrlForImportantConversation(baseUrl, roomToken)
|
||||
return coroutineApi.markConversationAsUnimportant(credentials, url)
|
||||
}
|
||||
|
||||
override suspend fun banActor(
|
||||
credentials: String,
|
||||
url: String,
|
||||
|
@ -145,7 +145,7 @@ class SettingsActivity :
|
||||
binding = ActivitySettingsBinding.inflate(layoutInflater)
|
||||
setupActionBar()
|
||||
setContentView(binding.root)
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
|
||||
binding.avatarImage.let { ViewCompat.setTransitionName(it, "userAvatar.transitionTag") }
|
||||
|
||||
@ -681,9 +681,9 @@ class SettingsActivity :
|
||||
WorkManager.getInstance(applicationContext).enqueue(accountRemovalWork)
|
||||
|
||||
WorkManager.getInstance(context).getWorkInfoByIdLiveData(accountRemovalWork.id)
|
||||
.observeForever { workInfo: WorkInfo ->
|
||||
.observeForever { workInfo: WorkInfo? ->
|
||||
|
||||
when (workInfo.state) {
|
||||
when (workInfo?.state) {
|
||||
WorkInfo.State.SUCCEEDED -> {
|
||||
val text = String.format(
|
||||
context.resources.getString(R.string.nc_deleted_user),
|
||||
|
@ -13,7 +13,6 @@ import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
@ -28,7 +27,6 @@ import com.nextcloud.talk.databinding.ActivitySharedItemsBinding
|
||||
import com.nextcloud.talk.shareditems.adapters.SharedItemsAdapter
|
||||
import com.nextcloud.talk.shareditems.model.SharedItemType
|
||||
import com.nextcloud.talk.shareditems.viewmodels.SharedItemsViewModel
|
||||
import com.nextcloud.talk.utils.DisplayUtils
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_CONVERSATION_NAME
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys.KEY_ROOM_TOKEN
|
||||
import javax.inject.Inject
|
||||
@ -57,15 +55,11 @@ class SharedItemsActivity : BaseActivity() {
|
||||
setSupportActionBar(binding.sharedItemsToolbar)
|
||||
setContentView(binding.root)
|
||||
|
||||
viewThemeUtils.platform.themeStatusBar(this)
|
||||
initSystemBars()
|
||||
|
||||
viewThemeUtils.material.themeToolbar(binding.sharedItemsToolbar)
|
||||
viewThemeUtils.material.themeTabLayoutOnSurface(binding.sharedItemsTabs)
|
||||
|
||||
DisplayUtils.applyColorToNavigationBar(
|
||||
this.window,
|
||||
ResourcesCompat.getColor(resources, R.color.bg_default, null)
|
||||
)
|
||||
|
||||
supportActionBar?.title = conversationName
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
|
||||
|
@ -86,7 +86,7 @@ class TranslateActivity : BaseActivity() {
|
||||
}
|
||||
setupActionBar()
|
||||
setContentView(binding.root)
|
||||
setupSystemColors()
|
||||
initSystemBars()
|
||||
setupTextViews()
|
||||
viewModel.getLanguages()
|
||||
setupCopyButton()
|
||||
|
@ -8,6 +8,7 @@
|
||||
package com.nextcloud.talk.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.content.ContextWrapper
|
||||
import android.util.Log
|
||||
import android.view.View.TEXT_ALIGNMENT_VIEW_START
|
||||
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
|
||||
@ -23,6 +24,7 @@ import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.Row
|
||||
@ -46,6 +48,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.PlayArrow
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
@ -68,15 +71,18 @@ import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.StrokeCap
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.viewinterop.AndroidView
|
||||
import androidx.core.graphics.ColorUtils
|
||||
import androidx.emoji2.widget.EmojiTextView
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.asFlow
|
||||
import autodagger.AutoInjector
|
||||
@ -84,6 +90,8 @@ import coil.compose.AsyncImage
|
||||
import com.elyeproj.loaderviewlibrary.LoaderImageView
|
||||
import com.elyeproj.loaderviewlibrary.LoaderTextView
|
||||
import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.activities.MainActivity
|
||||
import com.nextcloud.talk.adapters.messages.PreviewMessageViewHolder.Companion.KEY_MIMETYPE
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication
|
||||
import com.nextcloud.talk.chat.data.model.ChatMessage
|
||||
@ -99,7 +107,9 @@ import com.nextcloud.talk.models.json.opengraph.Reference
|
||||
import com.nextcloud.talk.ui.theme.ViewThemeUtils
|
||||
import com.nextcloud.talk.users.UserManager
|
||||
import com.nextcloud.talk.utils.DateUtils
|
||||
import com.nextcloud.talk.utils.DrawableUtils.getDrawableResourceIdForMimeType
|
||||
import com.nextcloud.talk.utils.message.MessageUtils
|
||||
import com.nextcloud.talk.utils.preview.ComposePreviewUtils
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import org.osmdroid.config.Configuration
|
||||
@ -116,41 +126,54 @@ import kotlin.random.Random
|
||||
@Suppress("FunctionNaming", "TooManyFunctions", "LongMethod", "StaticFieldLeak", "LargeClass")
|
||||
class ComposeChatAdapter(
|
||||
private var messagesJson: List<ChatMessageJson>? = null,
|
||||
private var messageId: String? = null
|
||||
private var messageId: String? = null,
|
||||
private val utils: ComposePreviewUtils? = null
|
||||
) {
|
||||
|
||||
interface PreviewAble {
|
||||
val viewThemeUtils: ViewThemeUtils
|
||||
val messageUtils: MessageUtils
|
||||
val contactsViewModel: ContactsViewModel
|
||||
val chatViewModel: ChatViewModel
|
||||
val context: Context
|
||||
val userManager: UserManager
|
||||
}
|
||||
|
||||
@AutoInjector(NextcloudTalkApplication::class)
|
||||
inner class ComposeChatAdapterViewModel : ViewModel() {
|
||||
inner class ComposeChatAdapterViewModel : ViewModel(), PreviewAble {
|
||||
|
||||
@Inject
|
||||
lateinit var viewThemeUtils: ViewThemeUtils
|
||||
override lateinit var viewThemeUtils: ViewThemeUtils
|
||||
|
||||
@Inject
|
||||
lateinit var messageUtils: MessageUtils
|
||||
override lateinit var messageUtils: MessageUtils
|
||||
|
||||
@Inject
|
||||
lateinit var contactsViewModel: ContactsViewModel
|
||||
override lateinit var contactsViewModel: ContactsViewModel
|
||||
|
||||
@Inject
|
||||
lateinit var chatViewModel: ChatViewModel
|
||||
override lateinit var chatViewModel: ChatViewModel
|
||||
|
||||
@Inject
|
||||
lateinit var context: Context
|
||||
override lateinit var context: Context
|
||||
|
||||
@Inject
|
||||
lateinit var userManager: UserManager
|
||||
|
||||
val items = mutableStateListOf<ChatMessage>()
|
||||
override lateinit var userManager: UserManager
|
||||
|
||||
init {
|
||||
sharedApplication!!.componentApplication.inject(this)
|
||||
sharedApplication?.componentApplication?.inject(this)
|
||||
}
|
||||
|
||||
val currentUser: User = userManager.currentUser.blockingGet()
|
||||
val colorScheme = viewThemeUtils.getColorScheme(context)
|
||||
val highEmphasisColorInt = context.resources.getColor(R.color.high_emphasis_text, null)
|
||||
}
|
||||
|
||||
inner class ComposeChatAdapterPreviewViewModel(
|
||||
override val viewThemeUtils: ViewThemeUtils,
|
||||
override val messageUtils: MessageUtils,
|
||||
override val contactsViewModel: ContactsViewModel,
|
||||
override val chatViewModel: ChatViewModel,
|
||||
override val context: Context,
|
||||
override val userManager: UserManager
|
||||
) : ViewModel(), PreviewAble
|
||||
|
||||
companion object {
|
||||
val TAG: String = ComposeChatAdapter::class.java.simpleName
|
||||
private val REGULAR_TEXT_SIZE = 16.sp
|
||||
@ -173,21 +196,48 @@ class ComposeChatAdapter(
|
||||
|
||||
private var incomingShape: RoundedCornerShape = RoundedCornerShape(2.dp, 20.dp, 20.dp, 20.dp)
|
||||
private var outgoingShape: RoundedCornerShape = RoundedCornerShape(20.dp, 2.dp, 20.dp, 20.dp)
|
||||
private val viewModel = ComposeChatAdapterViewModel()
|
||||
|
||||
val viewModel: PreviewAble =
|
||||
if (utils != null) {
|
||||
ComposeChatAdapterPreviewViewModel(
|
||||
utils.viewThemeUtils,
|
||||
utils.messageUtils,
|
||||
utils.contactsViewModel,
|
||||
utils.chatViewModel,
|
||||
utils.context,
|
||||
utils.userManager
|
||||
)
|
||||
} else {
|
||||
ComposeChatAdapterViewModel()
|
||||
}
|
||||
|
||||
val items = mutableStateListOf<ChatMessage>()
|
||||
val currentUser: User = viewModel.userManager.currentUser.blockingGet()
|
||||
val colorScheme = viewModel.viewThemeUtils.getColorScheme(viewModel.context)
|
||||
val highEmphasisColorInt = viewModel.context.resources.getColor(R.color.high_emphasis_text, null)
|
||||
|
||||
fun Context.findMainActivityOrNull(): MainActivity? {
|
||||
var context = this
|
||||
while (context is ContextWrapper) {
|
||||
if (context is MainActivity) return context
|
||||
context = context.baseContext
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun addMessages(messages: MutableList<ChatMessage>, append: Boolean) {
|
||||
if (messages.isEmpty()) return
|
||||
|
||||
val processedMessages = messages.toMutableList()
|
||||
if (viewModel.items.isNotEmpty()) {
|
||||
if (items.isNotEmpty()) {
|
||||
if (append) {
|
||||
processedMessages.add(viewModel.items.first())
|
||||
processedMessages.add(items.first())
|
||||
} else {
|
||||
processedMessages.add(viewModel.items.last())
|
||||
processedMessages.add(items.last())
|
||||
}
|
||||
}
|
||||
|
||||
if (append) viewModel.items.addAll(processedMessages) else viewModel.items.addAll(0, processedMessages)
|
||||
if (append) items.addAll(processedMessages) else items.addAll(0, processedMessages)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@ -202,7 +252,7 @@ class ComposeChatAdapter(
|
||||
modifier = Modifier.padding(16.dp)
|
||||
) {
|
||||
stickyHeader {
|
||||
if (viewModel.items.size == 0) {
|
||||
if (items.size == 0) {
|
||||
Column(
|
||||
verticalArrangement = Arrangement.Center,
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
@ -211,11 +261,11 @@ class ComposeChatAdapter(
|
||||
ShimmerGroup()
|
||||
}
|
||||
} else {
|
||||
val timestamp = viewModel.items[listState.firstVisibleItemIndex].timestamp
|
||||
val timestamp = items[listState.firstVisibleItemIndex].timestamp
|
||||
val dateString = formatTime(timestamp * LONG_1000)
|
||||
val color = Color(viewModel.highEmphasisColorInt)
|
||||
val color = Color(highEmphasisColorInt)
|
||||
val backgroundColor =
|
||||
viewModel.context.resources.getColor(R.color.bg_message_list_incoming_bubble, null)
|
||||
LocalContext.current.resources.getColor(R.color.bg_message_list_incoming_bubble, null)
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.Absolute.Center,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
@ -229,8 +279,8 @@ class ComposeChatAdapter(
|
||||
.padding(8.dp)
|
||||
.shadow(
|
||||
16.dp,
|
||||
spotColor = viewModel.colorScheme.primary,
|
||||
ambientColor = viewModel.colorScheme.primary
|
||||
spotColor = colorScheme.primary,
|
||||
ambientColor = colorScheme.primary
|
||||
)
|
||||
.background(color = Color(backgroundColor), shape = RoundedCornerShape(8.dp))
|
||||
.padding(8.dp)
|
||||
@ -240,8 +290,8 @@ class ComposeChatAdapter(
|
||||
}
|
||||
}
|
||||
|
||||
items(viewModel.items) { message ->
|
||||
message.activeUser = viewModel.currentUser
|
||||
items(items) { message ->
|
||||
message.activeUser = currentUser
|
||||
when (val type = message.getCalculateMessageType()) {
|
||||
ChatMessage.MessageType.SYSTEM_MESSAGE -> {
|
||||
if (!message.shouldFilter()) {
|
||||
@ -284,7 +334,7 @@ class ComposeChatAdapter(
|
||||
}
|
||||
}
|
||||
|
||||
if (messageId != null && viewModel.items.size > 0) {
|
||||
if (messageId != null && items.size > 0) {
|
||||
LaunchedEffect(Dispatchers.Main) {
|
||||
delay(SCROLL_DELAY)
|
||||
val pos = searchMessages(messageId!!)
|
||||
@ -326,7 +376,7 @@ class ComposeChatAdapter(
|
||||
}
|
||||
|
||||
private fun searchMessages(searchId: String): Int {
|
||||
viewModel.items.forEachIndexed { index, message ->
|
||||
items.forEachIndexed { index, message ->
|
||||
if (message.id == searchId) return index
|
||||
}
|
||||
return -1
|
||||
@ -380,18 +430,18 @@ class ComposeChatAdapter(
|
||||
@Composable
|
||||
(RowScope.() -> Unit)
|
||||
) {
|
||||
val incoming = message.actorId != viewModel.currentUser.userId
|
||||
val incoming = message.actorId != currentUser.userId
|
||||
val color = if (incoming) {
|
||||
if (message.isDeleted) {
|
||||
viewModel.context.resources.getColor(R.color.bg_message_list_incoming_bubble_deleted, null)
|
||||
LocalContext.current.resources.getColor(R.color.bg_message_list_incoming_bubble_deleted, null)
|
||||
} else {
|
||||
viewModel.context.resources.getColor(R.color.bg_message_list_incoming_bubble, null)
|
||||
LocalContext.current.resources.getColor(R.color.bg_message_list_incoming_bubble, null)
|
||||
}
|
||||
} else {
|
||||
if (message.isDeleted) {
|
||||
ColorUtils.setAlphaComponent(viewModel.colorScheme.surfaceVariant.toArgb(), HALF_OPACITY)
|
||||
ColorUtils.setAlphaComponent(colorScheme.surfaceVariant.toArgb(), HALF_OPACITY)
|
||||
} else {
|
||||
viewModel.colorScheme.surfaceVariant.toArgb()
|
||||
colorScheme.surfaceVariant.toArgb()
|
||||
}
|
||||
}
|
||||
val shape = if (incoming) incomingShape else outgoingShape
|
||||
@ -405,7 +455,7 @@ class ComposeChatAdapter(
|
||||
if (incoming) {
|
||||
val imageUri = message.actorId?.let { viewModel.contactsViewModel.getImageUri(it, true) }
|
||||
val errorPlaceholderImage: Int = R.drawable.account_circle_96dp
|
||||
val loadedImage = loadImage(imageUri, viewModel.context, errorPlaceholderImage)
|
||||
val loadedImage = loadImage(imageUri, LocalContext.current, errorPlaceholderImage)
|
||||
AsyncImage(
|
||||
model = loadedImage,
|
||||
contentDescription = stringResource(R.string.user_avatar),
|
||||
@ -427,13 +477,13 @@ class ComposeChatAdapter(
|
||||
color = Color(color),
|
||||
shape = shape
|
||||
) {
|
||||
val timeString = DateUtils(viewModel.context).getLocalTimeStringFromTimestamp(message.timestamp)
|
||||
val timeString = DateUtils(LocalContext.current).getLocalTimeStringFromTimestamp(message.timestamp)
|
||||
val modifier = if (includePadding) Modifier.padding(8.dp, 4.dp, 8.dp, 4.dp) else Modifier
|
||||
Column(modifier = modifier) {
|
||||
if (message.parentMessageId != null && !message.isDeleted && messagesJson != null) {
|
||||
messagesJson!!
|
||||
.find { it.parentMessage?.id == message.parentMessageId }
|
||||
?.parentMessage!!.asModel().let { CommonMessageQuote(viewModel.context, it) }
|
||||
?.parentMessage!!.asModel().let { CommonMessageQuote(LocalContext.current, it) }
|
||||
}
|
||||
|
||||
if (incoming) {
|
||||
@ -470,8 +520,8 @@ class ComposeChatAdapter(
|
||||
private fun Modifier.withCustomAnimation(incoming: Boolean): Modifier {
|
||||
val infiniteTransition = rememberInfiniteTransition()
|
||||
val borderColor by infiniteTransition.animateColor(
|
||||
initialValue = viewModel.colorScheme.primary,
|
||||
targetValue = viewModel.colorScheme.background,
|
||||
initialValue = colorScheme.primary,
|
||||
targetValue = colorScheme.background,
|
||||
animationSpec = infiniteRepeatable(
|
||||
animation = tween(ANIMATED_BLINK, easing = LinearEasing),
|
||||
repeatMode = RepeatMode.Reverse
|
||||
@ -542,7 +592,7 @@ class ComposeChatAdapter(
|
||||
LoaderTextView(ctx).apply {
|
||||
layoutParams = LinearLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT)
|
||||
val color = if (outgoing) {
|
||||
viewModel.colorScheme.primary.toArgb()
|
||||
colorScheme.primary.toArgb()
|
||||
} else {
|
||||
resources.getColor(R.color.nc_shimmer_default_color, null)
|
||||
}
|
||||
@ -562,7 +612,7 @@ class ComposeChatAdapter(
|
||||
@Composable
|
||||
private fun EnrichedText(message: ChatMessage) {
|
||||
AndroidView(factory = { ctx ->
|
||||
val incoming = message.actorId != viewModel.currentUser.userId
|
||||
val incoming = message.actorId != currentUser.userId
|
||||
var processedMessageText = viewModel.messageUtils.enrichChatMessageText(
|
||||
ctx,
|
||||
message,
|
||||
@ -574,7 +624,7 @@ class ComposeChatAdapter(
|
||||
ctx, viewModel.viewThemeUtils, processedMessageText!!, message, null
|
||||
)
|
||||
|
||||
androidx.emoji2.widget.EmojiTextView(ctx).apply {
|
||||
EmojiTextView(ctx).apply {
|
||||
layoutParams = LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT)
|
||||
setLineSpacing(0F, LINE_SPACING)
|
||||
textAlignment = TEXT_ALIGNMENT_VIEW_START
|
||||
@ -592,14 +642,14 @@ class ComposeChatAdapter(
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun SystemMessage(message: ChatMessage) {
|
||||
fun SystemMessage(message: ChatMessage) {
|
||||
val similarMessages = sharedApplication!!.resources.getQuantityString(
|
||||
R.plurals.see_similar_system_messages,
|
||||
message.expandableChildrenAmount,
|
||||
message.expandableChildrenAmount
|
||||
)
|
||||
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
||||
val timeString = DateUtils(viewModel.context).getLocalTimeStringFromTimestamp(message.timestamp)
|
||||
val timeString = DateUtils(LocalContext.current).getLocalTimeStringFromTimestamp(message.timestamp)
|
||||
Row(horizontalArrangement = Arrangement.Absolute.Center, verticalAlignment = Alignment.CenterVertically) {
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
Text(
|
||||
@ -632,7 +682,7 @@ class ComposeChatAdapter(
|
||||
Text(
|
||||
text,
|
||||
fontSize = AUTHOR_TEXT_SIZE,
|
||||
color = Color(viewModel.highEmphasisColorInt)
|
||||
color = Color(highEmphasisColorInt)
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -640,14 +690,15 @@ class ComposeChatAdapter(
|
||||
@Composable
|
||||
private fun ImageMessage(message: ChatMessage, state: MutableState<Boolean>) {
|
||||
val hasCaption = (message.message != "{file}")
|
||||
val incoming = message.actorId != viewModel.currentUser.userId
|
||||
val timeString = DateUtils(viewModel.context).getLocalTimeStringFromTimestamp(message.timestamp)
|
||||
val incoming = message.actorId != currentUser.userId
|
||||
val timeString = DateUtils(LocalContext.current).getLocalTimeStringFromTimestamp(message.timestamp)
|
||||
CommonMessageBody(message, includePadding = false, playAnimation = state.value) {
|
||||
Column {
|
||||
message.activeUser = viewModel.currentUser
|
||||
message.activeUser = currentUser
|
||||
val imageUri = message.imageUrl
|
||||
val errorPlaceholderImage: Int = R.drawable.ic_mimetype_image
|
||||
val loadedImage = load(imageUri, viewModel.context, errorPlaceholderImage)
|
||||
val mimetype = message.selectedIndividualHashMap!![KEY_MIMETYPE]
|
||||
val drawableResourceId = getDrawableResourceIdForMimeType(mimetype)
|
||||
val loadedImage = load(imageUri, LocalContext.current, drawableResourceId)
|
||||
|
||||
AsyncImage(
|
||||
model = loadedImage,
|
||||
@ -717,8 +768,8 @@ class ComposeChatAdapter(
|
||||
WaveformSeekBar(ctx).apply {
|
||||
setWaveData(FloatArray(DEFAULT_WAVE_SIZE) { Random.nextFloat() }) // READ ONLY for now
|
||||
setColors(
|
||||
viewModel.colorScheme.inversePrimary.toArgb(),
|
||||
viewModel.colorScheme.onPrimaryContainer.toArgb()
|
||||
colorScheme.inversePrimary.toArgb(),
|
||||
colorScheme.onPrimaryContainer.toArgb()
|
||||
)
|
||||
}
|
||||
},
|
||||
@ -793,8 +844,8 @@ class ComposeChatAdapter(
|
||||
private fun LinkMessage(message: ChatMessage, state: MutableState<Boolean>) {
|
||||
val color = colorResource(R.color.high_emphasis_text)
|
||||
viewModel.chatViewModel.getOpenGraph(
|
||||
viewModel.currentUser.getCredentials(),
|
||||
viewModel.currentUser.baseUrl!!,
|
||||
currentUser.getCredentials(),
|
||||
currentUser.baseUrl!!,
|
||||
message.extractedUrlToPreview!!
|
||||
)
|
||||
CommonMessageBody(message, playAnimation = state.value) {
|
||||
@ -828,7 +879,7 @@ class ComposeChatAdapter(
|
||||
it.link?.let { Text(it, fontSize = TIME_TEXT_SIZE) }
|
||||
it.thumb?.let {
|
||||
val errorPlaceholderImage: Int = R.drawable.ic_mimetype_image
|
||||
val loadedImage = loadImage(it, viewModel.context, errorPlaceholderImage)
|
||||
val loadedImage = loadImage(it, LocalContext.current, errorPlaceholderImage)
|
||||
AsyncImage(
|
||||
model = loadedImage,
|
||||
contentDescription = stringResource(R.string.nc_sent_an_image),
|
||||
@ -882,7 +933,7 @@ class ComposeChatAdapter(
|
||||
|
||||
if (cardName?.isNotEmpty() == true) {
|
||||
val cardDescription = String.format(
|
||||
viewModel.context.resources.getString(R.string.deck_card_description),
|
||||
LocalContext.current.resources.getString(R.string.deck_card_description),
|
||||
stackName,
|
||||
boardName
|
||||
)
|
||||
@ -899,3 +950,44 @@ class ComposeChatAdapter(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview(showBackground = true, widthDp = 380, heightDp = 800)
|
||||
@Composable
|
||||
fun AllMessageTypesPreview() {
|
||||
val previewUtils = ComposePreviewUtils.getInstance(LocalContext.current)
|
||||
val adapter = remember { ComposeChatAdapter(messagesJson = null, messageId = null, previewUtils) }
|
||||
|
||||
val sampleMessages = remember {
|
||||
listOf(
|
||||
// Text Messages
|
||||
ChatMessage().apply {
|
||||
jsonMessageId = 1
|
||||
actorId = "user1"
|
||||
message = "I love Nextcloud"
|
||||
timestamp = System.currentTimeMillis()
|
||||
actorDisplayName = "User1"
|
||||
messageType = ChatMessage.MessageType.REGULAR_TEXT_MESSAGE.name
|
||||
},
|
||||
ChatMessage().apply {
|
||||
jsonMessageId = 2
|
||||
actorId = "user1_id"
|
||||
message = "I love Nextcloud"
|
||||
timestamp = System.currentTimeMillis()
|
||||
actorDisplayName = "User2"
|
||||
messageType = ChatMessage.MessageType.REGULAR_TEXT_MESSAGE.name
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
LaunchedEffect(sampleMessages) { // Use LaunchedEffect or similar to update state once
|
||||
if (adapter.items.isEmpty()) { // Prevent adding multiple times on recomposition
|
||||
adapter.addMessages(sampleMessages.toMutableList(), append = false) // Add messages
|
||||
}
|
||||
}
|
||||
|
||||
MaterialTheme(colorScheme = adapter.colorScheme) { // Use the (potentially faked) color scheme
|
||||
Box(modifier = Modifier.fillMaxSize()) { // Provide a container
|
||||
adapter.GetView() // Call the main Composable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,14 +7,16 @@
|
||||
|
||||
package com.nextcloud.talk.ui.dialog
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.ContextWrapper
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.os.Bundle
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
@ -42,9 +44,7 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
@ -94,6 +94,15 @@ class ContextChatCompose(val bundle: Bundle) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun Context.requireActivity(): Activity {
|
||||
var context = this
|
||||
while (context is ContextWrapper) {
|
||||
if (context is Activity) return context
|
||||
context = context.baseContext
|
||||
}
|
||||
throw IllegalStateException("No activity was present but it is required.")
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun GetDialogView(
|
||||
shouldDismiss: MutableState<Boolean>,
|
||||
@ -101,9 +110,11 @@ class ContextChatCompose(val bundle: Bundle) {
|
||||
contextViewModel: ContextChatComposeViewModel = ContextChatComposeViewModel()
|
||||
) {
|
||||
if (shouldDismiss.value) {
|
||||
context.requireActivity().requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
|
||||
return
|
||||
}
|
||||
|
||||
context.requireActivity().requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LOCKED
|
||||
val colorScheme = contextViewModel.viewThemeUtils.getColorScheme(context)
|
||||
MaterialTheme(colorScheme) {
|
||||
Dialog(
|
||||
@ -144,28 +155,28 @@ class ContextChatCompose(val bundle: Bundle) {
|
||||
val name = bundle.getString(BundleKeys.KEY_CONVERSATION_NAME)!!
|
||||
Text(name, fontSize = 24.sp)
|
||||
}
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
val cInt = context.resources.getColor(R.color.high_emphasis_text, null)
|
||||
Icon(
|
||||
painterResource(R.drawable.ic_call_black_24dp),
|
||||
"",
|
||||
tint = Color(cInt),
|
||||
modifier = Modifier
|
||||
.padding()
|
||||
.padding(end = 16.dp)
|
||||
.alpha(HALF_ALPHA)
|
||||
)
|
||||
|
||||
Icon(
|
||||
painterResource(R.drawable.ic_baseline_videocam_24),
|
||||
"",
|
||||
tint = Color(cInt),
|
||||
modifier = Modifier
|
||||
.padding()
|
||||
.alpha(HALF_ALPHA)
|
||||
)
|
||||
|
||||
ComposeChatMenu(colorScheme.background, false)
|
||||
// Spacer(modifier = Modifier.weight(1f))
|
||||
// val cInt = context.resources.getColor(R.color.high_emphasis_text, null)
|
||||
// Icon(
|
||||
// painterResource(R.drawable.ic_call_black_24dp),
|
||||
// "",
|
||||
// tint = Color(cInt),
|
||||
// modifier = Modifier
|
||||
// .padding()
|
||||
// .padding(end = 16.dp)
|
||||
// .alpha(HALF_ALPHA)
|
||||
// )
|
||||
//
|
||||
// Icon(
|
||||
// painterResource(R.drawable.ic_baseline_videocam_24),
|
||||
// "",
|
||||
// tint = Color(cInt),
|
||||
// modifier = Modifier
|
||||
// .padding()
|
||||
// .alpha(HALF_ALPHA)
|
||||
// )
|
||||
//
|
||||
// ComposeChatMenu(colorScheme.background, false)
|
||||
}
|
||||
if (shouldShow) {
|
||||
Icon(
|
||||
|
@ -118,7 +118,6 @@ class ConversationsListBottomDialog(
|
||||
currentUser.capabilities?.spreedCapability!!,
|
||||
SpreedFeatures.FAVORITES
|
||||
)
|
||||
val canModerate = ConversationUtils.canModerate(conversation, currentUser.capabilities?.spreedCapability!!)
|
||||
|
||||
binding.conversationRemoveFromFavorites.visibility = setVisibleIf(
|
||||
hasFavoritesCapability && conversation.favorite
|
||||
@ -149,14 +148,11 @@ class ConversationsListBottomDialog(
|
||||
)
|
||||
|
||||
binding.conversationOperationDelete.visibility = setVisibleIf(
|
||||
canModerate
|
||||
conversation.canDeleteConversation
|
||||
)
|
||||
|
||||
binding.conversationOperationLeave.visibility = setVisibleIf(
|
||||
conversation.canLeaveConversation &&
|
||||
// leaving is by api not possible for the last user with moderator permissions.
|
||||
// for now, hide this option for all moderators.
|
||||
!ConversationUtils.canModerate(conversation, currentUser.capabilities!!.spreedCapability!!)
|
||||
conversation.canLeaveConversation
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication
|
||||
import com.nextcloud.talk.chat.ChatActivity
|
||||
import com.nextcloud.talk.chat.data.model.ChatMessage
|
||||
import com.nextcloud.talk.data.database.model.SendStatus
|
||||
import com.nextcloud.talk.data.network.NetworkMonitor
|
||||
import com.nextcloud.talk.databinding.DialogTempMessageActionsBinding
|
||||
import com.nextcloud.talk.ui.theme.ViewThemeUtils
|
||||
@ -58,9 +59,10 @@ class TempMessageActionsDialog(
|
||||
|
||||
private fun initMenuItems() {
|
||||
this.lifecycleScope.launch {
|
||||
initResendMessage(message.sendingFailed && networkMonitor.isOnline.value)
|
||||
initMenuEditMessage(message.sendingFailed || !networkMonitor.isOnline.value)
|
||||
initMenuDeleteMessage(message.sendingFailed || !networkMonitor.isOnline.value)
|
||||
val sendingFailed = message.sendStatus == SendStatus.FAILED
|
||||
initResendMessage(sendingFailed && networkMonitor.isOnline.value)
|
||||
initMenuEditMessage(sendingFailed || !networkMonitor.isOnline.value)
|
||||
initMenuDeleteMessage(sendingFailed || !networkMonitor.isOnline.value)
|
||||
initMenuItemCopy()
|
||||
}
|
||||
}
|
||||
|
@ -205,6 +205,10 @@ object ApiUtils {
|
||||
return getUrlForParticipants(version, baseUrl, token) + "/active"
|
||||
}
|
||||
|
||||
fun getUrlForImportantConversation(baseUrl: String, roomToken: String): String {
|
||||
return "$baseUrl$OCS_API_VERSION/apps/spreed/api/v4/room/$roomToken/important"
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getUrlForParticipantsSelf(version: Int, baseUrl: String?, token: String?): String {
|
||||
return getUrlForParticipants(version, baseUrl, token) + "/self"
|
||||
@ -449,6 +453,10 @@ object ApiUtils {
|
||||
return "$baseUrl$OCS_API_VERSION/cloud/users/search/by-phone"
|
||||
}
|
||||
|
||||
fun getUrlForUnbindingRoom(baseUrl: String, roomToken: String): String {
|
||||
return "$baseUrl/ocs/v2.php/apps/spreed/api/v4/room/$roomToken/object"
|
||||
}
|
||||
|
||||
fun getUrlForFileUpload(baseUrl: String, user: String, remotePath: String): String {
|
||||
return "$baseUrl/remote.php/dav/files/$user$remotePath"
|
||||
}
|
||||
@ -473,6 +481,10 @@ object ApiUtils {
|
||||
return "$baseUrl$OCS_API_VERSION/apps/spreed/temp-user-avatar"
|
||||
}
|
||||
|
||||
fun getUrlForSensitiveConversation(baseUrl: String, roomToken: String): String {
|
||||
return "$baseUrl$OCS_API_VERSION/apps/spreed/api/v4/room/$roomToken/sensitive"
|
||||
}
|
||||
|
||||
fun getUrlForUserFields(baseUrl: String): String {
|
||||
return "$baseUrl$OCS_API_VERSION/cloud/user/fields"
|
||||
}
|
||||
@ -625,4 +637,8 @@ object ApiUtils {
|
||||
fun getUrlForChatMessageContext(baseUrl: String, token: String, messageId: String): String {
|
||||
return "$baseUrl$OCS_API_VERSION$SPREED_API_VERSION/chat/$token/$messageId/context"
|
||||
}
|
||||
|
||||
fun getUrlForProfile(baseUrl: String, userId: String): String {
|
||||
return "$baseUrl$OCS_API_VERSION/profile/$userId"
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Nextcloud Talk - Android Client
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2025 Marcel Hibbe <dev@mhibbe.de>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
package com.nextcloud.talk.utils
|
||||
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
import androidx.activity.SystemBarStyle
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
||||
/**
|
||||
* This method is similar to "adjustUIForAPILevel35" in
|
||||
* AppCompatActivityExtensions.kt in https://github.com/nextcloud/android-common/
|
||||
* Only window.addSystemBarPaddings() had to be removed. This could be unified again at some point.
|
||||
*/
|
||||
@JvmOverloads
|
||||
fun AppCompatActivity.adjustUIForAPILevel35(
|
||||
statusBarStyle: SystemBarStyle = SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT),
|
||||
// It may make sense to change navigationBarStyle to "SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT)"
|
||||
// For now, it is set to "light" to have a fully transparent navigation bar to align with the XML screens.
|
||||
// It may be wanted to have a semi transparent navigation bar in the future. Then set it to "auto" and try to
|
||||
// migrate the XML screens to Compose (having semi transparent navigation bar for XML did not work out. In
|
||||
// general, supporting both XML and Compose system bar handling is a pain and we will have it easier without XML)
|
||||
// So in short: migrate all screens to Compose. Then it's easier to decide if navigation bar should be semi
|
||||
// transparent or not for all screens.
|
||||
navigationBarStyle: SystemBarStyle = SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT)
|
||||
) {
|
||||
val isApiLevel35OrHigher = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM)
|
||||
if (!isApiLevel35OrHigher) {
|
||||
return
|
||||
}
|
||||
enableEdgeToEdge(statusBarStyle, navigationBarStyle)
|
||||
}
|
@ -57,7 +57,10 @@ enum class SpreedFeatures(val value: String) {
|
||||
BAN_V1("ban-v1"),
|
||||
EDIT_MESSAGES_NOTE_TO_SELF("edit-messages-note-to-self"),
|
||||
ARCHIVE_CONVERSATIONS("archived-conversations-v2"),
|
||||
CONVERSATION_CREATION_ALL("conversation-creation-all")
|
||||
CONVERSATION_CREATION_ALL("conversation-creation-all"),
|
||||
UNBIND_CONVERSATION("unbind-conversation"),
|
||||
SENSITIVE_CONVERSATIONS("sensitive-conversations"),
|
||||
IMPORTANT_CONVERSATIONS("important-conversations")
|
||||
}
|
||||
|
||||
@Suppress("TooManyFunctions")
|
||||
@ -140,6 +143,36 @@ object CapabilitiesUtil {
|
||||
return false
|
||||
}
|
||||
|
||||
fun retentionOfEventRooms(spreedCapabilities: SpreedCapability): Int {
|
||||
if (spreedCapabilities.config?.containsKey("conversations") == true) {
|
||||
val map = spreedCapabilities.config!!["conversations"]
|
||||
if (map?.containsKey("retention-event") == true) {
|
||||
return map["retention-event"].toString().toInt()
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
fun retentionOfSIPRoom(spreedCapabilities: SpreedCapability): Int {
|
||||
if (spreedCapabilities.config?.containsKey("conversations") == true) {
|
||||
val map = spreedCapabilities.config!!["conversations"]
|
||||
if (map?.containsKey("retention-phone") == true) {
|
||||
return map["retention-phone"].toString().toInt()
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
fun retentionOfInstantMeetingRoom(spreedCapabilities: SpreedCapability): Int {
|
||||
if (spreedCapabilities.config?.containsKey("conversations") == true) {
|
||||
val map = spreedCapabilities.config!!["conversations"]
|
||||
if (map?.containsKey("retention-instant-meetings") == true) {
|
||||
return map["retention-instant-meetings"].toString().toInt()
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun isCallRecordingAvailable(spreedCapabilities: SpreedCapability): Boolean {
|
||||
if (hasSpreedFeatureCapability(spreedCapabilities, SpreedFeatures.RECORDING_V1) &&
|
||||
|
@ -36,6 +36,7 @@ import com.nextcloud.talk.utils.Mimetype.AUDIO_MPEG
|
||||
import com.nextcloud.talk.utils.Mimetype.AUDIO_OGG
|
||||
import com.nextcloud.talk.utils.Mimetype.AUDIO_WAV
|
||||
import com.nextcloud.talk.utils.Mimetype.IMAGE_GIF
|
||||
import com.nextcloud.talk.utils.Mimetype.IMAGE_HEIC
|
||||
import com.nextcloud.talk.utils.Mimetype.IMAGE_JPEG
|
||||
import com.nextcloud.talk.utils.Mimetype.IMAGE_PNG
|
||||
import com.nextcloud.talk.utils.Mimetype.TEXT_MARKDOWN
|
||||
@ -155,7 +156,8 @@ class FileViewerUtils(private val context: Context, private val user: User) {
|
||||
-> openMediaView(filename, mimetype)
|
||||
IMAGE_PNG,
|
||||
IMAGE_JPEG,
|
||||
IMAGE_GIF
|
||||
IMAGE_GIF,
|
||||
IMAGE_HEIC
|
||||
-> openImageView(filename, mimetype)
|
||||
TEXT_MARKDOWN,
|
||||
TEXT_PLAIN
|
||||
@ -248,6 +250,7 @@ class FileViewerUtils(private val context: Context, private val user: User) {
|
||||
return when (mimetype) {
|
||||
IMAGE_PNG,
|
||||
IMAGE_JPEG,
|
||||
IMAGE_HEIC,
|
||||
IMAGE_GIF,
|
||||
AUDIO_MPEG,
|
||||
AUDIO_WAV,
|
||||
|
@ -22,6 +22,7 @@ object Mimetype {
|
||||
const val IMAGE_JPEG = "image/jpeg"
|
||||
const val IMAGE_JPG = "image/jpg"
|
||||
const val IMAGE_GIF = "image/gif"
|
||||
const val IMAGE_HEIC = "image/heic"
|
||||
|
||||
const val VIDEO_MP4 = "video/mp4"
|
||||
const val VIDEO_QUICKTIME = "video/quicktime"
|
||||
|
@ -81,4 +81,5 @@ object BundleKeys {
|
||||
const val KEY_FIELD_MAP: String = "KEY_FIELD_MAP"
|
||||
const val KEY_CHAT_URL: String = "KEY_CHAT_URL"
|
||||
const val KEY_SCROLL_TO_NOTIFICATION_CATEGORY: String = "KEY_SCROLL_TO_NOTIFICATION_CATEGORY"
|
||||
const val KEY_FOCUS_INPUT: String = "KEY_FOCUS_INPUT"
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user