* 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:
syuilo 2021-03-24 11:05:37 +09:00 committed by GitHub
parent 62cc14c93b
commit ce340aba7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 252 additions and 201 deletions

View file

@ -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));
}