diff --git a/app/src/main/java/com/vitorpamplona/amethyst/model/User.kt b/app/src/main/java/com/vitorpamplona/amethyst/model/User.kt index 33a8656cb..e6cc99f63 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/model/User.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/model/User.kt @@ -13,8 +13,10 @@ import java.util.concurrent.atomic.AtomicBoolean import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job +import kotlinx.coroutines.NonCancellable import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import nostr.postr.events.ContactListEvent import nostr.postr.events.MetadataEvent import nostr.postr.toNpub @@ -43,6 +45,7 @@ class User(val pubkeyHex: String) { var reports = mapOf>() private set + var latestReportTime: Long = 0 var zaps = mapOf() private set @@ -140,6 +143,11 @@ class User(val pubkeyHex: String) { reports = reports + Pair(author, (reports[author] ?: emptySet()) + note) liveReports.invalidateData() } + + val reportTime = note.event?.createdAt ?: 0 + if (reportTime > latestReportTime) { + latestReportTime = reportTime + } } fun addZap(zapRequest: Note, zap: Note?) {