]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/audience.ts
Remove resumable cache after upload success
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / audience.ts
index 9933ae2b5cd8b9176495475a74620fbf90c2d6fc..d0558f19174f971bde63a5152c6725f2d08f30f7 100644 (file)
@@ -1,10 +1,10 @@
 import { Transaction } from 'sequelize'
 import { ActivityAudience } from '../../../shared/models/activitypub'
 import { ACTIVITY_PUB } from '../../initializers/constants'
-import { ActorModel } from '../../models/activitypub/actor'
+import { ActorModel } from '../../models/actor/actor'
 import { VideoModel } from '../../models/video/video'
 import { VideoShareModel } from '../../models/video/video-share'
-import { MActorFollowersUrl, MActorLight, MActorUrl, MCommentOwner, MCommentOwnerVideo, MVideoId } from '../../typings/models'
+import { MActorFollowersUrl, MActorLight, MActorUrl, MCommentOwner, MCommentOwnerVideo, MVideoId } from '../../types/models'
 
 function getRemoteVideoAudience (accountActor: MActorUrl, actorsInvolvedInVideo: MActorFollowersUrl[]): ActivityAudience {
   return {
@@ -32,6 +32,8 @@ function getVideoCommentAudience (
 
   // Send to actors we reply to
   for (const parentComment of threadParentComments) {
+    if (parentComment.isDeleted()) continue
+
     cc.push(parentComment.Account.Actor.url)
   }
 
@@ -53,7 +55,7 @@ async function getActorsInvolvedInVideo (video: MVideoId, t: Transaction) {
 
   const videoAll = video as VideoModel
 
-  const videoActor = videoAll.VideoChannel && videoAll.VideoChannel.Account
+  const videoActor = videoAll.VideoChannel?.Account
     ? videoAll.VideoChannel.Account.Actor
     : await ActorModel.loadFromAccountByVideoId(video.id, t)