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
214 changed files with 939 additions and 785 deletions

View File

@@ -77,9 +77,8 @@ export async function removePinned(user: User, noteId: Note['id']) {
}
export async function deliverPinnedChange(userId: User['id'], noteId: Note['id'], isAddition: boolean) {
const user = await Users.findOne({
id: userId
});
const user = await Users.findOne(userId);
if (user == null) throw 'user not found';
if (!Users.isLocalUser(user)) return;
@@ -108,14 +107,8 @@ async function CreateRemoteInboxes(user: ILocalUser): Promise<string[]> {
const queue: string[] = [];
for (const following of followers) {
const follower = {
host: following.followerHost,
inbox: following.followerInbox,
sharedInbox: following.followerSharedInbox,
};
if (follower.host !== null) {
const inbox = follower.sharedInbox || follower.inbox;
if (Followings.isRemoteFollower(following)) {
const inbox = following.followerSharedInbox || following.followerInbox;
if (!queue.includes(inbox)) queue.push(inbox);
}
}