@contextをちゃんと付ける (#7522)

This commit is contained in:
MeiMei 2021-05-19 16:00:08 +09:00 committed by GitHub
parent 15198a15d7
commit 07fca58301

View file

@ -15,17 +15,8 @@ export const renderActivity = (x: any): IActivity | null => {
return Object.assign({
'@context': [
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
]
}, x);
};
export const attachLdSignature = async (activity: any, user: { id: User['id']; host: null; }): Promise<IActivity | null> => {
if (activity == null) return null;
const keypair = await getUserKeypair(user.id);
const obj = {
'https://w3id.org/security/v1',
{
// as non-standards
manuallyApprovesFollowers: 'as:manuallyApprovesFollowers',
sensitive: 'as:sensitive',
@ -50,9 +41,15 @@ export const attachLdSignature = async (activity: any, user: { id: User['id']; h
'isCat': 'misskey:isCat',
// vcard
vcard: 'http://www.w3.org/2006/vcard/ns#',
};
}
]
}, x);
};
activity['@context'].push(obj);
export const attachLdSignature = async (activity: any, user: { id: User['id']; host: null; }): Promise<IActivity | null> => {
if (activity == null) return null;
const keypair = await getUserKeypair(user.id);
const ldSignature = new LdSignature();
ldSignature.debug = false;