Adds missing methods to display as Public message
This commit is contained in:
+10
@@ -28,6 +28,7 @@ import com.vitorpamplona.quartz.nip01Core.core.any
|
|||||||
import com.vitorpamplona.quartz.nip01Core.hints.PubKeyHintProvider
|
import com.vitorpamplona.quartz.nip01Core.hints.PubKeyHintProvider
|
||||||
import com.vitorpamplona.quartz.nip01Core.signers.eventTemplate
|
import com.vitorpamplona.quartz.nip01Core.signers.eventTemplate
|
||||||
import com.vitorpamplona.quartz.nip10Notes.BaseNoteEvent
|
import com.vitorpamplona.quartz.nip10Notes.BaseNoteEvent
|
||||||
|
import com.vitorpamplona.quartz.nip19Bech32.entities.NProfile
|
||||||
import com.vitorpamplona.quartz.nip19Bech32.pubKeyHints
|
import com.vitorpamplona.quartz.nip19Bech32.pubKeyHints
|
||||||
import com.vitorpamplona.quartz.nip19Bech32.pubKeys
|
import com.vitorpamplona.quartz.nip19Bech32.pubKeys
|
||||||
import com.vitorpamplona.quartz.nip31Alts.alt
|
import com.vitorpamplona.quartz.nip31Alts.alt
|
||||||
@@ -59,6 +60,15 @@ class PublicMessageEvent(
|
|||||||
|
|
||||||
fun groupKeySet() = tags.mapNotNullTo(mutableSetOf(this.pubKey), ReceiverTag::parseKey)
|
fun groupKeySet() = tags.mapNotNullTo(mutableSetOf(this.pubKey), ReceiverTag::parseKey)
|
||||||
|
|
||||||
|
fun groupKeySetWithoutOwner() = tags.mapNotNullTo(mutableSetOf(), ReceiverTag::parseKey) - this.pubKey
|
||||||
|
|
||||||
|
fun groupAsNProfileList(toRemove: Set<HexKey>) =
|
||||||
|
group().joinToString {
|
||||||
|
NProfile.create(it.pubKey, it.relayHint)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun chatroomKey(user: HexKey) = groupKeySet() - user
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val KIND = 24
|
const val KIND = 24
|
||||||
const val ALT_DESCRIPTION = "Public Message"
|
const val ALT_DESCRIPTION = "Public Message"
|
||||||
|
|||||||
Reference in New Issue
Block a user