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/lib/video-comment.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/lib/video-comment.ts')
-rw-r--r-- | server/lib/video-comment.ts | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/server/lib/video-comment.ts b/server/lib/video-comment.ts index 0d744c526..f88e5cfdf 100644 --- a/server/lib/video-comment.ts +++ b/server/lib/video-comment.ts | |||
@@ -5,7 +5,7 @@ import { AccountModel } from '../models/account/account' | |||
5 | import { VideoModel } from '../models/video/video' | 5 | import { VideoModel } from '../models/video/video' |
6 | import { VideoCommentModel } from '../models/video/video-comment' | 6 | import { VideoCommentModel } from '../models/video/video-comment' |
7 | import { getVideoCommentActivityPubUrl } from './activitypub' | 7 | import { getVideoCommentActivityPubUrl } from './activitypub' |
8 | import { sendCreateVideoCommentToOrigin, sendCreateVideoCommentToVideoFollowers } from './activitypub/send' | 8 | import { sendCreateVideoComment } from './activitypub/send' |
9 | 9 | ||
10 | async function createVideoComment (obj: { | 10 | async function createVideoComment (obj: { |
11 | text: string, | 11 | text: string, |
@@ -37,11 +37,7 @@ async function createVideoComment (obj: { | |||
37 | savedComment.Video = obj.video | 37 | savedComment.Video = obj.video |
38 | savedComment.Account = obj.account | 38 | savedComment.Account = obj.account |
39 | 39 | ||
40 | if (savedComment.Video.isOwned()) { | 40 | await sendCreateVideoComment(savedComment, t) |
41 | await sendCreateVideoCommentToVideoFollowers(savedComment, t) | ||
42 | } else { | ||
43 | await sendCreateVideoCommentToOrigin(savedComment, t) | ||
44 | } | ||
45 | 41 | ||
46 | return savedComment | 42 | return savedComment |
47 | } | 43 | } |