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

Add links to comment mentions

This commit is contained in:
Chocobozzz 2018-02-21 16:44:18 +01:00
parent 276d03ed1a
commit e8cb44090e
No known key found for this signature in database
GPG key ID: 583A612D890159BE
13 changed files with 314 additions and 32 deletions

View file

@ -31,6 +31,16 @@ function isLocalAccountNameExist (name: string, res: Response) {
return isAccountExist(promise, res)
}
function isAccountNameWithHostExist (nameWithDomain: string, res: Response) {
const [ accountName, host ] = nameWithDomain.split('@')
let promise: Bluebird<AccountModel>
if (!host) promise = AccountModel.loadLocalByName(accountName)
else promise = AccountModel.loadLocalByNameAndHost(accountName, host)
return isAccountExist(promise, res)
}
async function isAccountExist (p: Bluebird<AccountModel>, res: Response) {
const account = await p
@ -53,5 +63,6 @@ export {
isAccountIdExist,
isLocalAccountNameExist,
isAccountDescriptionValid,
isAccountNameWithHostExist,
isAccountNameValid
}