1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-30 07:48:57 +09:00

Validate param

This commit is contained in:
syuilo 2018-10-20 09:31:52 +09:00
parent 70897c0e9a
commit 13f381710c
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -15,6 +15,8 @@ export default class extends Channel {
const q: Array<string[]> = params.q; const q: Array<string[]> = params.q;
if (q == null) return;
// Subscribe stream // Subscribe stream
this.subscriber.on('hashtag', async note => { this.subscriber.on('hashtag', async note => {
const matched = q.some(tags => tags.every(tag => note.tags.map((t: string) => t.toLowerCase()).includes(tag.toLowerCase()))); const matched = q.some(tags => tags.every(tag => note.tags.map((t: string) => t.toLowerCase()).includes(tag.toLowerCase())));