mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-04-01 00:18:30 +02:00
Blocks double likes.
This commit is contained in:
parent
594795fc16
commit
0001ae441f
@ -22,6 +22,11 @@ class Account(val loggedIn: Persona) {
|
||||
fun reactTo(note: Note) {
|
||||
if (!isWriteable()) return
|
||||
|
||||
if (note.reactions.firstOrNull { it.author == userProfile() } != null) {
|
||||
// has already liked this note
|
||||
return
|
||||
}
|
||||
|
||||
note.event?.let {
|
||||
val event = ReactionEvent.create(it, loggedIn.privKey!!)
|
||||
Client.send(event)
|
||||
|
Loading…
x
Reference in New Issue
Block a user