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:
parent
276d03ed1a
commit
e8cb44090e
13 changed files with 314 additions and 32 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue