summaryrefslogtreecommitdiff
path: root/src/remote/activitypub/act/undo
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-05 01:22:41 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-05 01:22:41 +0900
commiteb304cb5fb588a3da8742f234cdf05ce6deeaa59 (patch)
tree1d877e189ab5dfb9f959db62ee30955da7897781 /src/remote/activitypub/act/undo
parentwip (diff)
downloadmisskey-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.ts27
-rw-r--r--src/remote/activitypub/act/undo/unfollow.ts11
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();
- }
- });
-});