Move some stuff to welshman, broadcast profile updates

This commit is contained in:
Jon Staab
2025-06-13 15:17:20 -07:00
parent 528917b90e
commit dac9ef8e4e
5 changed files with 10 additions and 49 deletions
-33
View File
@@ -12,10 +12,6 @@ import {
FOLLOWS,
REACTION,
AUTH_JOIN,
GROUP_JOIN,
GROUP_LEAVE,
GROUP_CREATE,
GROUP_EDIT_META,
GROUPS,
COMMENT,
isSignedEvent,
@@ -55,7 +51,6 @@ import {
getThunkError,
} from "@welshman/app"
import {
tagRoom,
PROTECTED,
userMembership,
INDEXER_RELAYS,
@@ -126,34 +121,6 @@ export const broadcastUserData = async (relays: string[]) => {
}
}
// NIP 29 stuff
export const createRoom = (url: string, room: string) => {
const event = makeEvent(GROUP_CREATE, {tags: [tagRoom(room, url)]})
return publishThunk({event, relays: [url]})
}
export const editRoom = (url: string, room: string, meta: Record<string, string>) => {
const event = makeEvent(GROUP_EDIT_META, {
tags: [tagRoom(room, url), ...Object.entries(meta)],
})
return publishThunk({event, relays: [url]})
}
export const joinRoom = (url: string, room: string) => {
const event = makeEvent(GROUP_JOIN, {tags: [tagRoom(room, url)]})
return publishThunk({event, relays: [url]})
}
export const leaveRoom = (url: string, room: string) => {
const event = makeEvent(GROUP_LEAVE, {tags: [tagRoom(room, url)]})
return publishThunk({event, relays: [url]})
}
// List updates
export const addSpaceMembership = async (url: string) => {