1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-02 16:45:54 +02:00

Allow to undo Create activity

This commit is contained in:
Akihiko Odaki
2018-04-04 19:51:41 +09:00
parent 210cb57aa5
commit 783453897f
5 changed files with 30 additions and 17 deletions

View File

@@ -1,4 +1,5 @@
import act from '../../act';
import deleteObject from '../../delete';
import unfollow from './unfollow';
import Resolver from '../../resolver';
@@ -12,7 +13,7 @@ export default async (resolver: Resolver, actor, activity): Promise<void> => {
await Promise.all(results.map(async promisedResult => {
const result = await promisedResult;
if (result === null) {
if (result === null || await deleteObject(result) !== null) {
return;
}
@@ -21,4 +22,6 @@ export default async (resolver: Resolver, actor, activity): Promise<void> => {
await unfollow(result.object);
}
}));
return null;
};