Implement following stats
This commit is contained in:
parent
a62013f54d
commit
13f82856f9
4 changed files with 139 additions and 9 deletions
|
|
@ -6,6 +6,7 @@ import renderAccept from '../../../remote/activitypub/renderer/accept';
|
|||
import { deliver } from '../../../queue';
|
||||
import Following from '../../../models/following';
|
||||
import { publishMainStream } from '../../../stream';
|
||||
import { followingStats } from '../../stats';
|
||||
|
||||
export default async function(followee: IUser, follower: IUser) {
|
||||
await Following.insert({
|
||||
|
|
@ -57,6 +58,8 @@ export default async function(followee: IUser, follower: IUser) {
|
|||
});
|
||||
//#endregion
|
||||
|
||||
followingStats.update(follower, followee, true);
|
||||
|
||||
await User.update({ _id: followee._id }, {
|
||||
$inc: {
|
||||
pendingReceivedFollowRequestsCount: -1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue