aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video-comment.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-27 13:33:56 +0200
committerChocobozzz <me@florianbigard.com>2018-03-27 13:33:56 +0200
commit07197db4c567f22bbc9c12339062896dc76bac2f (patch)
tree5682f0d88fc1b4032018e5122ed42eb9967fd743 /server/lib/video-comment.ts
parentda99ccf2681bcbc172a96cf30e7b733948767faa (diff)
downloadPeerTube-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.ts8
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'
5import { VideoModel } from '../models/video/video' 5import { VideoModel } from '../models/video/video'
6import { VideoCommentModel } from '../models/video/video-comment' 6import { VideoCommentModel } from '../models/video/video-comment'
7import { getVideoCommentActivityPubUrl } from './activitypub' 7import { getVideoCommentActivityPubUrl } from './activitypub'
8import { sendCreateVideoCommentToOrigin, sendCreateVideoCommentToVideoFollowers } from './activitypub/send' 8import { sendCreateVideoComment } from './activitypub/send'
9 9
10async function createVideoComment (obj: { 10async 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}