Clean up
This commit is contained in:
@@ -5,12 +5,10 @@ import renderFollow from '../../../remote/activitypub/renderer/follow';
|
||||
import renderAccept from '../../../remote/activitypub/renderer/accept';
|
||||
import { deliver } from '../../../queue';
|
||||
import Following from '../../../models/following';
|
||||
import FollowingLog from '../../../models/following-log';
|
||||
import FollowedLog from '../../../models/followed-log';
|
||||
import { publishMainStream } from '../../../stream';
|
||||
|
||||
export default async function(followee: IUser, follower: IUser) {
|
||||
const following = await Following.insert({
|
||||
await Following.insert({
|
||||
createdAt: new Date(),
|
||||
followerId: follower._id,
|
||||
followeeId: followee._id,
|
||||
@@ -49,12 +47,6 @@ export default async function(followee: IUser, follower: IUser) {
|
||||
followingCount: 1
|
||||
}
|
||||
});
|
||||
|
||||
FollowingLog.insert({
|
||||
createdAt: following.createdAt,
|
||||
userId: follower._id,
|
||||
count: follower.followingCount + 1
|
||||
});
|
||||
//#endregion
|
||||
|
||||
//#region Increment followers count
|
||||
@@ -63,12 +55,6 @@ export default async function(followee: IUser, follower: IUser) {
|
||||
followersCount: 1
|
||||
}
|
||||
});
|
||||
|
||||
FollowedLog.insert({
|
||||
createdAt: following.createdAt,
|
||||
userId: followee._id,
|
||||
count: followee.followersCount + 1
|
||||
});
|
||||
//#endregion
|
||||
|
||||
await User.update({ _id: followee._id }, {
|
||||
|
||||
Reference in New Issue
Block a user