This commit is contained in:
Kieran 2023-04-17 10:36:29 +01:00
parent 8d4c8c069e
commit d1efce3bea
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 9 additions and 7 deletions

View File

@ -3,7 +3,7 @@ import { Link } from "react-router-dom";
import Mention from "Element/Mention";
import NostrFileHeader from "Element/NostrFileHeader";
import { eventLink, parseNostrLink } from "Util";
import { parseNostrLink } from "Util";
export default function NostrLink({ link }: { link: string }) {
const nav = parseNostrLink(link);

View File

@ -1,7 +1,7 @@
import * as secp from "@noble/secp256k1";
import { EventKind } from "@snort/nostr";
import { FileExtensionRegex, VoidCatHost } from "Const";
import { EventPublisher } from "Feed/EventPublisher";
import { EventPublisher } from "System/EventPublisher";
import { UploadResult } from "Upload";
import { magnetURIDecode } from "Util";
@ -60,8 +60,11 @@ export default async function VoidCat(
tags.push(["i", parsedMagnet?.infoHash]);
}
}
//disable for now
//ret.header = await publisher.generic(filename, EventKind.FileHeader, tags);
ret.header = await publisher.generic(eb => {
eb.kind(EventKind.FileHeader).content(filename);
tags.forEach(t => eb.tag(t));
return eb;
});
}
return ret;
} else {

View File

@ -1,6 +1,5 @@
import useLogin from "Hooks/useLogin";
import { RawEvent } from "@snort/nostr";
import useEventPublisher from "Feed/EventPublisher";
import NostrBuild from "Upload/NostrBuild";
import VoidCat from "Upload/VoidCat";
@ -22,7 +21,7 @@ export interface Uploader {
export default function useFileUpload(): Uploader {
const fileUploader = useLogin().preferences.fileUploader;
const publisher = useEventPublisher();
//const publisher = useEventPublisher();
switch (fileUploader) {
case "nostr.build": {
@ -37,7 +36,7 @@ export default function useFileUpload(): Uploader {
}
default: {
return {
upload: (f, n) => VoidCat(f, n, publisher),
upload: (f, n) => VoidCat(f, n, undefined),
} as Uploader;
}
}