1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Refractor activity pub lib/helpers

This commit is contained in:
Chocobozzz 2017-11-20 09:43:39 +01:00
parent eb8b27c93e
commit 5414139835
No known key found for this signature in database
GPG key ID: 583A612D890159BE
47 changed files with 844 additions and 498 deletions

View file

@ -1,11 +1,11 @@
import * as Sequelize from 'sequelize'
import { getActivityPubUrl } from '../helpers/activitypub'
import { createPrivateAndPublicKeys } from '../helpers/peertube-crypto'
import { database as db } from '../initializers'
import { CONFIG } from '../initializers/constants'
import { UserInstance } from '../models'
import { createVideoChannel } from './video-channel'
import { logger } from '../helpers/logger'
import { getAccountActivityPubUrl } from '../helpers/activitypub'
async function createUserAccountAndChannel (user: UserInstance, validateUser = true) {
const { account, videoChannel } = await db.sequelize.transaction(async t => {
@ -36,7 +36,7 @@ async function createUserAccountAndChannel (user: UserInstance, validateUser = t
}
async function createLocalAccountWithoutKeys (name: string, userId: number, applicationId: number, t: Sequelize.Transaction) {
const url = getActivityPubUrl('account', name)
const url = getAccountActivityPubUrl(name)
const accountInstance = db.Account.build({
name,