From 1e7eb25f6cb6893db8f99ff40ef0509aa2a16614 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 15 Jan 2019 14:52:33 +0100 Subject: Correctly send Flag/Dislike/View activities --- server/controllers/activitypub/client.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'server/controllers/activitypub') diff --git a/server/controllers/activitypub/client.ts b/server/controllers/activitypub/client.ts index 1a4e28dc8..7e87f6f3b 100644 --- a/server/controllers/activitypub/client.ts +++ b/server/controllers/activitypub/client.ts @@ -3,22 +3,18 @@ import * as express from 'express' import { VideoPrivacy, VideoRateType } from '../../../shared/models/videos' import { activityPubCollectionPagination, activityPubContextify } from '../../helpers/activitypub' import { CONFIG, ROUTE_CACHE_LIFETIME } from '../../initializers' -import { buildAnnounceWithVideoAudience, buildDislikeActivity, buildLikeActivity } from '../../lib/activitypub/send' +import { buildAnnounceWithVideoAudience, buildLikeActivity } from '../../lib/activitypub/send' import { audiencify, getAudience } from '../../lib/activitypub/audience' import { buildCreateActivity } from '../../lib/activitypub/send/send-create' import { asyncMiddleware, - videosShareValidator, executeIfActivityPub, localAccountValidator, localVideoChannelValidator, - videosCustomGetValidator + videosCustomGetValidator, + videosShareValidator } from '../../middlewares' -import { - getAccountVideoRateValidator, - videoCommentGetValidator, - videosGetValidator -} from '../../middlewares/validators' +import { getAccountVideoRateValidator, videoCommentGetValidator, videosGetValidator } from '../../middlewares/validators' import { AccountModel } from '../../models/account/account' import { ActorModel } from '../../models/activitypub/actor' import { ActorFollowModel } from '../../models/activitypub/actor-follow' @@ -40,6 +36,7 @@ import { VideoCaptionModel } from '../../models/video/video-caption' import { videoRedundancyGetValidator } from '../../middlewares/validators/redundancy' import { getServerActor } from '../../helpers/utils' import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy' +import { buildDislikeActivity } from '../../lib/activitypub/send/send-dislike' const activityPubClientRouter = express.Router() @@ -156,7 +153,7 @@ function getAccountVideoRate (rateType: VideoRateType) { const url = getRateUrl(rateType, byActor, accountVideoRate.Video) const APObject = rateType === 'like' ? buildLikeActivity(url, byActor, accountVideoRate.Video) - : buildCreateActivity(url, byActor, buildDislikeActivity(url, byActor, accountVideoRate.Video)) + : buildDislikeActivity(url, byActor, accountVideoRate.Video) return activityPubResponse(activityPubContextify(APObject), res) } -- cgit v1.2.3