mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-28 22:43:16 +02:00
Adds missing methods to display as Public message
This commit is contained in:
@@ -28,6 +28,7 @@ import com.vitorpamplona.quartz.nip01Core.core.any
|
||||
import com.vitorpamplona.quartz.nip01Core.hints.PubKeyHintProvider
|
||||
import com.vitorpamplona.quartz.nip01Core.signers.eventTemplate
|
||||
import com.vitorpamplona.quartz.nip10Notes.BaseNoteEvent
|
||||
import com.vitorpamplona.quartz.nip19Bech32.entities.NProfile
|
||||
import com.vitorpamplona.quartz.nip19Bech32.pubKeyHints
|
||||
import com.vitorpamplona.quartz.nip19Bech32.pubKeys
|
||||
import com.vitorpamplona.quartz.nip31Alts.alt
|
||||
@@ -59,6 +60,15 @@ class PublicMessageEvent(
|
||||
|
||||
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 {
|
||||
const val KIND = 24
|
||||
const val ALT_DESCRIPTION = "Public Message"
|
||||
|
Reference in New Issue
Block a user