use keyid builder

This commit is contained in:
Moon Man 2024-01-01 07:50:00 -05:00
parent c05d5a66c9
commit 5423bf31b7
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import fs from "node:fs"; import fs from "node:fs";
import markdownit from 'markdown-it' import markdownit from 'markdown-it'
import { slugRegex } from "./article.js"; import { slugRegex } from "./article.js";
import { newUser, get as getUserByNickname, getFollowerInboxes } from "./user.js"; import { newUser, get as getUserByNickname, getFollowerInboxes, keyIdFromNickname } from "./user.js";
import { insert as insertArticle } from "./article.js"; import { insert as insertArticle } from "./article.js";
import { add as addToOutbox } from "./outbox.js"; import { add as addToOutbox } from "./outbox.js";
import { createArticleActivity, sendAll } from "./activity.js"; import { createArticleActivity, sendAll } from "./activity.js";
@ -62,7 +62,7 @@ ${rendered}
await addToOutbox(article.id); await addToOutbox(article.id);
const keyId = fillRoute("actor", user.nickname) + "#main-key"; const keyId = keyIdFromNickname(user.nickname);
const inboxes = await getFollowerInboxes(user.id); const inboxes = await getFollowerInboxes(user.id);
const activity = createArticleActivity(article, user); const activity = createArticleActivity(article, user);
const success = await sendAll(keyId, user.private_key, activity, inboxes); const success = await sendAll(keyId, user.private_key, activity, inboxes);