mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-26 17:52:29 +01:00
Marks which events can receive Comment replies as root scopes.
This commit is contained in:
parent
03662b9d1b
commit
b3e3b70dd0
@ -70,6 +70,7 @@ import com.vitorpamplona.quartz.events.FileStorageHeaderEvent
|
||||
import com.vitorpamplona.quartz.events.GitIssueEvent
|
||||
import com.vitorpamplona.quartz.events.Price
|
||||
import com.vitorpamplona.quartz.events.PrivateDmEvent
|
||||
import com.vitorpamplona.quartz.events.RootScope
|
||||
import com.vitorpamplona.quartz.events.TextNoteEvent
|
||||
import com.vitorpamplona.quartz.events.TorrentCommentEvent
|
||||
import com.vitorpamplona.quartz.events.TorrentEvent
|
||||
@ -555,7 +556,7 @@ open class NewPostViewModel : ViewModel() {
|
||||
|
||||
val replyingTo = originalNote
|
||||
|
||||
if (replyingTo?.event is CommentEvent || replyingTo?.event is Event) {
|
||||
if (replyingTo?.event is CommentEvent || (replyingTo?.event is Event && replyingTo.event is RootScope)) {
|
||||
account?.sendReplyComment(
|
||||
message = tagger.message,
|
||||
replyingTo = replyingTo,
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user