Prepare Dislike/Flag/View fixes

For now we Create these activities, but we should just send them
directly.

This fix handles correctly direct Dislikes/Flags/Views, we'll implement
the sending correctly these activities in the next peertube version
This commit is contained in:
Chocobozzz 2019-01-15 11:14:12 +01:00
parent 44b9c0ba31
commit 848f499def
No known key found for this signature in database
GPG key ID: 583A612D890159BE
30 changed files with 330 additions and 755 deletions

View file

@ -4,7 +4,7 @@ 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, getAPUrl } from '../../helpers/activitypub'
import { checkUrlsSameHost, getAPId } 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'
@ -42,7 +42,7 @@ async function getOrCreateActorAndServerAndModel (
recurseIfNeeded = true,
updateCollections = false
) {
const actorUrl = getAPUrl(activityActor)
const actorUrl = getAPId(activityActor)
let created = false
let actor = await fetchActorByUrl(actorUrl, fetchType)