mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-27 14:28:08 +09:00
[backend] Correctly handle tags on edit
This commit is contained in:
parent
6d715cfef5
commit
1e2045bf33
@ -23,6 +23,7 @@ import type { IPoll } from "@/models/entities/poll.js";
|
|||||||
import { deliverToRelays } from "../relay.js";
|
import { deliverToRelays } from "../relay.js";
|
||||||
import renderUpdate from "@/remote/activitypub/renderer/update.js";
|
import renderUpdate from "@/remote/activitypub/renderer/update.js";
|
||||||
import { extractMentionedUsers, index } from "@/services/note/create.js";
|
import { extractMentionedUsers, index } from "@/services/note/create.js";
|
||||||
|
import { normalizeForSearch } from "@/misc/normalize-for-search.js";
|
||||||
|
|
||||||
type Option = {
|
type Option = {
|
||||||
text?: string | null;
|
text?: string | null;
|
||||||
@ -49,7 +50,11 @@ export default async function (
|
|||||||
.parse(data.text || "")
|
.parse(data.text || "")
|
||||||
.concat(mfm.parse(data.cw || ""));
|
.concat(mfm.parse(data.cw || ""));
|
||||||
|
|
||||||
const tags: string[] = extractHashtags(tokens);
|
const tags: string[] = extractHashtags(tokens)
|
||||||
|
.filter((tag) => Array.from(tag || "").length <= 128)
|
||||||
|
.splice(0, 32)
|
||||||
|
.map(normalizeForSearch);
|
||||||
|
|
||||||
const emojis = extractCustomEmojisFromMfm(tokens);
|
const emojis = extractCustomEmojisFromMfm(tokens);
|
||||||
|
|
||||||
const mentionUsers = (await extractMentionedUsers(user, tokens));
|
const mentionUsers = (await extractMentionedUsers(user, tokens));
|
||||||
|
Loading…
Reference in New Issue
Block a user