1
0
This commit is contained in:
syuilo
2021-12-09 23:58:30 +09:00
parent 0abe2dfee0
commit c69b72e199
573 changed files with 3318 additions and 3318 deletions
@@ -8,7 +8,7 @@ import { FollowRequests, Users } from '@/models/index';
*/
export default async function(user: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox']; sharedInbox: User['sharedInbox']; }) {
const requests = await FollowRequests.find({
followeeId: user.id
followeeId: user.id,
});
for (const request of requests) {
@@ -11,7 +11,7 @@ import { IdentifiableError } from '@/misc/identifiable-error';
export default async function(followee: { id: User['id']; host: User['host']; uri: User['host']; inbox: User['inbox']; sharedInbox: User['sharedInbox']; }, follower: User) {
const request = await FollowRequests.findOne({
followeeId: followee.id,
followerId: follower.id
followerId: follower.id,
});
if (request == null) {
@@ -26,6 +26,6 @@ export default async function(followee: { id: User['id']; host: User['host']; ur
}
Users.pack(followee.id, followee, {
detail: true
detail: true,
}).then(packed => publishMainStream(followee.id, 'meUpdated', packed));
}
@@ -18,7 +18,7 @@ export default async function(followee: { id: User['id']; host: User['host']; ur
const request = await FollowRequests.findOne({
followeeId: followee.id,
followerId: follower.id
followerId: follower.id,
});
if (request == null) {
@@ -27,10 +27,10 @@ export default async function(followee: { id: User['id']; host: User['host']; ur
await FollowRequests.delete({
followeeId: followee.id,
followerId: follower.id
followerId: follower.id,
});
Users.pack(followee.id, followee, {
detail: true
detail: true,
}).then(packed => publishMainStream(followee.id, 'meUpdated', packed));
}
@@ -19,7 +19,7 @@ export default async function(follower: { id: User['id']; host: User['host']; ur
Blockings.findOne({
blockerId: followee.id,
blockeeId: follower.id,
})
}),
]);
if (blocking != null) throw new Error('blocking');
@@ -38,7 +38,7 @@ export default async function(follower: { id: User['id']; host: User['host']; ur
followerSharedInbox: Users.isRemoteUser(follower) ? follower.sharedInbox : undefined,
followeeHost: followee.host,
followeeInbox: Users.isRemoteUser(followee) ? followee.inbox : undefined,
followeeSharedInbox: Users.isRemoteUser(followee) ? followee.sharedInbox : undefined
followeeSharedInbox: Users.isRemoteUser(followee) ? followee.sharedInbox : undefined,
});
// Publish receiveRequest event
@@ -46,13 +46,13 @@ export default async function(follower: { id: User['id']; host: User['host']; ur
Users.pack(follower.id, followee).then(packed => publishMainStream(followee.id, 'receiveFollowRequest', packed));
Users.pack(followee.id, followee, {
detail: true
detail: true,
}).then(packed => publishMainStream(followee.id, 'meUpdated', packed));
// 通知を作成
createNotification(followee.id, 'receiveFollowRequest', {
notifierId: follower.id,
followRequestId: followRequest.id
followRequestId: followRequest.id,
});
}