Add no-text and livekit tag support to rooms

This commit is contained in:
Jon Staab
2026-03-05 14:34:07 -08:00
parent 7f257a3fff
commit fa7b6bb526
13 changed files with 33 additions and 14 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@welshman", "name": "@welshman",
"private": true, "private": true,
"version": "0.8.7", "version": "0.8.8",
"workspaces": [ "workspaces": [
"packages/*" "packages/*"
], ],
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"name": "@welshman/app", "name": "@welshman/app",
"version": "0.8.7", "version": "0.8.8",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
"description": "A collection of svelte stores for use in building nostr client applications.", "description": "A collection of svelte stores for use in building nostr client applications.",
@@ -24,7 +24,7 @@
"throttle-debounce": "^5.0.2" "throttle-debounce": "^5.0.2"
}, },
"peerDependencies": { "peerDependencies": {
"@pomade/core": "^0.1.1", "@pomade/core": "^0.1.3",
"@welshman/feeds": "workspace:*", "@welshman/feeds": "workspace:*",
"@welshman/lib": "workspace:*", "@welshman/lib": "workspace:*",
"@welshman/net": "workspace:*", "@welshman/net": "workspace:*",
@@ -37,7 +37,7 @@
"devDependencies": { "devDependencies": {
"rimraf": "~6.0.0", "rimraf": "~6.0.0",
"typescript": "~5.8.0", "typescript": "~5.8.0",
"@pomade/core": "^0.1.1", "@pomade/core": "^0.1.3",
"@types/throttle-debounce": "^5.0.2", "@types/throttle-debounce": "^5.0.2",
"@welshman/feeds": "workspace:*", "@welshman/feeds": "workspace:*",
"@welshman/lib": "workspace:*", "@welshman/lib": "workspace:*",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@welshman/content", "name": "@welshman/content",
"version": "0.8.7", "version": "0.8.8",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
"description": "A collection of utilities for parsing nostr note content.", "description": "A collection of utilities for parsing nostr note content.",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@welshman/editor", "name": "@welshman/editor",
"version": "0.8.7", "version": "0.8.8",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
"description": "A batteries-included nostr editor.", "description": "A batteries-included nostr editor.",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@welshman/feeds", "name": "@welshman/feeds",
"version": "0.8.7", "version": "0.8.8",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
"description": "Utilities for building dynamic nostr feeds.", "description": "Utilities for building dynamic nostr feeds.",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@welshman/lib", "name": "@welshman/lib",
"version": "0.8.7", "version": "0.8.8",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
"description": "A collection of utilities.", "description": "A collection of utilities.",
+12
View File
@@ -1555,12 +1555,24 @@ export const nthEq =
(xs: any[], ...args: unknown[]) => (xs: any[], ...args: unknown[]) =>
xs[i] === v xs[i] === v
/** Returns a function that checks if nth element is in value */
export const nthIn =
(i: number, v: any[]) =>
(xs: any[], ...args: unknown[]) =>
v.includes(xs[i])
/** Returns a function that checks if nth element does not equal value */ /** Returns a function that checks if nth element does not equal value */
export const nthNe = export const nthNe =
(i: number, v: any) => (i: number, v: any) =>
(xs: any[], ...args: unknown[]) => (xs: any[], ...args: unknown[]) =>
xs[i] !== v xs[i] !== v
/** Returns a function that checks if nth element is not in value */
export const nthNotIn =
(i: number, v: any[]) =>
(xs: any[], ...args: unknown[]) =>
!v.includes(xs[i])
/** Returns a function that checks if key/value pairs of x match all pairs in spec */ /** Returns a function that checks if key/value pairs of x match all pairs in spec */
export const spec = export const spec =
(values: Obj | Array<any>) => (values: Obj | Array<any>) =>
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@welshman/net", "name": "@welshman/net",
"version": "0.8.7", "version": "0.8.8",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
"description": "Utilities for connecting with nostr relays.", "description": "Utilities for connecting with nostr relays.",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@welshman/router", "name": "@welshman/router",
"version": "0.8.7", "version": "0.8.8",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
"description": "A collection of utilities for nostr relay selection.", "description": "A collection of utilities for nostr relay selection.",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@welshman/signer", "name": "@welshman/signer",
"version": "0.8.7", "version": "0.8.8",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
"description": "A nostr signer implemenation supporting several login methods.", "description": "A nostr signer implemenation supporting several login methods.",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@welshman/store", "name": "@welshman/store",
"version": "0.8.7", "version": "0.8.8",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
"description": "A collection of utilities based on svelte/store for use with welshman", "description": "A collection of utilities based on svelte/store for use with welshman",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@welshman/util", "name": "@welshman/util",
"version": "0.8.7", "version": "0.8.8",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
"description": "A collection of nostr-related utilities.", "description": "A collection of nostr-related utilities.",
+8 -1
View File
@@ -22,6 +22,8 @@ export type RoomMeta = {
isHidden?: boolean isHidden?: boolean
isPrivate?: boolean isPrivate?: boolean
isRestricted?: boolean isRestricted?: boolean
noText?: boolean
livekit?: boolean
event?: TrustedEvent event?: TrustedEvent
} }
@@ -64,6 +66,8 @@ export const readRoomMeta = (event: TrustedEvent): PublishedRoomMeta => {
isHidden: event.tags.some(spec(["hidden"])), isHidden: event.tags.some(spec(["hidden"])),
isPrivate: event.tags.some(spec(["private"])), isPrivate: event.tags.some(spec(["private"])),
isRestricted: event.tags.some(spec(["restricted"])), isRestricted: event.tags.some(spec(["restricted"])),
noText: event.tags.some(spec(["no-text"])),
livekit: event.tags.some(spec(["livekit"])),
} }
} }
@@ -93,11 +97,14 @@ export const makeRoomEditEvent = (room: RoomMeta) => {
if (room.isHidden) tags.push(["hidden"]) if (room.isHidden) tags.push(["hidden"])
if (room.isPrivate) tags.push(["private"]) if (room.isPrivate) tags.push(["private"])
if (room.isRestricted) tags.push(["restricted"]) if (room.isRestricted) tags.push(["restricted"])
if (room.noText) tags.push(["no-text"])
if (room.livekit) tags.push(["livekit"])
if (room.event) { if (room.event) {
for (const t of room.event.tags) { for (const t of room.event.tags) {
if (tags.some(spec(t.slice(0, 1)))) continue if (tags.some(spec(t.slice(0, 1)))) continue
if (["closed", "hidden", "private", "restricted"].includes(t[0])) continue if (["closed", "hidden", "private", "restricted", "no-text", "livekit"].includes(t[0]))
continue
tags.push(t) tags.push(t)
} }