Merge branch 'develop' into refactor/push-notification

This commit is contained in:
naskya 2024-05-02 22:43:30 +09:00
commit 8dd4e5ed64
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
9 changed files with 9 additions and 16 deletions

View file

@ -19,6 +19,13 @@ export function fromHtml(html: string, hashtagNames?: string[]): string {
return appendChildren(childNodes, background).join("").trim();
}
/**
* We only exclude text containing asterisks, since the other marks can almost be considered intentionally used.
*/
function escapeAmbiguousMfmMarks(text: string) {
return text.includes("*") ? `<plain>${text}</plain>` : text;
}
/**
* Get only the text, ignoring all formatting inside
* @param node
@ -62,7 +69,7 @@ export function fromHtml(html: string, hashtagNames?: string[]): string {
background = "",
): (string | string[])[] {
if (treeAdapter.isTextNode(node)) {
return [node.value];
return [escapeAmbiguousMfmMarks(node.value)];
}
// Skip comment or document type node

View file

@ -23,7 +23,6 @@ export class DriveFile {
@PrimaryColumn(id())
public id: string;
@Index()
@Column("timestamp without time zone", {
comment: "The created date of the DriveFile.",
})
@ -147,7 +146,6 @@ export class DriveFile {
})
public webpublicAccessKey: string | null;
@Index()
@Column("varchar", {
length: 512,
nullable: true,

View file

@ -19,7 +19,6 @@ export class Hashtag {
})
public mentionedUserIds: User["id"][];
@Index()
@Column("integer", {
default: 0,
})
@ -43,7 +42,6 @@ export class Hashtag {
})
public mentionedRemoteUserIds: User["id"][];
@Index()
@Column("integer", {
default: 0,
})
@ -55,7 +53,6 @@ export class Hashtag {
})
public attachedUserIds: User["id"][];
@Index()
@Column("integer", {
default: 0,
})

View file

@ -17,7 +17,6 @@ export class NoteReaction {
@PrimaryColumn(id())
public id: string;
@Index()
@Column("timestamp without time zone", {
comment: "The created date of the NoteReaction.",
})

View file

@ -139,7 +139,6 @@ export class Note {
// FIXME: file id is not removed from this array even if the file is deleted
// TODO: drop this column and use note_files
@Index()
@Column({
...id(),
array: true,
@ -147,7 +146,6 @@ export class Note {
})
public fileIds: DriveFile["id"][];
@Index()
@Column("varchar", {
length: 256,
array: true,
@ -163,7 +161,6 @@ export class Note {
})
public visibleUserIds: User["id"][];
@Index()
@Column({
...id(),
array: true,
@ -184,7 +181,6 @@ export class Note {
})
public emojis: string[];
@Index()
@Column("varchar", {
length: 128,
array: true,

View file

@ -20,7 +20,6 @@ export class Notification {
@PrimaryColumn(id())
public id: string;
@Index()
@Column("timestamp without time zone", {
comment: "The created date of the Notification.",
})

View file

@ -44,14 +44,12 @@ export class Poll {
})
public noteVisibility: (typeof noteVisibilities)[number];
@Index()
@Column({
...id(),
comment: "[Denormalized]",
})
public userId: User["id"];
@Index()
@Column("varchar", {
length: 512,
nullable: true,

View file

@ -116,7 +116,6 @@ export class User {
})
public bannerId: DriveFile["id"] | null;
@Index()
@Column("varchar", {
length: 128,
array: true,

View file

@ -527,7 +527,7 @@ export const WellKnownContext = {
manuallyApprovesFollowers: "as:manuallyApprovesFollowers",
movedTo: {
"@id": "https://www.w3.org/ns/activitystreams#movedTo",
"@type": "@id"
"@type": "@id",
},
movedToUri: "as:movedTo",
sensitive: "as:sensitive",