diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-30 16:51:27 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-02 10:39:51 +0200 |
commit | d26836cd95e981d636006652927773c7943e77ce (patch) | |
tree | 934a4a835bfddbf1c2c7da98d84ebd7623d60d49 /server/lib/activitypub | |
parent | 2bee9db56ade2b3b1bb0efa8716840d87efdb93f (diff) | |
download | PeerTube-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.ts | 12 |
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 @@ | |||
1 | import { WEBSERVER } from '../../initializers/constants' | 1 | import { WEBSERVER } from '../../initializers/constants' |
2 | import { | 2 | import { |
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 | |||
118 | function getAbuseTargetUrl (abuse: MAbuseFull) { | ||
119 | return abuse.VideoAbuse?.Video?.url || | ||
120 | abuse.VideoCommentAbuse?.VideoComment?.url || | ||
121 | abuse.FlaggedAccount.Actor.url | ||
122 | } | ||
123 | |||
115 | export { | 124 | export { |
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 | } |