diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-23 14:19:55 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-27 19:40:53 +0100 |
commit | 0032ebe94aa83fab761c7de3ceb6210ac4532824 (patch) | |
tree | 3ea407d7ea6de4c7f7bc66caba7e23c0cc4036e3 /shared | |
parent | d52eb8f656242c7e34afdb2dee681861fb9bce35 (diff) | |
download | PeerTube-0032ebe94aa83fab761c7de3ceb6210ac4532824.tar.gz PeerTube-0032ebe94aa83fab761c7de3ceb6210ac4532824.tar.zst PeerTube-0032ebe94aa83fab761c7de3ceb6210ac4532824.zip |
Federate likes/dislikes
Diffstat (limited to 'shared')
-rw-r--r-- | shared/models/activitypub/activity.ts | 14 | ||||
-rw-r--r-- | shared/models/activitypub/objects/dislike-object.ts | 5 | ||||
-rw-r--r-- | shared/models/activitypub/objects/index.ts | 1 |
3 files changed, 16 insertions, 4 deletions
diff --git a/shared/models/activitypub/activity.ts b/shared/models/activitypub/activity.ts index ce150bc12..cbfd6157a 100644 --- a/shared/models/activitypub/activity.ts +++ b/shared/models/activitypub/activity.ts | |||
@@ -1,13 +1,14 @@ | |||
1 | import { ActivityPubSignature } from './activitypub-signature' | 1 | import { ActivityPubSignature } from './activitypub-signature' |
2 | import { VideoChannelObject, VideoTorrentObject } from './objects' | 2 | import { VideoChannelObject, VideoTorrentObject } from './objects' |
3 | import { DislikeObject } from './objects/dislike-object' | ||
3 | import { VideoAbuseObject } from './objects/video-abuse-object' | 4 | import { VideoAbuseObject } from './objects/video-abuse-object' |
4 | import { ViewObject } from './objects/view-object' | 5 | import { ViewObject } from './objects/view-object' |
5 | 6 | ||
6 | export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate | | 7 | export type Activity = ActivityCreate | ActivityAdd | ActivityUpdate | |
7 | ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | | 8 | ActivityDelete | ActivityFollow | ActivityAccept | ActivityAnnounce | |
8 | ActivityUndo | 9 | ActivityUndo | ActivityLike |
9 | 10 | ||
10 | export type ActivityType = 'Create' | 'Add' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 11 | export type ActivityType = 'Create' | 'Add' | 'Update' | 'Delete' | 'Follow' | 'Accept' | 'Announce' | 'Undo' | 'Like' |
11 | 12 | ||
12 | export interface BaseActivity { | 13 | export interface BaseActivity { |
13 | '@context'?: any[] | 14 | '@context'?: any[] |
@@ -21,7 +22,7 @@ export interface BaseActivity { | |||
21 | 22 | ||
22 | export interface ActivityCreate extends BaseActivity { | 23 | export interface ActivityCreate extends BaseActivity { |
23 | type: 'Create' | 24 | type: 'Create' |
24 | object: VideoChannelObject | VideoAbuseObject | ViewObject | 25 | object: VideoChannelObject | VideoAbuseObject | ViewObject | DislikeObject |
25 | } | 26 | } |
26 | 27 | ||
27 | export interface ActivityAdd extends BaseActivity { | 28 | export interface ActivityAdd extends BaseActivity { |
@@ -55,5 +56,10 @@ export interface ActivityAnnounce extends BaseActivity { | |||
55 | 56 | ||
56 | export interface ActivityUndo extends BaseActivity { | 57 | export interface ActivityUndo extends BaseActivity { |
57 | type: 'Undo', | 58 | type: 'Undo', |
58 | object: ActivityFollow | 59 | object: ActivityFollow | ActivityLike | ActivityCreate |
60 | } | ||
61 | |||
62 | export interface ActivityLike extends BaseActivity { | ||
63 | type: 'Like', | ||
64 | object: string | ||
59 | } | 65 | } |
diff --git a/shared/models/activitypub/objects/dislike-object.ts b/shared/models/activitypub/objects/dislike-object.ts new file mode 100644 index 000000000..295175774 --- /dev/null +++ b/shared/models/activitypub/objects/dislike-object.ts | |||
@@ -0,0 +1,5 @@ | |||
1 | export interface DislikeObject { | ||
2 | type: 'Dislike', | ||
3 | actor: string | ||
4 | object: string | ||
5 | } | ||
diff --git a/shared/models/activitypub/objects/index.ts b/shared/models/activitypub/objects/index.ts index d92f772e2..f1f761e44 100644 --- a/shared/models/activitypub/objects/index.ts +++ b/shared/models/activitypub/objects/index.ts | |||
@@ -3,3 +3,4 @@ export * from './video-abuse-object' | |||
3 | export * from './video-channel-object' | 3 | export * from './video-channel-object' |
4 | export * from './video-torrent-object' | 4 | export * from './video-torrent-object' |
5 | export * from './view-object' | 5 | export * from './view-object' |
6 | export * from './dislike-object' | ||