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

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(" "),
)

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)

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,

View File

@@ -339,7 +339,7 @@
{/snippet}
{#snippet action()}
<div class="row-2">
{#if $userIsAdmin || true}
{#if $userIsAdmin}
<Button
class="btn btn-neutral btn-sm tooltip tooltip-left"
data-tip="Edit room information"
@@ -456,7 +456,7 @@
<!-- pass -->
{:else if $room.isRestricted && $membershipStatus !== MembershipStatus.Granted}
<div class="bg-alt card m-4 flex flex-row items-center justify-between px-4 py-3">
<p>Only members are allowed to post to this room.</p>
<p class="opacity-75">Only members are allowed to post to this room.</p>
{#if !$room.isClosed}
{#if $membershipStatus === MembershipStatus.Pending}
<Button class="btn btn-neutral btn-sm" disabled={leaving} onclick={leave}>