diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-05 01:22:41 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-05 01:22:41 +0900 |
| commit | eb304cb5fb588a3da8742f234cdf05ce6deeaa59 (patch) | |
| tree | 1d877e189ab5dfb9f959db62ee30955da7897781 /src/remote/activitypub/act/undo | |
| parent | wip (diff) | |
| download | misskey-eb304cb5fb588a3da8742f234cdf05ce6deeaa59.tar.gz misskey-eb304cb5fb588a3da8742f234cdf05ce6deeaa59.tar.bz2 misskey-eb304cb5fb588a3da8742f234cdf05ce6deeaa59.zip | |
wip
Diffstat (limited to 'src/remote/activitypub/act/undo')
| -rw-r--r-- | src/remote/activitypub/act/undo/index.ts | 27 | ||||
| -rw-r--r-- | src/remote/activitypub/act/undo/unfollow.ts | 11 |
2 files changed, 0 insertions, 38 deletions
diff --git a/src/remote/activitypub/act/undo/index.ts b/src/remote/activitypub/act/undo/index.ts deleted file mode 100644 index aa60d3a4fa..0000000000 --- a/src/remote/activitypub/act/undo/index.ts +++ /dev/null @@ -1,27 +0,0 @@ -import act from '../../act'; -import deleteObject from '../../delete'; -import unfollow from './unfollow'; -import Resolver from '../../resolver'; - -export default async (resolver: Resolver, actor, activity): Promise<void> => { - if ('actor' in activity && actor.account.uri !== activity.actor) { - throw new Error(); - } - - const results = await act(resolver, actor, activity.object); - - await Promise.all(results.map(async promisedResult => { - const result = await promisedResult; - - if (result === null || await deleteObject(result) !== null) { - return; - } - - switch (result.object.$ref) { - case 'following': - await unfollow(result.object); - } - })); - - return null; -}; diff --git a/src/remote/activitypub/act/undo/unfollow.ts b/src/remote/activitypub/act/undo/unfollow.ts deleted file mode 100644 index c17e06e8a9..0000000000 --- a/src/remote/activitypub/act/undo/unfollow.ts +++ /dev/null @@ -1,11 +0,0 @@ -import queue from '../../../../queue'; - -export default ({ $id }) => new Promise((resolve, reject) => { - queue.create('http', { type: 'unfollow', id: $id }).save(error => { - if (error) { - reject(error); - } else { - resolve(); - } - }); -}); |