aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-30 16:51:27 +0200
committerChocobozzz <me@florianbigard.com>2021-08-02 10:39:51 +0200
commitd26836cd95e981d636006652927773c7943e77ce (patch)
tree934a4a835bfddbf1c2c7da98d84ebd7623d60d49 /server/lib/activitypub
parent2bee9db56ade2b3b1bb0efa8716840d87efdb93f (diff)
downloadPeerTube-d26836cd95e981d636006652927773c7943e77ce.tar.gz
PeerTube-d26836cd95e981d636006652927773c7943e77ce.tar.zst
PeerTube-d26836cd95e981d636006652927773c7943e77ce.zip
Refactor notifier
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r--server/lib/activitypub/url.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/lib/activitypub/url.ts b/server/lib/activitypub/url.ts
index 7816b0be0..338398f2b 100644
--- a/server/lib/activitypub/url.ts
+++ b/server/lib/activitypub/url.ts
@@ -1,5 +1,6 @@
1import { WEBSERVER } from '../../initializers/constants' 1import { WEBSERVER } from '../../initializers/constants'
2import { 2import {
3 MAbuseFull,
3 MAbuseId, 4 MAbuseId,
4 MActor, 5 MActor,
5 MActorFollowActors, 6 MActorFollowActors,
@@ -112,6 +113,14 @@ function getUndoActivityPubUrl (originalUrl: string) {
112 return originalUrl + '/undo' 113 return originalUrl + '/undo'
113} 114}
114 115
116// ---------------------------------------------------------------------------
117
118function getAbuseTargetUrl (abuse: MAbuseFull) {
119 return abuse.VideoAbuse?.Video?.url ||
120 abuse.VideoCommentAbuse?.VideoComment?.url ||
121 abuse.FlaggedAccount.Actor.url
122}
123
115export { 124export {
116 getLocalVideoActivityPubUrl, 125 getLocalVideoActivityPubUrl,
117 getLocalVideoPlaylistActivityPubUrl, 126 getLocalVideoPlaylistActivityPubUrl,
@@ -135,5 +144,6 @@ export {
135 getLocalVideoSharesActivityPubUrl, 144 getLocalVideoSharesActivityPubUrl,
136 getLocalVideoCommentsActivityPubUrl, 145 getLocalVideoCommentsActivityPubUrl,
137 getLocalVideoLikesActivityPubUrl, 146 getLocalVideoLikesActivityPubUrl,
138 getLocalVideoDislikesActivityPubUrl 147 getLocalVideoDislikesActivityPubUrl,
148 getAbuseTargetUrl
139} 149}