This commit is contained in:
syuilo
2021-02-07 10:43:34 +09:00
parent 823a0c86d3
commit 0a64d121d9
10 changed files with 27 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ import { isMutedUserRelated } from '../../../../misc/is-muted-user-related';
import Channel from '../channel';
import { Notes } from '../../../../models';
import { PackedNote } from '../../../../models/repositories/note';
import { normalizeForSearch } from '../../../../misc/normalize-for-search';
export default class extends Channel {
public readonly chName = 'hashtag';
@@ -23,7 +24,7 @@ export default class extends Channel {
@autobind
private async onNote(note: PackedNote) {
const noteTags = note.tags ? note.tags.map((t: string) => t.toLowerCase()) : [];
const matched = this.q.some(tags => tags.every(tag => noteTags.includes(tag.toLowerCase())));
const matched = this.q.some(tags => tags.every(tag => noteTags.includes(normalizeForSearch(tag))));
if (!matched) return;
// Renoteなら再pack