Allow uploading notification push rules in bug reports (#5538)
* Allow uploading push rules in bug reports * Improve bug report screen previews * Update screenshots --------- Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
parent
35cf3aeb0b
commit
5b1bfac6ff
34 changed files with 116 additions and 38 deletions
|
|
@ -13,6 +13,7 @@ import io.element.android.libraries.core.bool.orFalse
|
|||
@Suppress("ktlint:standard:property-naming")
|
||||
object MimeTypes {
|
||||
const val Any: String = "*/*"
|
||||
const val Json = "application/json"
|
||||
const val OctetStream = "application/octet-stream"
|
||||
const val Apk = "application/vnd.android.package-archive"
|
||||
const val Pdf = "application/pdf"
|
||||
|
|
|
|||
|
|
@ -33,4 +33,5 @@ interface NotificationSettingsService {
|
|||
suspend fun setInviteForMeEnabled(enabled: Boolean): Result<Unit>
|
||||
suspend fun getRoomsWithUserDefinedRules(): Result<List<String>>
|
||||
suspend fun canHomeServerPushEncryptedEventsToDevice(): Result<Boolean>
|
||||
suspend fun getRawPushRules(): Result<String?>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,4 +139,8 @@ class RustNotificationSettingsService(
|
|||
runCatchingExceptions {
|
||||
notificationSettings.await().canPushEncryptedEventToDevice()
|
||||
}
|
||||
|
||||
override suspend fun getRawPushRules(): Result<String?> = runCatchingExceptions {
|
||||
notificationSettings.await().getRawPushRules()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import io.element.android.libraries.matrix.api.room.RoomNotificationMode
|
|||
import io.element.android.libraries.matrix.api.room.RoomNotificationSettings
|
||||
import io.element.android.libraries.matrix.test.A_ROOM_ID
|
||||
import io.element.android.libraries.matrix.test.A_ROOM_NOTIFICATION_MODE
|
||||
import io.element.android.tests.testutils.lambda.lambdaError
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.SharedFlow
|
||||
|
||||
|
|
@ -23,6 +24,7 @@ class FakeNotificationSettingsService(
|
|||
initialEncryptedGroupDefaultMode: RoomNotificationMode = RoomNotificationMode.MENTIONS_AND_KEYWORDS_ONLY,
|
||||
initialOneToOneDefaultMode: RoomNotificationMode = RoomNotificationMode.ALL_MESSAGES,
|
||||
initialEncryptedOneToOneDefaultMode: RoomNotificationMode = RoomNotificationMode.ALL_MESSAGES,
|
||||
private val getRawPushRulesResult: () -> Result<String> = { lambdaError() },
|
||||
) : NotificationSettingsService {
|
||||
private val notificationSettingsStateFlow = MutableStateFlow(Unit)
|
||||
private var defaultGroupRoomNotificationMode: RoomNotificationMode = initialGroupDefaultMode
|
||||
|
|
@ -178,4 +180,8 @@ class FakeNotificationSettingsService(
|
|||
fun givenCanHomeServerPushEncryptedEventsToDeviceResult(result: Result<Boolean>) {
|
||||
canHomeServerPushEncryptedEventsToDeviceResult = result
|
||||
}
|
||||
|
||||
override suspend fun getRawPushRules(): Result<String?> {
|
||||
return getRawPushRulesResult()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue