Compare commits
2 Commits
a789a54fbb
...
5423bf31b7
Author | SHA1 | Date |
---|---|---|
Moon Man | 5423bf31b7 | |
Moon Man | c05d5a66c9 |
|
@ -1,7 +1,7 @@
|
|||
import fs from "node:fs";
|
||||
import markdownit from 'markdown-it'
|
||||
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 { add as addToOutbox } from "./outbox.js";
|
||||
import { createArticleActivity, sendAll } from "./activity.js";
|
||||
|
@ -62,7 +62,7 @@ ${rendered}
|
|||
|
||||
await addToOutbox(article.id);
|
||||
|
||||
const keyId = fillRoute("actor", user.nickname) + "#main-key";
|
||||
const keyId = keyIdFromNickname(user.nickname);
|
||||
const inboxes = await getFollowerInboxes(user.id);
|
||||
const activity = createArticleActivity(article, user);
|
||||
const success = await sendAll(keyId, user.private_key, activity, inboxes);
|
||||
|
|
|
@ -107,4 +107,4 @@ export const getFollowerInboxes = async (userId: number): Promise<string[]> =>
|
|||
return [...inboxes];
|
||||
});
|
||||
|
||||
export const getKeyId = (nickname: string) => fillRoute("actor", nickname) + "#main-key";
|
||||
export const keyIdFromNickname = (nickname: string) => fillRoute("actor", nickname) + "#main-key";
|
||||
|
|
Loading…
Reference in New Issue