Fixes the rendering of highlights when no user is present and includes options to render by e tags

This commit is contained in:
Vitor Pamplona
2024-06-25 18:19:14 -04:00
parent 95694ac355
commit 5e417dd890
5 changed files with 175 additions and 41 deletions

View File

@@ -121,6 +121,8 @@ open class Event(
override fun taggedUrls() = tags.filter { it.size > 1 && it[0] == "r" }.map { it[1] }
override fun firstTagFor(vararg key: String) = tags.firstOrNull { it.size > 1 && it[0] in key }?.let { it[1] }
override fun firstTaggedUser() = tags.firstOrNull { it.size > 1 && it[0] == "p" }?.let { it[1] }
override fun firstTaggedEvent() = tags.firstOrNull { it.size > 1 && it[0] == "e" }?.let { it[1] }

View File

@@ -133,6 +133,8 @@ interface EventInterface {
fun taggedUrls(): List<String>
fun firstTagFor(vararg key: String): String?
fun firstTaggedAddress(): ATag?
fun firstTaggedUser(): HexKey?

View File

@@ -42,6 +42,8 @@ class HighlightEvent(
fun inPost() = firstTaggedAddress()
fun inPostVersion() = firstTaggedEvent()
companion object {
const val KIND = 9802
const val ALT = "Highlight/quote event"