misskey/src/remote/activitypub/renderer/index.ts
MeiMei b8a7468c4a Do not import as pack from AP renderer (#4048)
* Do not import as pack from AP renderer

* rename
2019-01-31 02:29:35 +09:00

19 lines
409 B
TypeScript

import config from '../../../config';
import * as uuid from 'uuid';
export const renderActivity = (x: any) => {
if (x == null) return null;
if (x !== null && typeof x === 'object' && x.id == null) {
x.id = `${config.url}/${uuid.v4()}`;
}
return Object.assign({
'@context': [
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1',
{ Hashtag: 'as:Hashtag' }
]
}, x);
};