This commit is contained in:
Andrew
2024-02-19 01:23:06 +10:30
parent 2e50dc08bb
commit 398b5bf7b4
21 changed files with 156 additions and 268 deletions

View File

@@ -14,3 +14,5 @@ sealed class ExpiryMode(val expirySeconds: Long) {
fun coerceSendToRead(coerce: Boolean = true) = if (coerce && this is AfterSend) AfterRead(expirySeconds) else this
}
fun afterSend(seconds: Long) = seconds.takeIf { it > 0 }?.let(ExpiryMode::AfterSend) ?: ExpiryMode.NONE