diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2018-09-18 13:08:27 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2018-09-18 13:08:27 +0900 |
| commit | 11496d887e89ceccd64035f9e1836c5d415f4349 (patch) | |
| tree | 6c3d3b542a893127b5b0afe1f05627b703838915 /src/remote/activitypub | |
| parent | 8.50.0 (diff) | |
| download | misskey-11496d887e89ceccd64035f9e1836c5d415f4349.tar.gz misskey-11496d887e89ceccd64035f9e1836c5d415f4349.tar.bz2 misskey-11496d887e89ceccd64035f9e1836c5d415f4349.zip | |
Publish pinned notes (#2731)
Diffstat (limited to 'src/remote/activitypub')
| -rw-r--r-- | src/remote/activitypub/renderer/add.ts | 9 | ||||
| -rw-r--r-- | src/remote/activitypub/renderer/ordered-collection.ts | 4 | ||||
| -rw-r--r-- | src/remote/activitypub/renderer/person.ts | 1 | ||||
| -rw-r--r-- | src/remote/activitypub/renderer/remove.ts | 9 | ||||
| -rw-r--r-- | src/remote/activitypub/type.ts | 1 |
5 files changed, 23 insertions, 1 deletions
diff --git a/src/remote/activitypub/renderer/add.ts b/src/remote/activitypub/renderer/add.ts new file mode 100644 index 0000000000..4d6fe392aa --- /dev/null +++ b/src/remote/activitypub/renderer/add.ts @@ -0,0 +1,9 @@ +import config from '../../../config'; +import { ILocalUser } from '../../../models/user'; + +export default (user: ILocalUser, target: any, object: any) => ({ + type: 'Add', + actor: `${config.url}/users/${user._id}`, + target, + object +}); diff --git a/src/remote/activitypub/renderer/ordered-collection.ts b/src/remote/activitypub/renderer/ordered-collection.ts index 3c448cf873..5461005983 100644 --- a/src/remote/activitypub/renderer/ordered-collection.ts +++ b/src/remote/activitypub/renderer/ordered-collection.ts @@ -4,8 +4,9 @@ * @param totalItems Total number of items * @param first URL of first page (optional) * @param last URL of last page (optional) + * @param orderedItems attached objects (optional) */ -export default function(id: string, totalItems: any, first: string, last: string) { +export default function(id: string, totalItems: any, first?: string, last?: string, orderedItems?: object) { const page: any = { id, type: 'OrderedCollection', @@ -14,6 +15,7 @@ export default function(id: string, totalItems: any, first: string, last: string if (first) page.first = first; if (last) page.last = last; + if (orderedItems) page.orderedItems = orderedItems; return page; } diff --git a/src/remote/activitypub/renderer/person.ts b/src/remote/activitypub/renderer/person.ts index 78918af368..52485e6959 100644 --- a/src/remote/activitypub/renderer/person.ts +++ b/src/remote/activitypub/renderer/person.ts @@ -21,6 +21,7 @@ export default async (user: ILocalUser) => { outbox: `${id}/outbox`, followers: `${id}/followers`, following: `${id}/following`, + featured: `${id}/collections/featured`, sharedInbox: `${config.url}/inbox`, url: `${config.url}/@${user.username}`, preferredUsername: user.username, diff --git a/src/remote/activitypub/renderer/remove.ts b/src/remote/activitypub/renderer/remove.ts new file mode 100644 index 0000000000..ed840be751 --- /dev/null +++ b/src/remote/activitypub/renderer/remove.ts @@ -0,0 +1,9 @@ +import config from '../../../config'; +import { ILocalUser } from '../../../models/user'; + +export default (user: ILocalUser, target: any, object: any) => ({ + type: 'Remove', + actor: `${config.url}/users/${user._id}`, + target, + object +}); diff --git a/src/remote/activitypub/type.ts b/src/remote/activitypub/type.ts index 28763d3e83..7bbea5fd18 100644 --- a/src/remote/activitypub/type.ts +++ b/src/remote/activitypub/type.ts @@ -53,6 +53,7 @@ export interface IPerson extends IObject { publicKey: any; followers: any; following: any; + featured?: any; outbox: any; endpoints: string[]; } |