フォローリクエストがなくてもフォロー承認が出来てしまうのを修正 (#7013)

* フォローリクエストがなくてもフォロー承認が出来てしまうのを修正

* プロキシアカウントがDB処理をせずにフォローを飛ばしているのを修正
This commit is contained in:
MeiMei 2020-12-26 15:31:28 +09:00 committed by GitHub
parent c6cfc3f908
commit c5bdee086d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 7 deletions

View file

@ -33,6 +33,11 @@ export const meta = {
code: 'NO_SUCH_USER',
id: '66ce1645-d66c-46bb-8b79-96739af885bd'
},
noFollowRequest: {
message: 'No follow request.',
code: 'NO_FOLLOW_REQUEST',
id: 'bcde4f8b-0913-4614-8881-614e522fb041'
},
}
};
@ -43,7 +48,10 @@ export default define(meta, async (ps, user) => {
throw e;
});
await acceptFollowRequest(user, follower);
await acceptFollowRequest(user, follower).catch(e => {
if (e.id === '8884c2dd-5795-4ac9-b27e-6a01d38190f9') throw new ApiError(meta.errors.noFollowRequest);
throw e;
});
return;
});