Move from topic to room using tilde

This commit is contained in:
Jon Staab
2024-09-23 10:28:33 -07:00
parent 88000d02ba
commit 4c9b7da586
12 changed files with 75 additions and 67 deletions
+3 -4
View File
@@ -11,10 +11,10 @@
import Button from "@lib/components/Button.svelte"
import {makeMention, makeIMeta} from "@app/commands"
import {getChatEditorOptions, addFile} from "@app/editor"
import {MESSAGE} from "@app/state"
import {ROOM, MESSAGE, GENERAL} from "@app/state"
export let url
export let topic = ""
export let room = GENERAL
const uploading = writable(false)
@@ -22,7 +22,6 @@
const sendMessage = () => {
const json = $editor.getJSON()
const topicTags = topic ? [["t", topic]] : []
const mentionTags = findNodes(NProfileExtension.name, json).map(m =>
makeMention(m.attrs!.pubkey, m.attrs!.relays),
)
@@ -32,7 +31,7 @@
const event = createEvent(MESSAGE, {
content: $editor.getText(),
tags: [["-"], ...topicTags, ...mentionTags, ...imetaTags],
tags: [[ROOM, room], ...mentionTags, ...imetaTags],
})
publishThunk(makeThunk({event, relays: [url]}))