mirror of
https://git.joinfirefish.org/firefish/firefish.git
synced 2024-05-18 21:21:10 +02:00
Merge branch 'develop' into refactor/push-notification
This commit is contained in:
commit
8dd4e5ed64
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
})
|
||||
|
|
|
@ -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.",
|
||||
})
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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.",
|
||||
})
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -116,7 +116,6 @@ export class User {
|
|||
})
|
||||
public bannerId: DriveFile["id"] | null;
|
||||
|
||||
@Index()
|
||||
@Column("varchar", {
|
||||
length: 128,
|
||||
array: true,
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue