Let MatrixClient exposes val instead of fun for the services.
This commit is contained in:
parent
68700d9bf9
commit
77647a3f11
27 changed files with 129 additions and 155 deletions
|
|
@ -50,7 +50,7 @@ class DefaultPusherSubscriber(
|
|||
Timber.tag(loggerTag.value)
|
||||
.d("Unnecessary to register again the same pusher, but do it in case the pusher has been removed from the server")
|
||||
}
|
||||
return matrixClient.pushersService()
|
||||
return matrixClient.pushersService
|
||||
.setHttpPusher(
|
||||
createHttpPusher(pushKey, gateway, matrixClient.sessionId)
|
||||
)
|
||||
|
|
@ -100,7 +100,7 @@ class DefaultPusherSubscriber(
|
|||
gateway: String,
|
||||
): Result<Unit> {
|
||||
val userDataStore = userPushStoreFactory.getOrCreate(matrixClient.sessionId)
|
||||
return matrixClient.pushersService()
|
||||
return matrixClient.pushersService
|
||||
.unsetHttpPusher(
|
||||
unsetHttpPusherData = UnsetHttpPusherData(
|
||||
pushKey = pushKey,
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class DefaultNotifiableEventResolver(
|
|||
val ids = notificationEventRequests.groupBy { it.roomId }.mapValues { (_, value) -> value.map { it.eventId } }
|
||||
|
||||
// TODO this notificationData is not always valid at the moment, sometimes the Rust SDK can't fetch the matching event
|
||||
val notificationsResult = client.notificationService().getNotifications(ids)
|
||||
val notificationsResult = client.notificationService.getNotifications(ids)
|
||||
|
||||
if (notificationsResult.isFailure) {
|
||||
val exception = notificationsResult.exceptionOrNull()
|
||||
|
|
@ -131,7 +131,7 @@ class DefaultNotifiableEventResolver(
|
|||
): Result<ResolvedPushEvent> = runCatchingExceptions {
|
||||
when (val content = this.content) {
|
||||
is NotificationContent.MessageLike.RoomMessage -> {
|
||||
val showMediaPreview = client.mediaPreviewService().getMediaPreviewValue() == MediaPreviewValue.On
|
||||
val showMediaPreview = client.mediaPreviewService.getMediaPreviewValue() == MediaPreviewValue.On
|
||||
val senderDisambiguatedDisplayName = getDisambiguatedDisplayName(content.senderId)
|
||||
val messageBody = descriptionFromMessageContent(content, senderDisambiguatedDisplayName)
|
||||
val notifiableMessageEvent = buildNotifiableMessageEvent(
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class DefaultOnMissedCallNotificationHandler(
|
|||
) {
|
||||
// Resolve the event and add a notification for it, at this point it should no longer be a ringing one
|
||||
val notificationData = matrixClientProvider.getOrRestore(sessionId).getOrNull()
|
||||
?.notificationService()
|
||||
?.notificationService
|
||||
?.getNotifications(mapOf(roomId to listOf(eventId)))
|
||||
?.getOrNull()
|
||||
?.get(eventId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue