Adds isExpired method in events.

This commit is contained in:
Vitor Pamplona 2023-08-24 15:56:43 -04:00
parent ee97eac00c
commit fe6fb8470d
3 changed files with 4 additions and 1 deletions

View File

@ -1276,7 +1276,7 @@ object LocalCache {
val now = TimeUtils.now()
val toBeRemoved = notes.filter {
(it.value.event?.expiration() ?: Long.MAX_VALUE) < now
it.value.event?.isExpired() == true
}.values
val childrenToBeRemoved = mutableListOf<Note>()

View File

@ -126,6 +126,8 @@ open class Event(
null
}
override fun isExpired() = (expiration() ?: Long.MAX_VALUE) < TimeUtils.now()
override fun getTagOfAddressableKind(kind: Int): ATag? {
val kindStr = kind.toString()
val aTag = tags

View File

@ -70,4 +70,5 @@ interface EventInterface {
fun taggedEmojis(): List<EmojiUrl>
fun matchTag1With(text: String): Boolean
fun isExpired(): Boolean
}