mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-25 05:04:08 +02:00
Refactor (#7394)
* wip * wip * wip * wip * wip * Update define.ts * Update update.ts * Update user.ts * wip * wip * Update request.ts * URL * wip * wip * wip * wip * Update invite.ts * Update create.ts
This commit is contained in:
@@ -8,7 +8,7 @@ import { User, ILocalUser } from '../../../models/entities/user';
|
||||
import { FollowRequests, Users } from '../../../models';
|
||||
import { IdentifiableError } from '@/misc/identifiable-error';
|
||||
|
||||
export default async function(followee: User, follower: User) {
|
||||
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
|
||||
@@ -20,12 +20,12 @@ export default async function(followee: User, follower: User) {
|
||||
|
||||
await insertFollowingDoc(followee, follower);
|
||||
|
||||
if (Users.isRemoteUser(follower)) {
|
||||
const content = renderActivity(renderAccept(renderFollow(follower, followee, request.requestId!), followee as ILocalUser));
|
||||
deliver(followee as ILocalUser, content, follower.inbox);
|
||||
if (Users.isRemoteUser(follower) && Users.isLocalUser(followee)) {
|
||||
const content = renderActivity(renderAccept(renderFollow(follower, followee, request.requestId!), followee));
|
||||
deliver(followee, content, follower.inbox);
|
||||
}
|
||||
|
||||
Users.pack(followee, followee, {
|
||||
Users.pack(followee.id, followee, {
|
||||
detail: true
|
||||
}).then(packed => publishMainStream(followee.id, 'meUpdated', packed));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user