-function processFollow (actor: ActorModel, targetActorURL: string) {
- const options = {
- arguments: [ actor, targetActorURL ],
- errorMessage: 'Cannot follow with many retries.'
- }
-
- return retryTransactionWrapper(follow, options)
-}
-
-async function follow (actor: ActorModel, targetActorURL: string) {
- await sequelizeTypescript.transaction(async t => {
- const targetActor = await ActorModel.loadByUrl(targetActorURL, t)
+async function processFollow (byActor: MActorSignature, targetActorURL: string) {
+ const { actorFollow, created, isFollowingInstance, targetActor } = await sequelizeTypescript.transaction(async t => {
+ const targetActor = await ActorModel.loadByUrlAndPopulateAccountAndChannel(targetActorURL, t)