mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 03:06:14 +00:00
Add total unread notification count to home screen (#7891)
* Add total unread notification count to home screen This will be calculated on each sync heartbeat (for now, using the state updates for the room list service). * Simplify `counter` parameter logic * Read the total unread count when the home screen is first displayed --------- Co-authored-by: Benoit Marty <benoitm@element.io>
This commit is contained in:
committed by
GitHub
parent
50aa723f63
commit
9cc5cf9a01
+6
@@ -505,6 +505,12 @@ interface MatrixClient : ClientUrlContentFetcher {
|
||||
|
||||
/** Returns a provider for the capabilities the homeserver advertises, such as whether the display name can be changed. */
|
||||
fun homeserverCapabilities(): HomeserverCapabilitiesProvider
|
||||
|
||||
/**
|
||||
* Returns the total number of unread notifications across all rooms, as currently known by the client.
|
||||
* This is a snapshot and may be out of date if the sync is running.
|
||||
*/
|
||||
fun totalUnreadCount(): Result<Long>
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+7
@@ -8,6 +8,7 @@
|
||||
|
||||
package io.element.android.libraries.matrix.api.sync
|
||||
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
|
||||
/**
|
||||
@@ -37,4 +38,10 @@ interface SyncService {
|
||||
* This is `false` only while the state is [SyncState.Offline]; an idle or errored sync still counts as online.
|
||||
*/
|
||||
val isOnline: StateFlow<Boolean>
|
||||
|
||||
/**
|
||||
* Flow that will emit every time the sync has received a response from the server, even if it was empty.
|
||||
* Useful for triggering UI updates when the sync is running.
|
||||
*/
|
||||
val heartBeat: Flow<Unit>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user