refactor: Expand schema (#7772)

* packedNotificationSchemaを更新

* read:gallery, write:gallery, read:gallery-likes, write:gallery-likesに翻訳を追加

* fix

* add header, choice, invitation

* test

* fix

* yatta

* remove no longer needed "as PackedUser/PackedNote"

* clean up

* add simple-schema

* fix lint

* define items in full Schema

* revert https://github.com/misskey-dev/misskey/pull/7772#discussion_r706627736

* user packとnote packの型不整合を修正
This commit is contained in:
tamaina 2021-09-12 01:12:23 +09:00 committed by GitHub
parent f59f424795
commit 53f3b779bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 148 additions and 129 deletions

View file

@ -4,7 +4,6 @@ import Channel from '../channel';
import { fetchMeta } from '@/misc/fetch-meta';
import { Notes } from '@/models/index';
import { PackedNote } from '@/models/repositories/note';
import { PackedUser } from '@/models/repositories/user';
import { checkWordMute } from '@/misc/check-word-mute';
import { isBlockerUserRelated } from '@/misc/is-blocker-user-related';
@ -26,7 +25,7 @@ export default class extends Channel {
@autobind
private async onNote(note: PackedNote) {
if ((note.user as PackedUser).host !== null) return;
if (note.user.host !== null) return;
if (note.visibility !== 'public') return;
if (note.channelId != null && !this.followingChannels.has(note.channelId)) return;
@ -45,7 +44,7 @@ export default class extends Channel {
// 関係ない返信は除外
if (note.reply) {
const reply = note.reply as PackedNote;
const reply = note.reply;
// 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合
if (reply.userId !== this.user!.id && note.userId !== this.user!.id && reply.userId !== note.userId) return;
}