From 361805c48b14c5402c9984485c67c45a1a3113cc Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 19 Nov 2018 14:34:01 +0100 Subject: Fix checkbox margins --- server/lib/activitypub/actor.ts | 8 ++++---- server/lib/activitypub/process/process.ts | 4 ++-- server/lib/activitypub/share.ts | 4 ++-- server/lib/activitypub/video-rates.ts | 4 ++-- server/lib/activitypub/videos.ts | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'server/lib') diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts index 218dbc6a7..504263c99 100644 --- a/server/lib/activitypub/actor.ts +++ b/server/lib/activitypub/actor.ts @@ -5,15 +5,15 @@ import * as url from 'url' import * as uuidv4 from 'uuid/v4' import { ActivityPubActor, ActivityPubActorType } from '../../../shared/models/activitypub' import { ActivityPubAttributedTo } from '../../../shared/models/activitypub/objects' -import { checkUrlsSameHost, getActorUrl } from '../../helpers/activitypub' +import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub' import { isActorObjectValid, normalizeActor } from '../../helpers/custom-validators/activitypub/actor' import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' import { retryTransactionWrapper, updateInstanceWithAnother } from '../../helpers/database-utils' import { logger } from '../../helpers/logger' import { createPrivateAndPublicKeys } from '../../helpers/peertube-crypto' -import { doRequest, doRequestAndSaveToFile, downloadImage } from '../../helpers/requests' +import { doRequest, downloadImage } from '../../helpers/requests' import { getUrlFromWebfinger } from '../../helpers/webfinger' -import { AVATARS_SIZE, CONFIG, IMAGE_MIMETYPE_EXT, PREVIEWS_SIZE, sequelizeTypescript } from '../../initializers' +import { AVATARS_SIZE, CONFIG, IMAGE_MIMETYPE_EXT, sequelizeTypescript } from '../../initializers' import { AccountModel } from '../../models/account/account' import { ActorModel } from '../../models/activitypub/actor' import { AvatarModel } from '../../models/avatar/avatar' @@ -43,7 +43,7 @@ async function getOrCreateActorAndServerAndModel ( recurseIfNeeded = true, updateCollections = false ) { - const actorUrl = getActorUrl(activityActor) + const actorUrl = getAPUrl(activityActor) let created = false let actor = await fetchActorByUrl(actorUrl, fetchType) diff --git a/server/lib/activitypub/process/process.ts b/server/lib/activitypub/process/process.ts index b9b255ddf..bcc5cac7a 100644 --- a/server/lib/activitypub/process/process.ts +++ b/server/lib/activitypub/process/process.ts @@ -1,5 +1,5 @@ import { Activity, ActivityType } from '../../../../shared/models/activitypub' -import { checkUrlsSameHost, getActorUrl } from '../../../helpers/activitypub' +import { checkUrlsSameHost, getAPUrl } from '../../../helpers/activitypub' import { logger } from '../../../helpers/logger' import { ActorModel } from '../../../models/activitypub/actor' import { processAcceptActivity } from './process-accept' @@ -40,7 +40,7 @@ async function processActivities ( continue } - const actorUrl = getActorUrl(activity.actor) + const actorUrl = getAPUrl(activity.actor) // When we fetch remote data, we don't have signature if (options.signatureActor && actorUrl !== options.signatureActor.url) { diff --git a/server/lib/activitypub/share.ts b/server/lib/activitypub/share.ts index d2649e2d5..5dcba778c 100644 --- a/server/lib/activitypub/share.ts +++ b/server/lib/activitypub/share.ts @@ -11,7 +11,7 @@ import { doRequest } from '../../helpers/requests' import { getOrCreateActorAndServerAndModel } from './actor' import { logger } from '../../helpers/logger' import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers' -import { checkUrlsSameHost, getActorUrl } from '../../helpers/activitypub' +import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub' async function shareVideoByServerAndChannel (video: VideoModel, t: Transaction) { if (video.privacy === VideoPrivacy.PRIVATE) return undefined @@ -41,7 +41,7 @@ async function addVideoShares (shareUrls: string[], instance: VideoModel) { }) if (!body || !body.actor) throw new Error('Body or body actor is invalid') - const actorUrl = getActorUrl(body.actor) + const actorUrl = getAPUrl(body.actor) if (checkUrlsSameHost(shareUrl, actorUrl) !== true) { throw new Error(`Actor url ${actorUrl} has not the same host than the share url ${shareUrl}`) } diff --git a/server/lib/activitypub/video-rates.ts b/server/lib/activitypub/video-rates.ts index 1854b44c4..2cce67f0c 100644 --- a/server/lib/activitypub/video-rates.ts +++ b/server/lib/activitypub/video-rates.ts @@ -9,7 +9,7 @@ import { AccountVideoRateModel } from '../../models/account/account-video-rate' import { logger } from '../../helpers/logger' import { CRAWL_REQUEST_CONCURRENCY } from '../../initializers' import { doRequest } from '../../helpers/requests' -import { checkUrlsSameHost, getActorUrl } from '../../helpers/activitypub' +import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub' import { ActorModel } from '../../models/activitypub/actor' import { getVideoDislikeActivityPubUrl, getVideoLikeActivityPubUrl } from './url' @@ -26,7 +26,7 @@ async function createRates (ratesUrl: string[], video: VideoModel, rate: VideoRa }) if (!body || !body.actor) throw new Error('Body or body actor is invalid') - const actorUrl = getActorUrl(body.actor) + const actorUrl = getAPUrl(body.actor) if (checkUrlsSameHost(actorUrl, rateUrl) !== true) { throw new Error(`Rate url ${rateUrl} has not the same host than actor url ${actorUrl}`) } diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts index 6ff9baefe..4cecf9345 100644 --- a/server/lib/activitypub/videos.ts +++ b/server/lib/activitypub/videos.ts @@ -29,7 +29,7 @@ import { createRates } from './video-rates' import { addVideoShares, shareVideoByServerAndChannel } from './share' import { AccountModel } from '../../models/account/account' import { fetchVideoByUrl, VideoFetchByUrlType } from '../../helpers/video' -import { checkUrlsSameHost } from '../../helpers/activitypub' +import { checkUrlsSameHost, getAPUrl } from '../../helpers/activitypub' async function federateVideoIfNeeded (video: VideoModel, isNewVideo: boolean, transaction?: sequelize.Transaction) { // If the video is not private and published, we federate it @@ -167,7 +167,7 @@ async function getOrCreateVideoAndAccountAndChannel (options: { const refreshViews = options.refreshViews || false // Get video url - const videoUrl = typeof options.videoObject === 'string' ? options.videoObject : options.videoObject.id + const videoUrl = getAPUrl(options.videoObject) let videoFromDatabase = await fetchVideoByUrl(videoUrl, fetchType) if (videoFromDatabase) { -- cgit v1.2.3