mirror of
https://git.boykissers.com/pawkey/pawkey-sk.git
synced 2025-12-20 12:14:18 +00:00
allow checkWordMute to accept raw strings
This commit is contained in:
@@ -4,12 +4,12 @@
|
|||||||
*/
|
*/
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
|
|
||||||
export function checkWordMute(note: Misskey.entities.Note, me: Misskey.entities.UserLite | null | undefined, mutedWords: Array<string | string[]>): Array<string | string[]> | false {
|
export function checkWordMute(note: string | Misskey.entities.Note, me: Misskey.entities.UserLite | null | undefined, mutedWords: Array<string | string[]>): Array<string | string[]> | false {
|
||||||
// 自分自身
|
// 自分自身
|
||||||
if (me && (note.userId === me.id)) return false;
|
if (me && typeof(note) === 'object' && (note.userId === me.id)) return false;
|
||||||
|
|
||||||
if (mutedWords.length > 0) {
|
if (mutedWords.length > 0) {
|
||||||
const text = getNoteText(note);
|
const text = typeof(note) === 'object' ? getNoteText(note) : note;
|
||||||
|
|
||||||
if (text === '') return false;
|
if (text === '') return false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user