Merge pull request #2142 from famedly/krille/set-unread-notification-only-when-not-null
fix: Set unread notification count only if not null in sync
This commit is contained in:
commit
28b6f9d475
|
|
@ -18,11 +18,7 @@ jobs:
|
||||||
- uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
|
- uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46
|
||||||
with:
|
with:
|
||||||
sdk: ${{ env.dart_version }}
|
sdk: ${{ env.dart_version }}
|
||||||
- uses: famedly/backend-build-workflows/.github/actions/rust-prepare@main
|
- uses: famedly/backend-build-workflows/.github/actions/rust-prepare@v4
|
||||||
with:
|
|
||||||
gitlab_user: ${{ secrets.GITLAB_USER }}
|
|
||||||
gitlab_pass: ${{ secrets.GITLAB_PASS }}
|
|
||||||
gitlab_ssh: ${{ secrets.CI_SSH_PRIVATE_KEY}}
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
export HOMESERVER_IMPLEMENTATION=${{matrix.homeserver}}
|
export HOMESERVER_IMPLEMENTATION=${{matrix.homeserver}}
|
||||||
|
|
@ -68,11 +64,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
sdk: ${{ env.dart_version }}
|
sdk: ${{ env.dart_version }}
|
||||||
#architecture: "arm64"
|
#architecture: "arm64"
|
||||||
- uses: famedly/backend-build-workflows/.github/actions/rust-prepare@main
|
- uses: famedly/backend-build-workflows/.github/actions/rust-prepare@v4
|
||||||
with:
|
|
||||||
gitlab_user: ${{ secrets.GITLAB_USER }}
|
|
||||||
gitlab_pass: ${{ secrets.GITLAB_PASS }}
|
|
||||||
gitlab_ssh: ${{ secrets.CI_SSH_PRIVATE_KEY}}
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update && sudo apt-get install --no-install-recommends --no-install-suggests -y lcov libsqlite3-0 libsqlite3-dev libssl3
|
sudo apt-get update && sudo apt-get install --no-install-recommends --no-install-suggests -y lcov libsqlite3-0 libsqlite3-dev libssl3
|
||||||
|
|
|
||||||
|
|
@ -2979,10 +2979,13 @@ class Client extends MatrixApi {
|
||||||
rooms[roomIndex].prev_batch = chatUpdate.timeline?.prevBatch;
|
rooms[roomIndex].prev_batch = chatUpdate.timeline?.prevBatch;
|
||||||
}
|
}
|
||||||
rooms[roomIndex].membership = membership;
|
rooms[roomIndex].membership = membership;
|
||||||
rooms[roomIndex].notificationCount =
|
|
||||||
chatUpdate.unreadNotifications?.notificationCount ?? 0;
|
if (chatUpdate.unreadNotifications != null) {
|
||||||
rooms[roomIndex].highlightCount =
|
rooms[roomIndex].notificationCount =
|
||||||
chatUpdate.unreadNotifications?.highlightCount ?? 0;
|
chatUpdate.unreadNotifications?.notificationCount ?? 0;
|
||||||
|
rooms[roomIndex].highlightCount =
|
||||||
|
chatUpdate.unreadNotifications?.highlightCount ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
final summary = chatUpdate.summary;
|
final summary = chatUpdate.summary;
|
||||||
if (summary != null) {
|
if (summary != null) {
|
||||||
|
|
|
||||||
|
|
@ -295,6 +295,8 @@ void main() {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
expect(room.hasNewMessages, true);
|
expect(room.hasNewMessages, true);
|
||||||
|
expect(room.isUnreadOrInvited, true);
|
||||||
|
room.notificationCount = room.highlightCount = 0;
|
||||||
expect(room.isUnreadOrInvited, false);
|
expect(room.isUnreadOrInvited, false);
|
||||||
expect(room.lastEvent?.body, 'cd');
|
expect(room.lastEvent?.body, 'cd');
|
||||||
await updateLastEvent(
|
await updateLastEvent(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue