diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/activitypub/actor-follow.ts | 7 |
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' | |||
2 | import { values } from 'lodash' | 2 | import { values } from 'lodash' |
3 | import * as Sequelize from 'sequelize' | 3 | import * as Sequelize from 'sequelize' |
4 | import { | 4 | import { |
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' |
9 | import { FollowState } from '../../../shared/models/actors' | 8 | import { FollowState } from '../../../shared/models/actors' |
10 | import { AccountFollow } from '../../../shared/models/actors/follow.model' | 9 | import { 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), |