@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({ return Object.assign({
'@context': [ '@context': [
'https://www.w3.org/ns/activitystreams', 'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1' '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 = {
// as non-standards // as non-standards
manuallyApprovesFollowers: 'as:manuallyApprovesFollowers', manuallyApprovesFollowers: 'as:manuallyApprovesFollowers',
sensitive: 'as:sensitive', sensitive: 'as:sensitive',
@ -50,9 +41,15 @@ export const attachLdSignature = async (activity: any, user: { id: User['id']; h
'isCat': 'misskey:isCat', 'isCat': 'misskey:isCat',
// vcard // vcard
vcard: 'http://www.w3.org/2006/vcard/ns#', 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(); const ldSignature = new LdSignature();
ldSignature.debug = false; ldSignature.debug = false;