feat: NIP-24

This commit is contained in:
2023-08-17 19:54:14 +01:00
parent 8500dee24f
commit f6a46e3523
51 changed files with 792 additions and 319 deletions

View File

@ -1,6 +1,6 @@
import Nostrich from "public/logo_256.png";
import { TaggedRawEvent, EventKind, MetadataCache } from "@snort/system";
import { TaggedNostrEvent, EventKind, MetadataCache } from "@snort/system";
import { getDisplayName } from "Element/ProfileImage";
import { MentionRegex } from "Const";
import { tagFilterOfTextRepost, unwrap } from "SnortUtils";
@ -14,7 +14,7 @@ export interface NotificationRequest {
timestamp: number;
}
export async function makeNotification(ev: TaggedRawEvent): Promise<NotificationRequest | null> {
export async function makeNotification(ev: TaggedNostrEvent): Promise<NotificationRequest | null> {
switch (ev.kind) {
case EventKind.TextNote: {
if (ev.tags.some(tagFilterOfTextRepost(ev))) {
@ -40,7 +40,7 @@ export async function makeNotification(ev: TaggedRawEvent): Promise<Notification
return null;
}
function replaceTagsWithUser(ev: TaggedRawEvent, users: MetadataCache[]) {
function replaceTagsWithUser(ev: TaggedNostrEvent, users: MetadataCache[]) {
return ev.content
.split(MentionRegex)
.map(match => {