Update strings

This commit is contained in:
yostyle
2023-08-08 10:46:17 +02:00
parent 8bf5b57c56
commit 4ce6f3d4ad
3 changed files with 10 additions and 8 deletions

View File

@@ -17,7 +17,10 @@
package io.element.android.features.roomdetails.impl.notificationsettings
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import io.element.android.features.roomdetails.impl.R
import io.element.android.libraries.matrix.api.room.RoomNotificationMode
import io.element.android.libraries.ui.strings.CommonStrings
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList
@@ -33,15 +36,15 @@ fun roomNotificationSettingsItems(): ImmutableList<RoomNotificationSettingsItem>
when (it) {
RoomNotificationMode.ALL_MESSAGES -> RoomNotificationSettingsItem(
mode = it,
title = "All messages",
title = stringResource(R.string.screen_room_notification_settings_mode_all_messages),
)
RoomNotificationMode.MENTIONS_AND_KEYWORDS_ONLY -> RoomNotificationSettingsItem(
mode = it,
title = "Mentions and keywords",
title = stringResource(R.string.screen_room_notification_settings_mode_mentions_and_keywords),
)
RoomNotificationMode.MUTE -> RoomNotificationSettingsItem(
mode = it,
title = "Mute",
title = stringResource(CommonStrings.common_mute),
)
}
}

View File

@@ -103,9 +103,10 @@ class RustMatrixClient constructor(
private val notificationClient = client.notificationClient().use { builder ->
builder.filterByPushRules().finish()
}
private val notificationSettings = client.getNotificationSettings()
private val notificationService = RustNotificationService(sessionId, notificationClient, dispatchers, clock)
private val notificationSettingsService = RustNotificationSettingsService(client)
private val notificationSettingsService = RustNotificationSettingsService(notificationSettings)
private val isLoggingOut = AtomicBoolean(false)

View File

@@ -25,16 +25,14 @@ import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.asSharedFlow
import org.matrix.rustcomponents.sdk.Client
import org.matrix.rustcomponents.sdk.NotificationClient
import org.matrix.rustcomponents.sdk.NotificationSettings
import org.matrix.rustcomponents.sdk.NotificationSettingsDelegate
import timber.log.Timber
class RustNotificationSettingsService(
private val client: Client,
private val notificationSettings: NotificationSettings
) : NotificationSettingsService {
private val notificationSettings: NotificationSettings = client.getNotificationSettings()
private val _notificationSettingsChangeFlow = MutableSharedFlow<Unit>(extraBufferCapacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST)
override val notificationSettingsChangeFlow: SharedFlow<Unit> = _notificationSettingsChangeFlow.asSharedFlow()