Fix legacy message loading

This commit is contained in:
Jon Staab
2024-12-10 15:33:36 -08:00
parent d8c3378e5c
commit 19d67783fc
2 changed files with 24 additions and 16 deletions
@@ -49,7 +49,14 @@
const content = popKey<string>("content") || ""
const url = decodeRelay($page.params.relay)
const relay = deriveRelay(url)
const events = throttled(300, deriveEventsForUrl(url, [{kinds: [MESSAGE], "#h": [room]}]))
const legacyRoom = room === GENERAL ? "general" : room
const events = throttled(
300,
deriveEventsForUrl(url, [
{kinds: [MESSAGE], "#h": [room]},
{kinds: [LEGACY_MESSAGE], "#~": [legacyRoom]},
]),
)
const assertEvent = (e: any) => e as TrustedEvent
@@ -132,7 +139,7 @@
load({
delay: 0,
relays: [url],
filters: [{kinds: [LEGACY_MESSAGE], "#~": [room]}],
filters: [{kinds: [LEGACY_MESSAGE], "#~": [legacyRoom]}],
})
}