summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-07 16:36:40 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-07 16:36:40 +0900
commit321f61f1cb47ec096f735fe3aa7018a4aec43c20 (patch)
tree8ad655f2c1db6e535067f64d894a34209a4ccd5a /src
parentMerge pull request #1397 from syuilo/refactor (diff)
downloadmisskey-321f61f1cb47ec096f735fe3aa7018a4aec43c20.tar.gz
misskey-321f61f1cb47ec096f735fe3aa7018a4aec43c20.tar.bz2
misskey-321f61f1cb47ec096f735fe3aa7018a4aec43c20.zip
Refactor
Diffstat (limited to 'src')
-rw-r--r--src/remote/activitypub/act/index.ts4
-rw-r--r--src/remote/activitypub/type.ts21
2 files changed, 21 insertions, 4 deletions
diff --git a/src/remote/activitypub/act/index.ts b/src/remote/activitypub/act/index.ts
index 5be07c478e..5fcdb61748 100644
--- a/src/remote/activitypub/act/index.ts
+++ b/src/remote/activitypub/act/index.ts
@@ -2,10 +2,10 @@ import create from './create';
import performDeleteActivity from './delete';
import follow from './follow';
import undo from './undo';
-import { IObject } from '../type';
+import { Object } from '../type';
import { IRemoteUser } from '../../../models/user';
-const self = async (actor: IRemoteUser, activity: IObject): Promise<void> => {
+const self = async (actor: IRemoteUser, activity: Object): Promise<void> => {
switch (activity.type) {
case 'Create':
await create(actor, activity);
diff --git a/src/remote/activitypub/type.ts b/src/remote/activitypub/type.ts
index 9a4b3c75fc..c07b806be8 100644
--- a/src/remote/activitypub/type.ts
+++ b/src/remote/activitypub/type.ts
@@ -1,7 +1,7 @@
-export type Object = { [x: string]: any };
+export type obj = { [x: string]: any };
export interface IObject {
- '@context': string | object | any[];
+ '@context': string | obj | obj[];
type: string;
id?: string;
summary?: string;
@@ -39,6 +39,10 @@ export interface ICreate extends IActivity {
type: 'Create';
}
+export interface IDelete extends IActivity {
+ type: 'Delete';
+}
+
export interface IUndo extends IActivity {
type: 'Undo';
}
@@ -46,3 +50,16 @@ export interface IUndo extends IActivity {
export interface IFollow extends IActivity {
type: 'Follow';
}
+
+export interface IAccept extends IActivity {
+ type: 'Accept';
+}
+
+export type Object =
+ ICollection |
+ IOrderedCollection |
+ ICreate |
+ IDelete |
+ IUndo |
+ IFollow |
+ IAccept;