v12 (#5712)
Co-authored-by: MeiMei <30769358+mei23@users.noreply.github.com> Co-authored-by: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com>
This commit is contained in:
parent
a5955c1123
commit
f6154dc0af
871 changed files with 26140 additions and 71950 deletions
|
@ -45,11 +45,21 @@ export async function insertFollowingDoc(followee: User, follower: User) {
|
|||
}
|
||||
});
|
||||
|
||||
await FollowRequests.delete({
|
||||
const req = await FollowRequests.findOne({
|
||||
followeeId: followee.id,
|
||||
followerId: follower.id
|
||||
});
|
||||
|
||||
if (req) {
|
||||
await FollowRequests.delete({
|
||||
followeeId: followee.id,
|
||||
followerId: follower.id
|
||||
});
|
||||
|
||||
// 通知を作成
|
||||
createNotification(follower.id, followee.id, 'followRequestAccepted');
|
||||
}
|
||||
|
||||
if (alreadyFollowed) return;
|
||||
|
||||
//#region Increment counts
|
||||
|
|
|
@ -25,7 +25,7 @@ export default async function(follower: User, followee: User, requestId?: string
|
|||
if (blocking != null) throw new Error('blocking');
|
||||
if (blocked != null) throw new Error('blocked');
|
||||
|
||||
await FollowRequests.save({
|
||||
const followRequest = await FollowRequests.save({
|
||||
id: genId(),
|
||||
createdAt: new Date(),
|
||||
followerId: follower.id,
|
||||
|
@ -50,7 +50,9 @@ export default async function(follower: User, followee: User, requestId?: string
|
|||
}).then(packed => publishMainStream(followee.id, 'meUpdated', packed));
|
||||
|
||||
// 通知を作成
|
||||
createNotification(followee.id, follower.id, 'receiveFollowRequest');
|
||||
createNotification(followee.id, follower.id, 'receiveFollowRequest', {
|
||||
followRequestId: followRequest.id
|
||||
});
|
||||
}
|
||||
|
||||
if (Users.isLocalUser(follower) && Users.isRemoteUser(followee)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue