Merge branch 'develop' into hazelnoot/following-timeline

This commit is contained in:
Hazel K 2024-10-02 11:45:09 -04:00
commit 705ae79eb1
23 changed files with 132 additions and 29 deletions

View file

@ -0,0 +1,16 @@
/*
* SPDX-FileCopyrightText: piuvas and other Sharkey contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
export class SidebarLogo1727027985575 {
name = 'SidebarLogo1727027985575';
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" ADD "sidebarLogoUrl" character varying(1024)`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "sidebarLogoUrl"`);
}
}

View file

@ -105,6 +105,7 @@ export class MetaEntityService {
serverErrorImageUrl: instance.serverErrorImageUrl,
notFoundImageUrl: instance.notFoundImageUrl,
iconUrl: instance.iconUrl,
sidebarLogoUrl: instance.sidebarLogoUrl,
backgroundImageUrl: instance.backgroundImageUrl,
logoImageUrl: instance.logoImageUrl,
maxNoteTextLength: this.config.maxNoteLength,

View file

@ -22,14 +22,14 @@ export const getNoteSummary = (note: Packed<'Note'>): string => {
// 本文
if (note.cw != null) {
summary += note.cw;
} else {
summary += note.text ? note.text : '';
summary += `CW: ${note.cw}`;
} else if (note.text) {
summary += note.text;
}
// ファイルが添付されているとき
if ((note.files ?? []).length !== 0) {
summary += ` (📎${note.files!.length})`;
if (note.files && note.files.length !== 0) {
summary += ` (📎${note.files.length})`;
}
// 投票が添付されているとき
@ -39,7 +39,7 @@ export const getNoteSummary = (note: Packed<'Note'>): string => {
// 返信のとき
if (note.replyId) {
if (note.reply) {
if (note.reply && !note.cw) {
summary += `\n\nRE: ${getNoteSummary(note.reply)}`;
} else {
summary += '\n\nRE: ...';
@ -48,7 +48,7 @@ export const getNoteSummary = (note: Packed<'Note'>): string => {
// Renoteのとき
if (note.renoteId) {
if (note.renote) {
if (note.renote && !note.cw) {
summary += `\n\nRN: ${getNoteSummary(note.renote)}`;
} else {
summary += '\n\nRN: ...';

View file

@ -139,6 +139,12 @@ export class MiMeta {
})
public app512IconUrl: string | null;
@Column('varchar', {
length: 1024,
nullable: true,
})
public sidebarLogoUrl: string | null;
@Column('varchar', {
length: 1024,
nullable: true,

View file

@ -110,6 +110,10 @@ export const meta = {
type: 'string',
optional: false, nullable: true,
},
sidebarLogoUrl: {
type: 'string',
optional: false, nullable: true,
},
enableEmail: {
type: 'boolean',
optional: false, nullable: false,
@ -582,6 +586,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
iconUrl: instance.iconUrl,
app192IconUrl: instance.app192IconUrl,
app512IconUrl: instance.app512IconUrl,
sidebarLogoUrl: instance.sidebarLogoUrl,
backgroundImageUrl: instance.backgroundImageUrl,
logoImageUrl: instance.logoImageUrl,
defaultLightTheme: instance.defaultLightTheme,

View file

@ -55,6 +55,7 @@ export const paramDef = {
iconUrl: { type: 'string', nullable: true },
app192IconUrl: { type: 'string', nullable: true },
app512IconUrl: { type: 'string', nullable: true },
sidebarLogoUrl: { type: 'string', nullable: true },
backgroundImageUrl: { type: 'string', nullable: true },
logoImageUrl: { type: 'string', nullable: true },
name: { type: 'string', nullable: true },
@ -250,6 +251,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
set.app512IconUrl = ps.app512IconUrl;
}
if (ps.sidebarLogoUrl !== undefined) {
set.sidebarLogoUrl = ps.sidebarLogoUrl;
}
if (ps.serverErrorImageUrl !== undefined) {
set.serverErrorImageUrl = ps.serverErrorImageUrl;
}