1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-06 02:26:04 +02:00

Supports Array ActivityStreams type (#7536)

* Supports Array type

* Fix

* Fix Service to Note

* Update type.ts

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
MeiMei
2021-05-31 13:04:13 +09:00
committed by GitHub
parent b608f63a1a
commit caf40e40fb
10 changed files with 76 additions and 82 deletions

View File

@@ -1,12 +1,12 @@
import Resolver from '../../resolver';
import { IRemoteUser } from '../../../../models/entities/user';
import acceptFollow from './follow';
import { IAccept, IFollow } from '../../type';
import { IAccept, isFollow, getApType } from '../../type';
import { apLogger } from '../../logger';
const logger = apLogger;
export default async (actor: IRemoteUser, activity: IAccept): Promise<void> => {
export default async (actor: IRemoteUser, activity: IAccept): Promise<string> => {
const uri = activity.id || activity;
logger.info(`Accept: ${uri}`);
@@ -18,13 +18,7 @@ export default async (actor: IRemoteUser, activity: IAccept): Promise<void> => {
throw e;
});
switch (object.type) {
case 'Follow':
acceptFollow(actor, object as IFollow);
break;
if (isFollow(object)) return await acceptFollow(actor, object);
default:
logger.warn(`Unknown accept type: ${object.type}`);
break;
}
return `skip: Unknown Accept type: ${getApType(object)}`;
};