import { getActorFollowAcceptActivityPubUrl, getActorFollowActivityPubUrl } from '../url'
import { unicastTo } from './utils'
import { followActivityData } from './send-follow'
+import { logger } from '../../../helpers/logger'
async function sendAccept (actorFollow: ActorFollowModel) {
const follower = actorFollow.ActorFollower
const me = actorFollow.ActorFollowing
+ logger.info('Creating job to accept follower %s.', follower.url)
+
const followUrl = getActorFollowActivityPubUrl(actorFollow)
const followData = followActivityData(followUrl, follower, me)
import { VideoShareModel } from '../../../models/video/video-share'
import { broadcastToFollowers } from './utils'
import { getActorsInvolvedInVideo, getAudience, getObjectFollowersAudience } from '../audience'
+import { logger } from '../../../helpers/logger'
async function buildVideoAnnounce (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) {
const announcedObject = video.url
async function sendVideoAnnounce (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) {
const data = await buildVideoAnnounce(byActor, videoShare, video, t)
+ logger.info('Creating job to send announce %s.', videoShare.url)
+
return broadcastToFollowers(data, byActor, [ byActor ], t)
}
getVideoAudience,
getVideoCommentAudience
} from '../audience'
+import { logger } from '../../../helpers/logger'
async function sendCreateVideo (video: VideoModel, t: Transaction) {
if (video.privacy === VideoPrivacy.PRIVATE) return undefined
+ logger.info('Creating job to send video creation of %s.', video.url)
+
const byActor = video.VideoChannel.Account.Actor
const videoObject = video.toActivityPubObject()
async function sendVideoAbuse (byActor: ActorModel, videoAbuse: VideoAbuseModel, video: VideoModel, t: Transaction) {
const url = getVideoAbuseActivityPubUrl(videoAbuse)
+ logger.info('Creating job to send video abuse %s.', url)
+
const audience = { to: [ video.VideoChannel.Account.Actor.url ], cc: [] }
const data = createActivityData(url, byActor, videoAbuse.toActivityPubObject(), audience)
}
async function sendCreateVideoComment (comment: VideoCommentModel, t: Transaction) {
+ logger.info('Creating job to send comment %s.', comment.url)
+
const isOrigin = comment.Video.isOwned()
const byActor = comment.Account.Actor
}
async function sendCreateView (byActor: ActorModel, video: VideoModel, t: Transaction) {
+ logger.info('Creating job to send view of %s.', video.url)
+
const url = getVideoViewActivityPubUrl(byActor, video)
const viewActivityData = createViewActivityData(byActor, video)
}
async function sendCreateDislike (byActor: ActorModel, video: VideoModel, t: Transaction) {
+ logger.info('Creating job to dislike %s.', video.url)
+
const url = getVideoDislikeActivityPubUrl(byActor, video)
const dislikeActivityData = createDislikeActivityData(byActor, video)
import { getDeleteActivityPubUrl } from '../url'
import { broadcastToActors, broadcastToFollowers, unicastTo } from './utils'
import { audiencify, getActorsInvolvedInVideo, getVideoCommentAudience } from '../audience'
+import { logger } from '../../../helpers/logger'
async function sendDeleteVideo (video: VideoModel, t: Transaction) {
+ logger.info('Creating job to broadcast delete of video %s.', video.url)
+
const url = getDeleteActivityPubUrl(video.url)
const byActor = video.VideoChannel.Account.Actor
}
async function sendDeleteActor (byActor: ActorModel, t: Transaction) {
+ logger.info('Creating job to broadcast delete of actor %s.', byActor.url)
+
const url = getDeleteActivityPubUrl(byActor.url)
const data = deleteActivityData(url, byActor.url, byActor)
}
async function sendDeleteVideoComment (videoComment: VideoCommentModel, t: Transaction) {
+ logger.info('Creating job to send delete of comment %s.', videoComment.url)
+
const isVideoOrigin = videoComment.Video.isOwned()
const url = getDeleteActivityPubUrl(videoComment.url)
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
import { getActorFollowActivityPubUrl } from '../url'
import { unicastTo } from './utils'
+import { logger } from '../../../helpers/logger'
function sendFollow (actorFollow: ActorFollowModel) {
const me = actorFollow.ActorFollower
const following = actorFollow.ActorFollowing
+ logger.info('Creating job to send follow request to %s.', following.url)
+
const url = getActorFollowActivityPubUrl(actorFollow)
const data = followActivityData(url, me, following)
import { getVideoLikeActivityPubUrl } from '../url'
import { broadcastToFollowers, unicastTo } from './utils'
import { audiencify, getActorsInvolvedInVideo, getAudience, getObjectFollowersAudience, getVideoAudience } from '../audience'
+import { logger } from '../../../helpers/logger'
async function sendLike (byActor: ActorModel, video: VideoModel, t: Transaction) {
+ logger.info('Creating job to like %s.', video.url)
+
const url = getVideoLikeActivityPubUrl(byActor, video)
const accountsInvolvedInVideo = await getActorsInvolvedInVideo(video, t)
import { likeActivityData } from './send-like'
import { VideoShareModel } from '../../../models/video/video-share'
import { buildVideoAnnounce } from './send-announce'
+import { logger } from '../../../helpers/logger'
async function sendUndoFollow (actorFollow: ActorFollowModel, t: Transaction) {
const me = actorFollow.ActorFollower
const following = actorFollow.ActorFollowing
+ logger.info('Creating job to send an unfollow request to %s.', following.url)
+
const followUrl = getActorFollowActivityPubUrl(actorFollow)
const undoUrl = getUndoActivityPubUrl(followUrl)
}
async function sendUndoLike (byActor: ActorModel, video: VideoModel, t: Transaction) {
+ logger.info('Creating job to undo a like of video %s.', video.url)
+
const likeUrl = getVideoLikeActivityPubUrl(byActor, video)
const undoUrl = getUndoActivityPubUrl(likeUrl)
}
async function sendUndoDislike (byActor: ActorModel, video: VideoModel, t: Transaction) {
+ logger.info('Creating job to undo a dislike of video %s.', video.url)
+
const dislikeUrl = getVideoDislikeActivityPubUrl(byActor, video)
const undoUrl = getUndoActivityPubUrl(dislikeUrl)
}
async function sendUndoAnnounce (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) {
+ logger.info('Creating job to undo announce %s.', videoShare.url)
+
const undoUrl = getUndoActivityPubUrl(videoShare.url)
const actorsInvolvedInVideo = await getActorsInvolvedInVideo(video, t)
import { getUpdateActivityPubUrl } from '../url'
import { broadcastToFollowers } from './utils'
import { audiencify, getAudience } from '../audience'
+import { logger } from '../../../helpers/logger'
async function sendUpdateVideo (video: VideoModel, t: Transaction) {
+ logger.info('Creating job to update video %s.', video.url)
+
const byActor = video.VideoChannel.Account.Actor
const url = getUpdateActivityPubUrl(video.url, video.updatedAt.toISOString())
async function sendUpdateActor (accountOrChannel: AccountModel | VideoChannelModel, t: Transaction) {
const byActor = accountOrChannel.Actor
+ logger.info('Creating job to update actor %s.', byActor.url)
+
const url = getUpdateActivityPubUrl(byActor.url, byActor.updatedAt.toISOString())
const accountOrChannelObject = accountOrChannel.toActivityPubObject()
const audience = getAudience(byActor)
followersException: ActorModel[] = [],
additionalFollowerUrls: string[] = []
) {
+ logger.info('Forwarding activity %s.', activity.id)
+
const to = activity.to || []
const cc = activity.cc || []
}
if (instance.isOwned()) {
- logger.debug('Sending delete of actor of account %s.', instance.Actor.url)
return sendDeleteActor(instance.Actor, options.transaction)
}
import { Avatar } from '../../../shared/models/avatars/avatar.model'
import { unlinkPromise } from '../../helpers/core-utils'
import { CONFIG, STATIC_PATHS } from '../../initializers'
+import { logger } from '../../helpers/logger'
@Table({
tableName: 'avatar'
@AfterDestroy
static removeFilesAndSendDelete (instance: AvatarModel) {
+ logger.info('Removing avatar file %s.', instance.filename)
return instance.removeAvatar()
}
}
if (instance.isOwned()) {
- logger.debug('Removing captions %s of video %s.', instance.Video.uuid, instance.language)
+ logger.info('Removing captions %s of video %s.', instance.Video.uuid, instance.language)
try {
await instance.removeCaptionFile()
}
if (instance.Actor.isOwned()) {
- logger.debug('Sending delete of actor of video channel %s.', instance.Actor.url)
-
return sendDeleteActor(instance.Actor, options.transaction)
}
}) as VideoChannelModel
}
- logger.debug('Sending delete of video %s.', instance.url)
-
return sendDeleteVideo(instance, options.transaction)
}
static async removeFiles (instance: VideoModel) {
const tasks: Promise<any>[] = []
- logger.debug('Removing files of video %s.', instance.url)
+ logger.info('Removing files of video %s.', instance.url)
tasks.push(instance.removeThumbnail())