refactor: PackedHoge型をPacked<'Hoge'>型に書き換える (#7792)
* 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の型不整合を修正 * add prelude/types.ts * emoji * signin * game * matching * fix * add emoji schema * add reversiGame * add reversiMatching * remove signin schema (use Signin entity) * add Packed type * note-reaction * user * user-group * user-list * note * app, messaging-message * notification * drive-file * drive-folder * following * muting * blocking * hashtag * page * app (with modifying schema) * import user? * channel * antenna * clip * gallery-post * emoji * Packed * reversi-matching * add changelog * add changelog * revert fix
This commit is contained in:
@@ -3,8 +3,8 @@ import Channel from '../channel';
|
||||
import { Notes, Users } from '@/models/index';
|
||||
import { isMutedUserRelated } from '@/misc/is-muted-user-related';
|
||||
import { isBlockerUserRelated } from '@/misc/is-blocker-user-related';
|
||||
import { PackedNote } from '@/models/repositories/note';
|
||||
import { User } from '@/models/entities/user';
|
||||
import { Packed } from '@/misc/schema';
|
||||
|
||||
export default class extends Channel {
|
||||
public readonly chName = 'channel';
|
||||
@@ -25,7 +25,7 @@ export default class extends Channel {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private async onNote(note: PackedNote) {
|
||||
private async onNote(note: Packed<'Note'>) {
|
||||
if (note.channelId !== this.channelId) return;
|
||||
|
||||
// リプライなら再pack
|
||||
|
@@ -3,9 +3,9 @@ import { isMutedUserRelated } from '@/misc/is-muted-user-related';
|
||||
import Channel from '../channel';
|
||||
import { fetchMeta } from '@/misc/fetch-meta';
|
||||
import { Notes } from '@/models/index';
|
||||
import { PackedNote } from '@/models/repositories/note';
|
||||
import { checkWordMute } from '@/misc/check-word-mute';
|
||||
import { isBlockerUserRelated } from '@/misc/is-blocker-user-related';
|
||||
import { Packed } from '@/misc/schema';
|
||||
|
||||
export default class extends Channel {
|
||||
public readonly chName = 'globalTimeline';
|
||||
@@ -24,7 +24,7 @@ export default class extends Channel {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private async onNote(note: PackedNote) {
|
||||
private async onNote(note: Packed<'Note'>) {
|
||||
if (note.visibility !== 'public') return;
|
||||
if (note.channelId != null) return;
|
||||
|
||||
|
@@ -2,9 +2,9 @@ import autobind from 'autobind-decorator';
|
||||
import { isMutedUserRelated } from '@/misc/is-muted-user-related';
|
||||
import Channel from '../channel';
|
||||
import { Notes } from '@/models/index';
|
||||
import { PackedNote } from '@/models/repositories/note';
|
||||
import { normalizeForSearch } from '@/misc/normalize-for-search';
|
||||
import { isBlockerUserRelated } from '@/misc/is-blocker-user-related';
|
||||
import { Packed } from '@/misc/schema';
|
||||
|
||||
export default class extends Channel {
|
||||
public readonly chName = 'hashtag';
|
||||
@@ -23,7 +23,7 @@ export default class extends Channel {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private async onNote(note: PackedNote) {
|
||||
private async onNote(note: Packed<'Note'>) {
|
||||
const noteTags = note.tags ? note.tags.map((t: string) => t.toLowerCase()) : [];
|
||||
const matched = this.q.some(tags => tags.every(tag => noteTags.includes(normalizeForSearch(tag))));
|
||||
if (!matched) return;
|
||||
|
@@ -2,9 +2,9 @@ import autobind from 'autobind-decorator';
|
||||
import { isMutedUserRelated } from '@/misc/is-muted-user-related';
|
||||
import Channel from '../channel';
|
||||
import { Notes } from '@/models/index';
|
||||
import { PackedNote } from '@/models/repositories/note';
|
||||
import { checkWordMute } from '@/misc/check-word-mute';
|
||||
import { isBlockerUserRelated } from '@/misc/is-blocker-user-related';
|
||||
import { Packed } from '@/misc/schema';
|
||||
|
||||
export default class extends Channel {
|
||||
public readonly chName = 'homeTimeline';
|
||||
@@ -18,7 +18,7 @@ export default class extends Channel {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private async onNote(note: PackedNote) {
|
||||
private async onNote(note: Packed<'Note'>) {
|
||||
if (note.channelId) {
|
||||
if (!this.followingChannels.has(note.channelId)) return;
|
||||
} else {
|
||||
|
@@ -3,9 +3,9 @@ import { isMutedUserRelated } from '@/misc/is-muted-user-related';
|
||||
import Channel from '../channel';
|
||||
import { fetchMeta } from '@/misc/fetch-meta';
|
||||
import { Notes } from '@/models/index';
|
||||
import { PackedNote } from '@/models/repositories/note';
|
||||
import { checkWordMute } from '@/misc/check-word-mute';
|
||||
import { isBlockerUserRelated } from '@/misc/is-blocker-user-related';
|
||||
import { Packed } from '@/misc/schema';
|
||||
|
||||
export default class extends Channel {
|
||||
public readonly chName = 'hybridTimeline';
|
||||
@@ -22,7 +22,7 @@ export default class extends Channel {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private async onNote(note: PackedNote) {
|
||||
private async onNote(note: Packed<'Note'>) {
|
||||
// チャンネルの投稿ではなく、自分自身の投稿 または
|
||||
// チャンネルの投稿ではなく、その投稿のユーザーをフォローしている または
|
||||
// チャンネルの投稿ではなく、全体公開のローカルの投稿 または
|
||||
|
@@ -3,9 +3,9 @@ import { isMutedUserRelated } from '@/misc/is-muted-user-related';
|
||||
import Channel from '../channel';
|
||||
import { fetchMeta } from '@/misc/fetch-meta';
|
||||
import { Notes } from '@/models/index';
|
||||
import { PackedNote } from '@/models/repositories/note';
|
||||
import { checkWordMute } from '@/misc/check-word-mute';
|
||||
import { isBlockerUserRelated } from '@/misc/is-blocker-user-related';
|
||||
import { Packed } from '@/misc/schema';
|
||||
|
||||
export default class extends Channel {
|
||||
public readonly chName = 'localTimeline';
|
||||
@@ -24,7 +24,7 @@ export default class extends Channel {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private async onNote(note: PackedNote) {
|
||||
private async onNote(note: Packed<'Note'>) {
|
||||
if (note.user.host !== null) return;
|
||||
if (note.visibility !== 'public') return;
|
||||
if (note.channelId != null && !this.followingChannels.has(note.channelId)) return;
|
||||
|
@@ -3,8 +3,8 @@ import Channel from '../channel';
|
||||
import { Notes, UserListJoinings, UserLists } from '@/models/index';
|
||||
import { isMutedUserRelated } from '@/misc/is-muted-user-related';
|
||||
import { User } from '@/models/entities/user';
|
||||
import { PackedNote } from '@/models/repositories/note';
|
||||
import { isBlockerUserRelated } from '@/misc/is-blocker-user-related';
|
||||
import { Packed } from '@/misc/schema';
|
||||
|
||||
export default class extends Channel {
|
||||
public readonly chName = 'userList';
|
||||
@@ -47,7 +47,7 @@ export default class extends Channel {
|
||||
}
|
||||
|
||||
@autobind
|
||||
private async onNote(note: PackedNote) {
|
||||
private async onNote(note: Packed<'Note'>) {
|
||||
if (!this.listUsers.includes(note.userId)) return;
|
||||
|
||||
if (['followers', 'specified'].includes(note.visibility)) {
|
||||
|
Reference in New Issue
Block a user