fix: Respect ignore DUPLICATE_URIS flag

This commit is contained in:
Artem Chepurnoy 2024-06-01 21:28:21 +03:00
parent eb6b0877d8
commit a1feeb495a
No known key found for this signature in database
GPG Key ID: FAC37D0CF674043E
1 changed files with 7 additions and 0 deletions

View File

@ -1247,6 +1247,9 @@ sealed interface DFilter {
val cipherUrlDuplicateCheck = directDI.instance<CipherUrlDuplicateCheck>() val cipherUrlDuplicateCheck = directDI.instance<CipherUrlDuplicateCheck>()
ciphers ciphers
.filter { cipher -> .filter { cipher ->
if (shouldIgnore(cipher)) {
return@filter false
}
val uris = cipher.uris val uris = cipher.uris
if (uris.isEmpty()) { if (uris.isEmpty()) {
return@filter false return@filter false
@ -1273,6 +1276,10 @@ sealed interface DFilter {
false false
} }
} }
private fun shouldIgnore(
cipher: DSecret,
) = cipher.ignores(DWatchtowerAlertType.DUPLICATE_URIS)
} }
@Serializable @Serializable