diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-12-15 03:37:19 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-12-15 03:37:19 +0900 |
| commit | 3e85aad80a882abc764c13a0fc40e3333bb61c4b (patch) | |
| tree | c4ef1a407e5a714dda25cb907bc4d40acb89ec26 /src/remote/activitypub/renderer | |
| parent | Fix #5637 (#5638) (diff) | |
| download | sharkey-3e85aad80a882abc764c13a0fc40e3333bb61c4b.tar.gz sharkey-3e85aad80a882abc764c13a0fc40e3333bb61c4b.tar.bz2 sharkey-3e85aad80a882abc764c13a0fc40e3333bb61c4b.zip | |
Implement Talk has read federation (#5636)
* Talk read
* fix
* 複数のRead ActivityはCollectionとして送るように
* あ
Diffstat (limited to 'src/remote/activitypub/renderer')
| -rw-r--r-- | src/remote/activitypub/renderer/ordered-collection.ts | 2 | ||||
| -rw-r--r-- | src/remote/activitypub/renderer/read.ts | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/remote/activitypub/renderer/ordered-collection.ts b/src/remote/activitypub/renderer/ordered-collection.ts index 5461005983..68870a0ecd 100644 --- a/src/remote/activitypub/renderer/ordered-collection.ts +++ b/src/remote/activitypub/renderer/ordered-collection.ts @@ -6,7 +6,7 @@ * @param last URL of last page (optional) * @param orderedItems attached objects (optional) */ -export default function(id: string, totalItems: any, first?: string, last?: string, orderedItems?: object) { +export default function(id: string | null, totalItems: any, first?: string, last?: string, orderedItems?: object) { const page: any = { id, type: 'OrderedCollection', diff --git a/src/remote/activitypub/renderer/read.ts b/src/remote/activitypub/renderer/read.ts new file mode 100644 index 0000000000..c53b47859f --- /dev/null +++ b/src/remote/activitypub/renderer/read.ts @@ -0,0 +1,9 @@ +import config from '../../../config'; +import { ILocalUser } from '../../../models/entities/user'; +import { MessagingMessage } from '../../../models/entities/messaging-message'; + +export const renderReadActivity = (user: ILocalUser, message: MessagingMessage) => ({ + type: 'Read', + actor: `${config.url}/users/${user.id}`, + object: message.uri +}); |