1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-25 10:54:02 +02:00
This commit is contained in:
syuilo
2018-10-21 14:15:02 +09:00
parent f13faf2243
commit 1bf8cbeb29
8 changed files with 2 additions and 256 deletions

View File

@@ -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