mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
Make getFilter return a pure event object instead of the class from nostr-relaypool
This commit is contained in:
parent
6775f68606
commit
192ee7f76d
1 changed files with 9 additions and 1 deletions
|
|
@ -33,7 +33,15 @@ function getFilter<K extends number>(filter: Filter<K>, opts: GetFilterOpts = {}
|
|||
poolRelays,
|
||||
(event: SignedEvent | null) => {
|
||||
if (event && matchFilter(filter, event)) {
|
||||
results.push(event);
|
||||
results.push({
|
||||
id: event.id,
|
||||
kind: event.kind,
|
||||
pubkey: event.pubkey,
|
||||
content: event.content,
|
||||
tags: event.tags,
|
||||
created_at: event.created_at,
|
||||
sig: event.sig,
|
||||
});
|
||||
}
|
||||
if (filter.limit && results.length >= filter.limit) {
|
||||
unsub();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue