mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-25 10:54:02 +02:00
Clean up
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import User, { isLocalUser, isRemoteUser, pack as packUser, IUser } from '../../models/user';
|
||||
import Following from '../../models/following';
|
||||
import FollowingLog from '../../models/following-log';
|
||||
import FollowedLog from '../../models/followed-log';
|
||||
import { publishMainStream } from '../../stream';
|
||||
import notify from '../../notify';
|
||||
import pack from '../../remote/activitypub/renderer';
|
||||
@@ -20,7 +18,7 @@ export default async function(follower: IUser, followee: IUser, requestId?: stri
|
||||
return;
|
||||
}
|
||||
|
||||
const following = await Following.insert({
|
||||
await Following.insert({
|
||||
createdAt: new Date(),
|
||||
followerId: follower._id,
|
||||
followeeId: followee._id,
|
||||
@@ -44,12 +42,6 @@ export default async function(follower: IUser, followee: IUser, requestId?: stri
|
||||
followingCount: 1
|
||||
}
|
||||
});
|
||||
|
||||
FollowingLog.insert({
|
||||
createdAt: following.createdAt,
|
||||
userId: follower._id,
|
||||
count: follower.followingCount + 1
|
||||
});
|
||||
//#endregion
|
||||
|
||||
//#region Increment followers count
|
||||
@@ -58,11 +50,6 @@ export default async function(follower: IUser, followee: IUser, requestId?: stri
|
||||
followersCount: 1
|
||||
}
|
||||
});
|
||||
FollowedLog.insert({
|
||||
createdAt: following.createdAt,
|
||||
userId: followee._id,
|
||||
count: followee.followersCount + 1
|
||||
});
|
||||
//#endregion
|
||||
|
||||
// Publish follow event
|
||||
|
||||
Reference in New Issue
Block a user