forked from naskya/firefish
chore: nyaize -> nyaify
This commit is contained in:
parent
8a7fd6b593
commit
82869b4022
2 changed files with 6 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
export function nyaize(
|
export default function (
|
||||||
text: string,
|
text: string,
|
||||||
lang: string | undefined,
|
lang: string | undefined,
|
||||||
appendMiao: boolean,
|
appendMiao: boolean,
|
|
@ -12,7 +12,7 @@ import {
|
||||||
Channels,
|
Channels,
|
||||||
} from "../index.js";
|
} from "../index.js";
|
||||||
import type { Packed } from "@/misc/schema.js";
|
import type { Packed } from "@/misc/schema.js";
|
||||||
import { nyaize } from "@/misc/nyaize.js";
|
import nyaify from "@/misc/nyaify.js";
|
||||||
import { awaitAll } from "@/prelude/await-all.js";
|
import { awaitAll } from "@/prelude/await-all.js";
|
||||||
import { convertReactions, decodeReaction } from "@/misc/reaction-lib.js";
|
import { convertReactions, decodeReaction } from "@/misc/reaction-lib.js";
|
||||||
import type { NoteReaction } from "@/models/entities/note-reaction.js";
|
import type { NoteReaction } from "@/models/entities/note-reaction.js";
|
||||||
|
@ -277,10 +277,10 @@ export const NoteRepository = db.getRepository(Note).extend({
|
||||||
|
|
||||||
if (packed.user.isCat && packed.user.speakAsCat && packed.text != null) {
|
if (packed.user.isCat && packed.user.speakAsCat && packed.text != null) {
|
||||||
const tokens = packed.text ? mfm.parse(packed.text) : [];
|
const tokens = packed.text ? mfm.parse(packed.text) : [];
|
||||||
function nyaizeNode(node: mfm.MfmNode) {
|
function nyaifyNode(node: mfm.MfmNode) {
|
||||||
if (node.type === "quote") return;
|
if (node.type === "quote") return;
|
||||||
if (node.type === "text")
|
if (node.type === "text")
|
||||||
node.props.text = nyaize(
|
node.props.text = nyaify(
|
||||||
node.props.text,
|
node.props.text,
|
||||||
packed.lang,
|
packed.lang,
|
||||||
shouldAppendMiao,
|
shouldAppendMiao,
|
||||||
|
@ -288,12 +288,12 @@ export const NoteRepository = db.getRepository(Note).extend({
|
||||||
|
|
||||||
if (node.children) {
|
if (node.children) {
|
||||||
for (const child of node.children) {
|
for (const child of node.children) {
|
||||||
nyaizeNode(child);
|
nyaifyNode(child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const node of tokens) nyaizeNode(node);
|
for (const node of tokens) nyaifyNode(node);
|
||||||
|
|
||||||
packed.text = mfm.toString(tokens);
|
packed.text = mfm.toString(tokens);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue