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:
parent
b608f63a1a
commit
caf40e40fb
10 changed files with 76 additions and 82 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { IRemoteUser } from '../../../../models/entities/user';
|
||||
import { IUpdate, validActor } from '../../type';
|
||||
import { getApType, IUpdate, isActor } from '../../type';
|
||||
import { apLogger } from '../../logger';
|
||||
import { updateQuestion } from '../../models/question';
|
||||
import Resolver from '../../resolver';
|
||||
|
|
@ -22,13 +22,13 @@ export default async (actor: IRemoteUser, activity: IUpdate): Promise<string> =>
|
|||
throw e;
|
||||
});
|
||||
|
||||
if (validActor.includes(object.type)) {
|
||||
if (isActor(object)) {
|
||||
await updatePerson(actor.uri!, resolver, object);
|
||||
return `ok: Person updated`;
|
||||
} else if (object.type === 'Question') {
|
||||
} else if (getApType(object) === 'Question') {
|
||||
await updateQuestion(object).catch(e => console.log(e));
|
||||
return `ok: Question updated`;
|
||||
} else {
|
||||
return `skip: Unknown type: ${object.type}`;
|
||||
return `skip: Unknown type: ${getApType(object)}`;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue