1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Send server announce when users upload a video

This commit is contained in:
Chocobozzz 2017-11-16 11:08:25 +01:00
parent d846501818
commit efc32059d9
No known key found for this signature in database
GPG key ID: 583A612D890159BE
22 changed files with 161 additions and 80 deletions

View file

@ -2,7 +2,7 @@ import * as express from 'express'
import { UserRight } from '../../../../shared/models/users/user-right.enum'
import { getFormattedObjects } from '../../../helpers'
import { logger } from '../../../helpers/logger'
import { getApplicationAccount } from '../../../helpers/utils'
import { getServerAccount } from '../../../helpers/utils'
import { getAccountFromWebfinger } from '../../../helpers/webfinger'
import { SERVER_ACCOUNT_NAME } from '../../../initializers/constants'
import { database as db } from '../../../initializers/database'
@ -50,14 +50,14 @@ export {
// ---------------------------------------------------------------------------
async function listFollowing (req: express.Request, res: express.Response, next: express.NextFunction) {
const applicationAccount = await getApplicationAccount()
const applicationAccount = await getServerAccount()
const resultList = await db.AccountFollow.listFollowingForApi(applicationAccount.id, req.query.start, req.query.count, req.query.sort)
return res.json(getFormattedObjects(resultList.data, resultList.total))
}
async function listFollowers (req: express.Request, res: express.Response, next: express.NextFunction) {
const applicationAccount = await getApplicationAccount()
const applicationAccount = await getServerAccount()
const resultList = await db.AccountFollow.listFollowersForApi(applicationAccount.id, req.query.start, req.query.count, req.query.sort)
return res.json(getFormattedObjects(resultList.data, resultList.total))
@ -65,7 +65,7 @@ async function listFollowers (req: express.Request, res: express.Response, next:
async function follow (req: express.Request, res: express.Response, next: express.NextFunction) {
const hosts = req.body.hosts as string[]
const fromAccount = await getApplicationAccount()
const fromAccount = await getServerAccount()
const tasks: Promise<any>[] = []
const accountName = SERVER_ACCOUNT_NAME