Merge pull request #967 from vector-im/feature/bma/detektConfig
Update detekt config.
This commit is contained in:
@@ -23,17 +23,15 @@ import io.element.android.libraries.matrix.api.core.SessionId
|
||||
* Data class to hold information about a group of notifications for a room.
|
||||
*/
|
||||
data class RoomEventGroupInfo(
|
||||
val sessionId: SessionId,
|
||||
val roomId: RoomId,
|
||||
val roomDisplayName: String,
|
||||
val isDirect: Boolean = false
|
||||
) {
|
||||
val sessionId: SessionId,
|
||||
val roomId: RoomId,
|
||||
val roomDisplayName: String,
|
||||
val isDirect: Boolean = false,
|
||||
// An event in the list has not yet been display
|
||||
var hasNewEvent: Boolean = false
|
||||
|
||||
val hasNewEvent: Boolean = false,
|
||||
// true if at least one on the not yet displayed event is noisy
|
||||
var shouldBing: Boolean = false
|
||||
var customSound: String? = null
|
||||
var hasSmartReplyError: Boolean = false
|
||||
var isUpdated: Boolean = false
|
||||
}
|
||||
val shouldBing: Boolean = false,
|
||||
val customSound: String? = null,
|
||||
val hasSmartReplyError: Boolean = false,
|
||||
val isUpdated: Boolean = false,
|
||||
)
|
||||
|
||||
@@ -85,12 +85,11 @@ class RoomGroupMessageCreator @Inject constructor(
|
||||
roomId = roomId,
|
||||
roomDisplayName = roomName,
|
||||
isDirect = !roomIsGroup,
|
||||
).also {
|
||||
it.hasSmartReplyError = smartReplyErrors.isNotEmpty()
|
||||
it.shouldBing = meta.shouldBing
|
||||
it.customSound = events.last().soundName
|
||||
it.isUpdated = events.last().isUpdated
|
||||
},
|
||||
hasSmartReplyError = smartReplyErrors.isNotEmpty(),
|
||||
shouldBing = meta.shouldBing,
|
||||
customSound = events.last().soundName,
|
||||
isUpdated = events.last().isUpdated,
|
||||
),
|
||||
threadId = lastKnownRoomEvent.threadId,
|
||||
largeIcon = largeBitmap,
|
||||
lastMessageTimestamp,
|
||||
|
||||
@@ -30,7 +30,7 @@ data class SimpleNotifiableEvent(
|
||||
val type: String?,
|
||||
val timestamp: Long,
|
||||
val soundName: String?,
|
||||
override var canBeReplaced: Boolean,
|
||||
override val canBeReplaced: Boolean,
|
||||
override val isRedacted: Boolean = false,
|
||||
override val isUpdated: Boolean = false
|
||||
) : NotifiableEvent
|
||||
|
||||
@@ -100,15 +100,15 @@ class DefaultPushHandler @Inject constructor(
|
||||
}
|
||||
|
||||
val clientSecret = pushData.clientSecret
|
||||
val userId = if (clientSecret == null) {
|
||||
// Should not happen. In this case, restore default session
|
||||
null
|
||||
} else {
|
||||
// Get userId from client secret
|
||||
pushClientSecret.getUserIdFromSecret(clientSecret)
|
||||
} ?: run {
|
||||
matrixAuthenticationService.getLatestSessionId()
|
||||
}
|
||||
// clientSecret should not be null. If this happens, restore default session
|
||||
val userId = clientSecret
|
||||
?.let {
|
||||
// Get userId from client secret
|
||||
pushClientSecret.getUserIdFromSecret(clientSecret)
|
||||
}
|
||||
?: run {
|
||||
matrixAuthenticationService.getLatestSessionId()
|
||||
}
|
||||
|
||||
if (userId == null) {
|
||||
Timber.w("Unable to get a session")
|
||||
|
||||
@@ -25,7 +25,7 @@ class NotificationIdProviderTest {
|
||||
@Test
|
||||
fun `test notification id provider`() {
|
||||
val sut = NotificationIdProvider()
|
||||
val offsetForASessionId = 305410
|
||||
val offsetForASessionId = 305_410
|
||||
assertThat(sut.getSummaryNotificationId(A_SESSION_ID)).isEqualTo(offsetForASessionId + 0)
|
||||
assertThat(sut.getRoomMessagesNotificationId(A_SESSION_ID)).isEqualTo(offsetForASessionId + 1)
|
||||
assertThat(sut.getRoomEventNotificationId(A_SESSION_ID)).isEqualTo(offsetForASessionId + 2)
|
||||
|
||||
Reference in New Issue
Block a user