From 7a7724e66e4533523083e7336cd0d0c747c4a33b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 13 Nov 2017 17:39:41 +0100 Subject: Handle follow/accept --- shared/models/accounts/account.model.ts | 5 +++++ shared/models/accounts/follow.model.ts | 1 + shared/models/accounts/index.ts | 2 ++ shared/models/activitypub/activity.ts | 18 ++++++++++++++++-- shared/models/index.ts | 1 + 5 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 shared/models/accounts/account.model.ts create mode 100644 shared/models/accounts/follow.model.ts create mode 100644 shared/models/accounts/index.ts (limited to 'shared') diff --git a/shared/models/accounts/account.model.ts b/shared/models/accounts/account.model.ts new file mode 100644 index 000000000..338426dc7 --- /dev/null +++ b/shared/models/accounts/account.model.ts @@ -0,0 +1,5 @@ +export interface Account { + id: number + name: string + host: string +} diff --git a/shared/models/accounts/follow.model.ts b/shared/models/accounts/follow.model.ts new file mode 100644 index 000000000..80cfe07e4 --- /dev/null +++ b/shared/models/accounts/follow.model.ts @@ -0,0 +1 @@ +export type FollowState = 'pending' | 'accepted' diff --git a/shared/models/accounts/index.ts b/shared/models/accounts/index.ts new file mode 100644 index 000000000..8fe437b81 --- /dev/null +++ b/shared/models/accounts/index.ts @@ -0,0 +1,2 @@ +export * from './account.model' +export * from './follow.model' diff --git a/shared/models/activitypub/activity.ts b/shared/models/activitypub/activity.ts index a2494da25..254daf118 100644 --- a/shared/models/activitypub/activity.ts +++ b/shared/models/activitypub/activity.ts @@ -4,10 +4,11 @@ import { } from './objects' import { ActivityPubSignature } from './activitypub-signature' -export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate | ActivityFlag +export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate | ActivityFlag | + ActivityDelete | ActivityFollow | ActivityAccept // Flag -> report abuse -export type ActivityType = 'Create' | 'Add' | 'Update' | 'Flag' +export type ActivityType = 'Create' | 'Add' | 'Update' | 'Flag' | 'Delete' | 'Follow' | 'Accept' export interface BaseActivity { '@context'?: any[] @@ -37,3 +38,16 @@ export interface ActivityFlag extends BaseActivity { type: 'Flag' object: string } + +export interface ActivityDelete extends BaseActivity { + type: 'Delete' +} + +export interface ActivityFollow extends BaseActivity { + type: 'Follow' + object: string +} + +export interface ActivityAccept extends BaseActivity { + type: 'Accept' +} diff --git a/shared/models/index.ts b/shared/models/index.ts index 0ccb84d24..28decac03 100644 --- a/shared/models/index.ts +++ b/shared/models/index.ts @@ -1,3 +1,4 @@ +export * from './accounts' export * from './activitypub' export * from './pods' export * from './users' -- cgit v1.2.3