Marks which events can receive Comment replies as root scopes.
This commit is contained in:
@@ -39,7 +39,8 @@ class CommentEvent(
|
||||
tags: Array<Array<String>>,
|
||||
content: String,
|
||||
sig: HexKey,
|
||||
) : BaseTextNoteEvent(id, pubKey, createdAt, KIND, tags, content, sig) {
|
||||
) : BaseTextNoteEvent(id, pubKey, createdAt, KIND, tags, content, sig),
|
||||
RootScope {
|
||||
fun root() = tags.firstOrNull { it.size > 3 && it[3] == "root" }?.get(1)
|
||||
|
||||
fun getRootScopes() = tags.filter { it.size > 1 && it[0] == "I" || it[0] == "A" || it[0] == "E" }
|
||||
|
||||
@@ -588,3 +588,5 @@ data class ZapSplitSetup(
|
||||
val weight: Double,
|
||||
val isLnAddress: Boolean,
|
||||
)
|
||||
|
||||
interface RootScope
|
||||
|
||||
@@ -38,7 +38,8 @@ class PictureEvent(
|
||||
tags: Array<Array<String>>,
|
||||
content: String,
|
||||
sig: HexKey,
|
||||
) : Event(id, pubKey, createdAt, KIND, tags, content, sig) {
|
||||
) : Event(id, pubKey, createdAt, KIND, tags, content, sig),
|
||||
RootScope {
|
||||
fun mimeTypes() = tags.filter { it.size > 1 && it[0] == MIME_TYPE }
|
||||
|
||||
fun hashes() = tags.filter { it.size > 1 && it[0] == HASH }
|
||||
|
||||
@@ -34,7 +34,8 @@ abstract class VideoEvent(
|
||||
tags: Array<Array<String>>,
|
||||
content: String,
|
||||
sig: HexKey,
|
||||
) : BaseAddressableEvent(id, pubKey, createdAt, kind, tags, content, sig) {
|
||||
) : BaseAddressableEvent(id, pubKey, createdAt, kind, tags, content, sig),
|
||||
RootScope {
|
||||
fun url() = tags.firstOrNull { it.size > 1 && it[0] == URL }?.get(1)
|
||||
|
||||
fun urls() = tags.filter { it.size > 1 && it[0] == URL }.map { it[1] }
|
||||
|
||||
@@ -34,7 +34,8 @@ class VideoVerticalEvent(
|
||||
tags: Array<Array<String>>,
|
||||
content: String,
|
||||
sig: HexKey,
|
||||
) : VideoEvent(id, pubKey, createdAt, KIND, tags, content, sig) {
|
||||
) : VideoEvent(id, pubKey, createdAt, KIND, tags, content, sig),
|
||||
RootScope {
|
||||
companion object {
|
||||
const val KIND = 34236
|
||||
const val ALT_DESCRIPTION = "Vertical Video"
|
||||
|
||||
Reference in New Issue
Block a user