Fix some alerts stuff

This commit is contained in:
Jon Staab
2025-11-03 11:10:16 -08:00
parent b1c68972c9
commit 42a550788a
4 changed files with 9 additions and 6 deletions
+2 -2
View File
@@ -17,14 +17,14 @@
const {alert}: Props = $props()
const cron = $derived(getTagValue("cron", alert.tags))
const room = $derived(getTagValue("room", alert.tags))
const channel = $derived(getTagValue("channel", alert.tags))
const feeds = $derived(getTagValues("feed", alert.tags))
const description = $derived(
getTagValue("description", alert.tags) ||
[
`${cron?.endsWith("1") ? "Weekly" : "Daily"} alert for events`,
displayFeeds(feeds.map(parseJson)),
`sent via ${room}.`,
`sent via ${channel}.`,
].join(" "),
)
+3 -2
View File
@@ -265,6 +265,7 @@ const syncSpace = (url: string) => {
filters: [
{kinds: [RELAY_MEMBERS]},
{kinds: [ROOM_META, ROOM_DELETE]},
{kinds: [ROOM_ADMINS, ROOM_MEMBERS]},
{kinds: [RELAY_ADD_MEMBER, RELAY_REMOVE_MEMBER]},
...MESSAGE_KINDS.map(kind => ({kinds: [kind]})),
makeCommentFilter(CONTENT_KINDS),
@@ -328,7 +329,7 @@ const syncSpaces = () => {
// Chat
const syncRoomChat = (url: string, h: string) => {
const syncRoom = (url: string, h: string) => {
const controller = new AbortController()
pullAndListen({
@@ -359,7 +360,7 @@ const syncRooms = () => {
const key = `${url}'${h}`
if (!unsubscribersByKey.has(key)) {
newUnsubscribersByKey.set(key, syncRoomChat(url, h))
newUnsubscribersByKey.set(key, syncRoom(url, h))
}
keys.add(key)
+2
View File
@@ -25,6 +25,7 @@ import {
ROOM_ADD_MEMBER,
ROOM_CREATE_PERMISSION,
ROOM_MEMBERS,
ROOM_ADMINS,
ROOM_META,
ROOM_DELETE,
ROOM_REMOVE_MEMBER,
@@ -77,6 +78,7 @@ const syncEvents = async () => {
const roomKinds = [
ROOM_META,
ROOM_DELETE,
ROOM_ADMINS,
ROOM_MEMBERS,
ROOM_ADD_MEMBER,
ROOM_REMOVE_MEMBER,