From d676d57614f30b99e239336d5a83913d74f742c7 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 13 Jan 2023 09:39:14 -0500 Subject: [PATCH] Improving documentation for the Note Class --- app/src/main/java/com/vitorpamplona/amethyst/model/Note.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/model/Note.kt b/app/src/main/java/com/vitorpamplona/amethyst/model/Note.kt index 74fdc435c..02ff4f47d 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/model/Note.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/model/Note.kt @@ -1,6 +1,7 @@ package com.vitorpamplona.amethyst.model import androidx.lifecycle.LiveData +import com.baha.url.preview.UrlInfoItem import com.vitorpamplona.amethyst.service.NostrSingleEventDataSource import com.vitorpamplona.amethyst.ui.note.toDisplayHex import fr.acinq.secp256k1.Hex @@ -11,14 +12,19 @@ import java.util.Collections import nostr.postr.events.Event class Note(val idHex: String) { + // These fields are always available. + // They are immutable val id = Hex.decode(idHex) val idDisplayHex = id.toDisplayHex() + // These fields are only available after the Text Note event is received. + // They are immutable after that. var event: Event? = null var author: User? = null var mentions: List? = null var replyTo: MutableList? = null + // These fields are updated every time an event related to this note is received. val replies = Collections.synchronizedSet(mutableSetOf()) val reactions = Collections.synchronizedSet(mutableSetOf()) val boosts = Collections.synchronizedSet(mutableSetOf())