Implement following stats
This commit is contained in:
parent
a62013f54d
commit
13f82856f9
4 changed files with 139 additions and 9 deletions
|
|
@ -5,6 +5,7 @@ import pack from '../../remote/activitypub/renderer';
|
|||
import renderFollow from '../../remote/activitypub/renderer/follow';
|
||||
import renderUndo from '../../remote/activitypub/renderer/undo';
|
||||
import { deliver } from '../../queue';
|
||||
import { followingStats } from '../stats';
|
||||
|
||||
export default async function(follower: IUser, followee: IUser) {
|
||||
const following = await Following.findOne({
|
||||
|
|
@ -37,6 +38,8 @@ export default async function(follower: IUser, followee: IUser) {
|
|||
});
|
||||
//#endregion
|
||||
|
||||
followingStats.update(follower, followee, false);
|
||||
|
||||
// Publish unfollow event
|
||||
if (isLocalUser(follower)) {
|
||||
packUser(followee, follower).then(packed => publishMainStream(follower._id, 'unfollow', packed));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue