diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-27 13:33:56 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-27 13:33:56 +0200 |
commit | 07197db4c567f22bbc9c12339062896dc76bac2f (patch) | |
tree | 5682f0d88fc1b4032018e5122ed42eb9967fd743 /server/controllers/api/videos/index.ts | |
parent | da99ccf2681bcbc172a96cf30e7b733948767faa (diff) | |
download | PeerTube-07197db4c567f22bbc9c12339062896dc76bac2f.tar.gz PeerTube-07197db4c567f22bbc9c12339062896dc76bac2f.tar.zst PeerTube-07197db4c567f22bbc9c12339062896dc76bac2f.zip |
Try to refractor activities sending
There is still a need for work on this part though
Diffstat (limited to 'server/controllers/api/videos/index.ts')
-rw-r--r-- | server/controllers/api/videos/index.ts | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 690872320..552e5edac 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -20,7 +20,7 @@ import { | |||
20 | VIDEO_PRIVACIES | 20 | VIDEO_PRIVACIES |
21 | } from '../../../initializers' | 21 | } from '../../../initializers' |
22 | import { fetchRemoteVideoDescription, getVideoActivityPubUrl, shareVideoByServerAndChannel } from '../../../lib/activitypub' | 22 | import { fetchRemoteVideoDescription, getVideoActivityPubUrl, shareVideoByServerAndChannel } from '../../../lib/activitypub' |
23 | import { sendCreateVideo, sendCreateViewToOrigin, sendCreateViewToVideoFollowers, sendUpdateVideo } from '../../../lib/activitypub/send' | 23 | import { sendCreateVideo, sendCreateView, sendUpdateVideo } from '../../../lib/activitypub/send' |
24 | import { JobQueue } from '../../../lib/job-queue' | 24 | import { JobQueue } from '../../../lib/job-queue' |
25 | import { Redis } from '../../../lib/redis' | 25 | import { Redis } from '../../../lib/redis' |
26 | import { | 26 | import { |
@@ -365,11 +365,7 @@ async function viewVideo (req: express.Request, res: express.Response) { | |||
365 | 365 | ||
366 | const serverAccount = await getServerActor() | 366 | const serverAccount = await getServerActor() |
367 | 367 | ||
368 | if (videoInstance.isOwned()) { | 368 | await sendCreateView(serverAccount, videoInstance, undefined) |
369 | await sendCreateViewToVideoFollowers(serverAccount, videoInstance, undefined) | ||
370 | } else { | ||
371 | await sendCreateViewToOrigin(serverAccount, videoInstance, undefined) | ||
372 | } | ||
373 | 369 | ||
374 | return res.status(204).end() | 370 | return res.status(204).end() |
375 | } | 371 | } |