strictNullChecks (#4666)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip
This commit is contained in:
syuilo 2019-04-13 01:43:22 +09:00 committed by GitHub
parent 4ee40c3345
commit 987168b863
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
214 changed files with 939 additions and 785 deletions

View file

@ -6,9 +6,8 @@ import { User } from '../../models/entities/user';
import { renderPerson } from '../../remote/activitypub/renderer/person';
export async function publishToFollowers(userId: User['id']) {
const user = await Users.findOne({
id: userId
});
const user = await Users.findOne(userId);
if (user == null) throw 'user not found';
const followers = await Followings.find({
followeeId: user.id
@ -19,7 +18,7 @@ export async function publishToFollowers(userId: User['id']) {
// フォロワーがリモートユーザーかつ投稿者がローカルユーザーならUpdateを配信
if (Users.isLocalUser(user)) {
for (const following of followers) {
if (following.followerHost !== null) {
if (Followings.isRemoteFollower(following)) {
const inbox = following.followerSharedInbox || following.followerInbox;
if (!queue.includes(inbox)) queue.push(inbox);
}