Blocks double retweets.

pull/37/head
Vitor Pamplona 2023-01-25 11:00:17 -03:00
rodzic 12e5ebeb84
commit 857a31faf0
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -122,6 +122,15 @@ class Account(
fun boost(note: Note) {
if (!isWriteable()) return
val currentTime = Date().time / 1000
if (
note.boosts.firstOrNull { it.author == userProfile() && (it?.event?.createdAt ?: 0) > currentTime - (60 * 5)} != null // 5 minute protection
) {
// has already bosted in the past 5mins
return
}
note.event?.let {
val event = RepostEvent.create(it, loggedIn.privKey!!)
Client.send(event)