mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 11:57:29 +01:00
Fixes the rendering of highlights when no user is present and includes options to render by e tags
This commit is contained in:
@@ -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] }
|
||||
|
||||
@@ -133,6 +133,8 @@ interface EventInterface {
|
||||
|
||||
fun taggedUrls(): List<String>
|
||||
|
||||
fun firstTagFor(vararg key: String): String?
|
||||
|
||||
fun firstTaggedAddress(): ATag?
|
||||
|
||||
fun firstTaggedUser(): HexKey?
|
||||
|
||||
@@ -42,6 +42,8 @@ class HighlightEvent(
|
||||
|
||||
fun inPost() = firstTaggedAddress()
|
||||
|
||||
fun inPostVersion() = firstTaggedEvent()
|
||||
|
||||
companion object {
|
||||
const val KIND = 9802
|
||||
const val ALT = "Highlight/quote event"
|
||||
|
||||
Reference in New Issue
Block a user