aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/activitypub/actor-follow.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/server/models/activitypub/actor-follow.ts b/server/models/activitypub/actor-follow.ts
index 435d22db5..ced481547 100644
--- a/server/models/activitypub/actor-follow.ts
+++ b/server/models/activitypub/actor-follow.ts
@@ -2,9 +2,8 @@ import * as Bluebird from 'bluebird'
2import { values } from 'lodash' 2import { values } from 'lodash'
3import * as Sequelize from 'sequelize' 3import * as Sequelize from 'sequelize'
4import { 4import {
5 AfterCreate, AfterDestroy, AfterUpdate, 5 AfterCreate, AfterDestroy, AfterUpdate, AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, IsInt, Max, Model,
6 AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, IsInt, Max, Model, Table, 6 Table, UpdatedAt
7 UpdatedAt
8} from 'sequelize-typescript' 7} from 'sequelize-typescript'
9import { FollowState } from '../../../shared/models/actors' 8import { FollowState } from '../../../shared/models/actors'
10import { AccountFollow } from '../../../shared/models/actors/follow.model' 9import { AccountFollow } from '../../../shared/models/actors/follow.model'
@@ -83,7 +82,7 @@ export class ActorFollowModel extends Model<ActorFollowModel> {
83 @AfterCreate 82 @AfterCreate
84 @AfterUpdate 83 @AfterUpdate
85 static incrementFollowerAndFollowingCount (instance: ActorFollowModel) { 84 static incrementFollowerAndFollowingCount (instance: ActorFollowModel) {
86 if (instance.state !== 'accepted') return 85 if (instance.state !== 'accepted') return undefined
87 86
88 return Promise.all([ 87 return Promise.all([
89 ActorModel.incrementFollows(instance.actorId, 'followingCount', 1), 88 ActorModel.incrementFollows(instance.actorId, 'followingCount', 1),