X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Furl.ts;h=6475c4218c3aa412e473656600e61023129e0546;hb=5e3bb76cb6cc17ff2ba5a492ea3ed8358e66a00a;hp=41ac0f9a8c0e9ecc41dc6278614b9cdb86639079;hpb=892211e8493b1f992fce7616cb1e48b7ff87a1dc;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/url.ts b/server/lib/activitypub/url.ts index 41ac0f9a8..6475c4218 100644 --- a/server/lib/activitypub/url.ts +++ b/server/lib/activitypub/url.ts @@ -21,26 +21,38 @@ function getVideoAbuseActivityPubUrl (videoAbuse: VideoAbuseInstance) { return CONFIG.WEBSERVER.URL + '/admin/video-abuses/' + videoAbuse.id } +function getVideoViewActivityPubUrl (byAccount: AccountInstance, video: VideoInstance) { + return video.url + '/views/' + byAccount.uuid + '/' + new Date().toISOString() +} + +function getVideoLikeActivityPubUrl (byAccount: AccountInstance, video: VideoInstance) { + return byAccount.url + '/likes/' + video.id +} + +function getVideoDislikeActivityPubUrl (byAccount: AccountInstance, video: VideoInstance) { + return byAccount.url + '/dislikes/' + video.id +} + function getAccountFollowActivityPubUrl (accountFollow: AccountFollowInstance) { const me = accountFollow.AccountFollower const following = accountFollow.AccountFollowing - return me.url + '#follows/' + following.id + return me.url + '/follows/' + following.id } function getAccountFollowAcceptActivityPubUrl (accountFollow: AccountFollowInstance) { const follower = accountFollow.AccountFollower const me = accountFollow.AccountFollowing - return follower.url + '#accepts/follows/' + me.id + return follower.url + '/accepts/follows/' + me.id } function getAnnounceActivityPubUrl (originalUrl: string, byAccount: AccountInstance) { - return originalUrl + '#announces/' + byAccount.id + return originalUrl + '/announces/' + byAccount.id } function getUpdateActivityPubUrl (originalUrl: string, updatedAt: string) { - return originalUrl + '#updates/' + updatedAt + return originalUrl + '/updates/' + updatedAt } function getUndoActivityPubUrl (originalUrl: string) { @@ -56,5 +68,8 @@ export { getAccountFollowAcceptActivityPubUrl, getAnnounceActivityPubUrl, getUpdateActivityPubUrl, - getUndoActivityPubUrl + getUndoActivityPubUrl, + getVideoViewActivityPubUrl, + getVideoLikeActivityPubUrl, + getVideoDislikeActivityPubUrl }