Don't follow ourselves
This commit is contained in:
parent
ab998f7b6d
commit
1ee48d1903
1 changed files with 4 additions and 0 deletions
|
@ -106,6 +106,10 @@ async function followRetry (req: express.Request, res: express.Response, next: e
|
|||
}
|
||||
|
||||
function follow (fromActor: ActorModel, targetActor: ActorModel) {
|
||||
if (fromActor.id === targetActor.id) {
|
||||
throw new Error('Follower is the same than target actor.')
|
||||
}
|
||||
|
||||
return sequelizeTypescript.transaction(async t => {
|
||||
const [ actorFollow ] = await ActorFollowModel.findOrCreate({
|
||||
where: {
|
||||
|
|
Loading…
Reference in a new issue