Presents notifications when a person forks your content.

This commit is contained in:
Vitor Pamplona
2024-03-01 17:07:19 -05:00
parent c53fc03157
commit 786802b708
3 changed files with 10 additions and 4 deletions
@@ -55,6 +55,8 @@ open class BaseTextNoteEvent(
fun forkFromVersion() = tags.firstOrNull { it.size > 3 && it[0] == "e" && it[3] == "fork" }?.get(1)
fun isForkFromAddressWithPubkey(authorHex: HexKey) = tags.any { it.size > 3 && it[0] == "a" && it[3] == "fork" && it[1].contains(authorHex) }
open fun replyTos(): List<HexKey> {
val oldStylePositional = tags.filter { it.size > 1 && it.size <= 3 && it[0] == "e" }.map { it[1] }
val newStyleReply = tags.lastOrNull { it.size > 3 && it[0] == "e" && it[3] == "reply" }?.get(1)