From fadf619ad61a016c1c7fc53de5a8f398a4f77519 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 14 Dec 2017 11:18:49 +0100 Subject: Save --- server/controllers/activitypub/outbox.ts | 4 ++-- server/controllers/api/server/follows.ts | 2 +- server/controllers/api/videos/channel.ts | 11 +++++------ server/controllers/webfinger.ts | 4 ++-- 4 files changed, 10 insertions(+), 11 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/activitypub/outbox.ts b/server/controllers/activitypub/outbox.ts index dc6b72a6e..6ed8a3454 100644 --- a/server/controllers/activitypub/outbox.ts +++ b/server/controllers/activitypub/outbox.ts @@ -40,14 +40,14 @@ async function outboxController (req: express.Request, res: express.Response, ne // This is a shared video const videoChannel = video.VideoChannel if (video.VideoShares !== undefined && video.VideoShares.length !== 0) { - const addActivity = await addActivityData(video.url, videoChannel.Account, video, videoChannel.url, videoObject, undefined) + const addActivity = await addActivityData(video.url, videoChannel.Account, video, videoChannel.Actor.url, videoObject, undefined) const url = getAnnounceActivityPubUrl(video.url, account) const announceActivity = await announceActivityData(url, account, addActivity, undefined) activities.push(announceActivity) } else { - const addActivity = await addActivityData(video.url, account, video, videoChannel.url, videoObject, undefined) + const addActivity = await addActivityData(video.url, account, video, videoChannel.Actor.url, videoObject, undefined) activities.push(addActivity) } diff --git a/server/controllers/api/server/follows.ts b/server/controllers/api/server/follows.ts index 913998e3a..497edb8eb 100644 --- a/server/controllers/api/server/follows.ts +++ b/server/controllers/api/server/follows.ts @@ -157,7 +157,7 @@ async function removeFollow (req: express.Request, res: express.Response, next: // This could be long so don't wait this task const following = follow.AccountFollowing following.destroy() - .catch(err => logger.error('Cannot destroy account that we do not follow anymore %s.', following.url, err)) + .catch(err => logger.error('Cannot destroy account that we do not follow anymore %s.', following.Actor.url, err)) return res.status(204).end() } diff --git a/server/controllers/api/videos/channel.ts b/server/controllers/api/videos/channel.ts index 683b0448d..315469115 100644 --- a/server/controllers/api/videos/channel.ts +++ b/server/controllers/api/videos/channel.ts @@ -92,16 +92,15 @@ async function addVideoChannelRetryWrapper (req: express.Request, res: express.R return res.type('json').status(204).end() } -async function addVideoChannel (req: express.Request, res: express.Response) { +function addVideoChannel (req: express.Request, res: express.Response) { const videoChannelInfo: VideoChannelCreate = req.body const account: AccountModel = res.locals.oauth.token.User.Account - let videoChannelCreated: VideoChannelModel - await sequelizeTypescript.transaction(async t => { - videoChannelCreated = await createVideoChannel(videoChannelInfo, account, t) - }) + return sequelizeTypescript.transaction(async t => { + const videoChannelCreated = await createVideoChannel(videoChannelInfo, account, t) - logger.info('Video channel with uuid %s created.', videoChannelCreated.uuid) + logger.info('Video channel with uuid %s created.', videoChannelCreated.uuid) + }) } async function updateVideoChannelRetryWrapper (req: express.Request, res: express.Response, next: express.NextFunction) { diff --git a/server/controllers/webfinger.ts b/server/controllers/webfinger.ts index bb2ea40fa..8829500bc 100644 --- a/server/controllers/webfinger.ts +++ b/server/controllers/webfinger.ts @@ -23,12 +23,12 @@ function webfingerController (req: express.Request, res: express.Response, next: const json = { subject: req.query.resource, - aliases: [ account.url ], + aliases: [ account.Actor.url ], links: [ { rel: 'self', type: 'application/activity+json', - href: account.url + href: account.Actor.url } ] } -- cgit v1.2.3