Upgrade nostr-tools, add groups/circles to Tags
This commit is contained in:
+6
-2
@@ -1,6 +1,6 @@
|
||||
import type {Event} from 'nostr-tools'
|
||||
import normalizeUrl from "normalize-url"
|
||||
import {verifySignature, getEventHash, matchFilter as nostrToolsMatchFilter} from 'nostr-tools'
|
||||
import {verifyEvent, getEventHash, matchFilter as nostrToolsMatchFilter} from 'nostr-tools'
|
||||
import {cached} from "./LRUCache"
|
||||
|
||||
// ===========================================================================
|
||||
@@ -82,7 +82,7 @@ export const hasValidSignature = cached<string, boolean, [Event]>({
|
||||
return 'invalid'
|
||||
}
|
||||
},
|
||||
getValue: ([e]: [Event]) => verifySignature(e),
|
||||
getValue: ([e]: [Event]) => verifyEvent(e),
|
||||
})
|
||||
|
||||
// ==========================================================================
|
||||
@@ -215,8 +215,12 @@ export class Tags extends Fluent<string[]> {
|
||||
|
||||
replies = (type = null) => this.getAncestors(type).replies
|
||||
|
||||
groups = () => this.type("a").values().filter(a => a.startsWith('35834:'))
|
||||
|
||||
communities = () => this.type("a").values().filter(a => a.startsWith('34550:'))
|
||||
|
||||
circles = () => this.type("a").values().filter(a => a.match(/^(34550|35834):/))
|
||||
|
||||
getReply = (type = null) => this.replies(type).values().first()
|
||||
|
||||
getRoot = (type = null) => this.roots(type).values().first()
|
||||
|
||||
Reference in New Issue
Block a user