NotificationServiceImpl

class NotificationServiceImpl(roomService: RoomService, roomStateStore: RoomStateStore, roomAccountDataStore: RoomAccountDataStore, globalAccountDataStore: GlobalAccountDataStore, accountStore: AccountStore, notificationStore: NotificationStore, api: MatrixClientServerApiClient, matrixClientStarted: MatrixClientStarted, eventContentSerializerMappings: EventContentSerializerMappings, config: MatrixClientConfiguration, eventsToNotificationUpdates: EventsToNotificationUpdates, coroutineScope: CoroutineScope) : NotificationService, EventHandler

Constructors

Link copied to clipboard
constructor(roomService: RoomService, roomStateStore: RoomStateStore, roomAccountDataStore: RoomAccountDataStore, globalAccountDataStore: GlobalAccountDataStore, accountStore: AccountStore, notificationStore: NotificationStore, api: MatrixClientServerApiClient, matrixClientStarted: MatrixClientStarted, eventContentSerializerMappings: EventContentSerializerMappings, config: MatrixClientConfiguration, eventsToNotificationUpdates: EventsToNotificationUpdates, coroutineScope: CoroutineScope)

Functions

Link copied to clipboard
open suspend override fun dismiss(id: String)

Mark the notification as dismissed.

Link copied to clipboard
open suspend override fun dismissAll()

Dismiss all notifications.

Link copied to clipboard
open override fun getAll(): Flow<List<Flow<Notification?>>>

Get all notifications.

Link copied to clipboard
open override fun getAllUpdates(): Flow<NotificationUpdate>

Get all notification updates. This returns an empty flow, when MatrixClientConfiguration.enableExternalNotifications is not enabled.

Link copied to clipboard
open override fun getById(id: String): Flow<Notification?>

Notification by id, or null if not available.

Link copied to clipboard
open override fun getCount(): Flow<Int>

Total notification count across all rooms.

open override fun getCount(roomId: RoomId): Flow<Int>

Notification count for the given room.

Link copied to clipboard
open override fun getNotifications(response: Sync.Response, decryptionTimeout: Duration): Flow<NotificationService.Notification>
open override fun getNotifications(decryptionTimeout: Duration, syncResponseBufferSize: Int): Flow<NotificationService.Notification>
Link copied to clipboard
open override fun isUnread(roomId: RoomId): Flow<Boolean>

Returns true if the room is considered unread. This does not mean that there is any notification for the room. A room is considered unread, when the last read event is before Room.lastRelevantEventId or MarkedUnreadEventContent is set.

Link copied to clipboard
open suspend override fun onPush(roomId: RoomId, eventId: EventId?): Boolean

Handle a push for a room/event.

Link copied to clipboard
open suspend override fun processPending()

Process possibly pending notifications from sync or push if needed. This may suspend for a long time (e.g., when the network is not available but a sync is needed).

Link copied to clipboard
open fun startInCoroutineScope(scope: CoroutineScope)