mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-27 21:10:20 +01:00
Send actor in CreateNote, Announce
This commit is contained in:
parent
b3a3238e43
commit
ffcb2f755c
3 changed files with 14 additions and 5 deletions
|
@ -6,6 +6,7 @@ export default (object: any, note: INote) => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: `${config.url}/notes/${note._id}`,
|
id: `${config.url}/notes/${note._id}`,
|
||||||
|
actor: `${config.url}/users/${note.userId}`,
|
||||||
type: 'Announce',
|
type: 'Announce',
|
||||||
published: note.createdAt.toISOString(),
|
published: note.createdAt.toISOString(),
|
||||||
to: ['https://www.w3.org/ns/activitystreams#Public'],
|
to: ['https://www.w3.org/ns/activitystreams#Public'],
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
export default (object: any) => ({
|
import config from '../../../config';
|
||||||
type: 'Create',
|
import { INote } from '../../../models/note';
|
||||||
object
|
|
||||||
});
|
export default (object: any, note: INote) => {
|
||||||
|
return {
|
||||||
|
id: `${config.url}/notes/${note._id}/activity`,
|
||||||
|
actor: `${config.url}/users/${note.userId}`,
|
||||||
|
type: 'Create',
|
||||||
|
published: note.createdAt.toISOString(),
|
||||||
|
object
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
|
@ -240,7 +240,7 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
|
||||||
async function renderActivity(data: Option, note: INote) {
|
async function renderActivity(data: Option, note: INote) {
|
||||||
const content = data.renote && data.text == null
|
const content = data.renote && data.text == null
|
||||||
? renderAnnounce(data.renote.uri ? data.renote.uri : `${config.url}/notes/${data.renote._id}`, note)
|
? renderAnnounce(data.renote.uri ? data.renote.uri : `${config.url}/notes/${data.renote._id}`, note)
|
||||||
: renderCreate(await renderNote(note, false));
|
: renderCreate(await renderNote(note, false), note);
|
||||||
|
|
||||||
return packAp(content);
|
return packAp(content);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue