mirror of
https://codeberg.org/yeentown/barkey
synced 2024-12-22 18:50:00 +00:00
parent
a9bc22e4e6
commit
8ae9d2eaa8
12 changed files with 36 additions and 0 deletions
|
@ -17,6 +17,7 @@ You should also include the user name that made the change.
|
|||
- ノートごとに絵文字リアクションを受け取るか設定できるように
|
||||
- ノート検索の利用可否をロールで制御可能に(デフォルトでオフ)
|
||||
- ロールの並び順を設定可能に
|
||||
- カスタム絵文字にライセンス情報を付与できるように
|
||||
- 指定した文字列を含む投稿の公開範囲をホームにできるように
|
||||
- enhance(client): 設定から自分のロールを確認できるように
|
||||
- enhance(client): DM作成時にメンションも含むように
|
||||
|
|
|
@ -974,6 +974,7 @@ resetPasswordConfirm: "パスワードリセットしますか?"
|
|||
sensitiveWords: "センシティブワード"
|
||||
sensitiveWordsDescription: "設定したワードが含まれるノートの公開範囲をホームにします。改行で区切って複数設定できます。"
|
||||
notesSearchNotAvailable: "ノート検索は利用できません。"
|
||||
license: "ライセンス"
|
||||
|
||||
_achievements:
|
||||
earnedAt: "獲得日時"
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
export class addPropsForCustomEmoji1678945242650 {
|
||||
name = 'addPropsForCustomEmoji1678945242650'
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "emoji" ADD "license" character varying(1024)`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "emoji" DROP COLUMN "license"`);
|
||||
}
|
||||
}
|
|
@ -44,6 +44,7 @@ export class CustomEmojiService {
|
|||
category: string | null;
|
||||
aliases: string[];
|
||||
host: string | null;
|
||||
license: string | null;
|
||||
}): Promise<Emoji> {
|
||||
const emoji = await this.emojisRepository.insert({
|
||||
id: this.idService.genId(),
|
||||
|
@ -55,6 +56,7 @@ export class CustomEmojiService {
|
|||
originalUrl: data.driveFile.url,
|
||||
publicUrl: data.driveFile.webpublicUrl ?? data.driveFile.url,
|
||||
type: data.driveFile.webpublicType ?? data.driveFile.type,
|
||||
license: data.license,
|
||||
}).then(x => this.emojisRepository.findOneByOrFail(x.identifiers[0]));
|
||||
|
||||
if (data.host == null) {
|
||||
|
|
|
@ -50,6 +50,7 @@ export class EmojiEntityService {
|
|||
host: emoji.host,
|
||||
// || emoji.originalUrl してるのは後方互換性のため(publicUrlはstringなので??はだめ)
|
||||
url: emoji.publicUrl || emoji.originalUrl,
|
||||
license: emoji.license,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -55,4 +55,9 @@ export class Emoji {
|
|||
array: true, length: 128, default: '{}',
|
||||
})
|
||||
public aliases: string[];
|
||||
|
||||
@Column('varchar', {
|
||||
length: 1024, nullable: true,
|
||||
})
|
||||
public license: string | null;
|
||||
}
|
||||
|
|
|
@ -59,5 +59,9 @@ export const packedEmojiDetailedSchema = {
|
|||
type: 'string',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
license: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
|
|
@ -102,6 +102,7 @@ export class ImportCustomEmojisProcessorService {
|
|||
host: null,
|
||||
aliases: emojiInfo.aliases,
|
||||
driveFile,
|
||||
license: emojiInfo.license,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
category: null,
|
||||
aliases: [],
|
||||
host: null,
|
||||
license: null,
|
||||
});
|
||||
|
||||
this.moderationLogService.insertModerationLog(me, 'addEmoji', {
|
||||
|
|
|
@ -87,6 +87,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
originalUrl: driveFile.url,
|
||||
publicUrl: driveFile.webpublicUrl ?? driveFile.url,
|
||||
type: driveFile.webpublicType ?? driveFile.type,
|
||||
license: emoji.license,
|
||||
}).then(x => this.emojisRepository.findOneByOrFail(x.identifiers[0]));
|
||||
|
||||
await this.db.queryResultCache?.remove(['meta_emojis']);
|
||||
|
|
|
@ -35,6 +35,7 @@ export const paramDef = {
|
|||
aliases: { type: 'array', items: {
|
||||
type: 'string',
|
||||
} },
|
||||
license: { type: 'string', nullable: true },
|
||||
},
|
||||
required: ['id', 'name', 'aliases'],
|
||||
} as const;
|
||||
|
@ -64,6 +65,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
name: ps.name,
|
||||
category: ps.category,
|
||||
aliases: ps.aliases,
|
||||
license: ps.license,
|
||||
});
|
||||
|
||||
await this.db.queryResultCache?.remove(['meta_emojis']);
|
||||
|
|
|
@ -22,6 +22,9 @@
|
|||
<template #label>{{ i18n.ts.tags }}</template>
|
||||
<template #caption>{{ i18n.ts.setMultipleBySeparatingWithSpace }}</template>
|
||||
</MkInput>
|
||||
<MkInput v-model="license">
|
||||
<template #label>{{ i18n.ts.license }}</template>
|
||||
</MkInput>
|
||||
<MkButton danger @click="del()"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
|
||||
</div>
|
||||
</MkSpacer>
|
||||
|
@ -45,6 +48,7 @@ let dialog = $ref(null);
|
|||
let name: string = $ref(props.emoji.name);
|
||||
let category: string = $ref(props.emoji.category);
|
||||
let aliases: string = $ref(props.emoji.aliases.join(' '));
|
||||
let license: string = $ref(props.emoji.license ?? '');
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: 'done', v: { deleted?: boolean, updated?: any }): void,
|
||||
|
@ -61,6 +65,7 @@ async function update() {
|
|||
name,
|
||||
category,
|
||||
aliases: aliases.split(' '),
|
||||
license: license === '' ? null : license,
|
||||
});
|
||||
|
||||
emit('done', {
|
||||
|
@ -69,6 +74,7 @@ async function update() {
|
|||
name,
|
||||
category,
|
||||
aliases: aliases.split(' '),
|
||||
license: license === '' ? null : license,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue