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

@@ -12,7 +12,7 @@ export default class extends Channel {
@autobind
public async init(params: any) {
const meta = await fetchMeta();
if (meta.disableLocalTimeline && !this.user.isAdmin && !this.user.isModerator) return;
if (meta.disableLocalTimeline && !this.user!.isAdmin && !this.user!.isModerator) return;
// Subscribe events
this.subscriber.on('notesStream', this.onNote);
@@ -22,13 +22,13 @@ export default class extends Channel {
private async onNote(note: any) {
// 自分自身の投稿 または その投稿のユーザーをフォローしている または ローカルの投稿 の場合だけ
if (!(
this.user.id === note.userId ||
this.user!.id === note.userId ||
this.following.includes(note.userId) ||
note.user.host == null
)) return;
if (['followers', 'specified'].includes(note.visibility)) {
note = await Notes.pack(note.id, this.user, {
note = await Notes.pack(note.id, this.user!, {
detail: true
});
@@ -38,13 +38,13 @@ export default class extends Channel {
} else {
// リプライなら再pack
if (note.replyId != null) {
note.reply = await Notes.pack(note.replyId, this.user, {
note.reply = await Notes.pack(note.replyId, this.user!, {
detail: true
});
}
// Renoteなら再pack
if (note.renoteId != null) {
note.renote = await Notes.pack(note.renoteId, this.user, {
note.renote = await Notes.pack(note.renoteId, this.user!, {
detail: true
});
}