Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
release: 2023.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Marie authored Nov 30, 2023
2 parents b6d50d7 + 021d392 commit 1022280
Show file tree
Hide file tree
Showing 44 changed files with 706 additions and 407 deletions.
15 changes: 15 additions & 0 deletions .config/docker_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ redis:
# apiKey: ''
# ssl: true
# index: ''
# scope: global

# ┌───────────────┐
#───┘ ID generation └───────────────────────────────────────────
Expand Down Expand Up @@ -144,15 +145,22 @@ id: 'aidx'
# Job concurrency per worker
# deliverJobConcurrency: 128
# inboxJobConcurrency: 16
# relashionshipJobConcurrency: 16
# What's relashionshipJob?:
# Follow, unfollow, block and unblock(ings) while following-imports, etc. or account migrations.

# Job rate limiter
# deliverJobPerSec: 128
# inboxJobPerSec: 16
# relashionshipJobPerSec: 64

# Job attempts
# deliverJobMaxAttempts: 12
# inboxJobMaxAttempts: 8

# Local address used for outgoing requests
#outgoingAddress: 127.0.0.1

# IP address family used for outgoing request (ipv4, ipv6 or dual)
#outgoingAddressFamily: ipv4

Expand All @@ -175,8 +183,15 @@ proxyBypassHosts:
#mediaProxy: https://example.com/proxy

# Proxy remote files (default: true)
# Proxy remote files by this instance or mediaProxy to prevent remote files from running in remote domains.
proxyRemoteFiles: true

# Movie Thumbnail Generation URL
# There is no reference implementation.
# For example, Misskey will point to the following URL:
# https://example.com/thumbnail.webp?thumbnail=1&url=https%3A%2F%2Fstorage.example.com%2Fpath%2Fto%2Fvideo.mp4
#videoThumbnailGenerator: https://example.com

# Sign to ActivityPub GET request (default: true)
signToActivityPubGet: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/welcome.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1.2.0
- uses: actions/first-interaction@v1.3.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
Expand Down
14 changes: 13 additions & 1 deletion locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ addToAntenna: "Add to antenna"
sendMessage: "Send a message"
copyRSS: "Copy RSS"
copyUsername: "Copy username"
openRemoteProfile: "Open remote profile"
copyUserId: "Copy user ID"
copyNoteId: "Copy note ID"
copyFileId: "Copy file ID"
Expand Down Expand Up @@ -110,7 +111,6 @@ renote: "Boost"
unrenote: "Remove boost"
renoted: "Boosted."
quoted: "Quoted."
rmquote: "Removed quote."
rmboost: "Unboosted."
cantRenote: "This post can't be boosted."
cantReRenote: "A boost can't be boosted."
Expand Down Expand Up @@ -891,6 +891,7 @@ continueThread: "View thread continuation"
deleteAccountConfirm: "This will irreversibly delete your account. Proceed?"
incorrectPassword: "Incorrect password."
voteConfirm: "Confirm your vote for \"{choice}\"?"
voteConfirmMulti: "Confirm your vote for \"{choice}\"?\n You can choose more options after confirmation."
hide: "Hide"
useDrawerReactionPickerForMobile: "Display reaction picker as drawer on mobile"
welcomeBackWithName: "Welcome back, {name}"
Expand Down Expand Up @@ -987,6 +988,7 @@ cannotLoad: "Unable to load"
numberOfProfileView: "Profile views"
like: "Like"
unlike: "Unlike"
defaultLike: "Default like emoji"
numberOfLikes: "Likes"
show: "Show"
neverShow: "Don't show again"
Expand Down Expand Up @@ -1855,6 +1857,14 @@ _ago:
monthsAgo: "{n}mo ago"
yearsAgo: "{n}y ago"
invalid: "None"
_timeIn:
seconds: "in {n} seconds"
minutes: "in {n} minutes"
hours: "in {n} hours"
days: "in {n} days"
weeks: "in {n} weeks"
months: "in {n} months"
years: "in {n} years"
_time:
second: "Second(s)"
minute: "Minute(s)"
Expand Down Expand Up @@ -1980,6 +1990,7 @@ _widgets:
_userList:
chooseList: "Select a list"
clicker: "Clicker"
search: "Search"
_cw:
hide: "Hide"
show: "Show content"
Expand Down Expand Up @@ -2007,6 +2018,7 @@ _poll:
remainingHours: "{h} hour(s) {m} minute(s) remaining"
remainingMinutes: "{m} minute(s) {s} second(s) remaining"
remainingSeconds: "{s} second(s) remaining"
multiple: "Multiple choices"
_visibility:
public: "Public"
publicDescription: "Your note will be visible for all users"
Expand Down
6 changes: 5 additions & 1 deletion locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export interface Locale {
"sendMessage": string;
"copyRSS": string;
"copyUsername": string;
"openRemoteProfile": string;
"copyUserId": string;
"copyNoteId": string;
"copyFileId": string;
Expand Down Expand Up @@ -114,7 +115,6 @@ export interface Locale {
"renoted": string;
"quoted": string;
"rmboost": string;
"rmquote": string;
"cantRenote": string;
"cantReRenote": string;
"quote": string;
Expand Down Expand Up @@ -894,6 +894,7 @@ export interface Locale {
"deleteAccountConfirm": string;
"incorrectPassword": string;
"voteConfirm": string;
"voteConfirmMulti": string;
"hide": string;
"useDrawerReactionPickerForMobile": string;
"welcomeBackWithName": string;
Expand Down Expand Up @@ -990,6 +991,7 @@ export interface Locale {
"numberOfProfileView": string;
"like": string;
"unlike": string;
"defaultLike": string;
"numberOfLikes": string;
"show": string;
"neverShow": string;
Expand Down Expand Up @@ -2125,6 +2127,7 @@ export interface Locale {
"chooseList": string;
};
"clicker": string;
"search": string;
};
"_cw": {
"hide": string;
Expand Down Expand Up @@ -2154,6 +2157,7 @@ export interface Locale {
"remainingHours": string;
"remainingMinutes": string;
"remainingSeconds": string;
"multiple": string;
};
"_visibility": {
"public": string;
Expand Down
15 changes: 15 additions & 0 deletions locales/it-IT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ addToAntenna: "Aggiungi all'antenna"
sendMessage: "Invia messaggio"
copyRSS: "Copia RSS"
copyUsername: "Copia nome utente"
openRemoteProfile: "Apri profilo remoto"
copyUserId: "Copia ID del profilo"
copyNoteId: "Copia ID della Nota"
copyFileId: "Copia ID del file"
Expand Down Expand Up @@ -731,6 +732,8 @@ thisIsExperimentalFeature: "Questa è una funzionalità sperimentale. Potrebbe e
developer: "Sviluppatore"
makeExplorable: "Profilo visibile pubblicamente nella pagina \"Esplora\""
makeExplorableDescription: "Disabilitando questa opzione, il tuo profilo non verrà elencato nella pagina \"Esplora\"."
makeIndexable: "Non indicizzare le note pubbliche"
makeIndexableDescription: "Le tue note pubbliche non saranno cercabili"
showGapBetweenNotesInTimeline: "Mostrare un intervallo tra le note sulla timeline"
duplicate: "Duplica"
left: "Sinistra"
Expand Down Expand Up @@ -964,6 +967,7 @@ cannotLoad: "Caricamento impossibile"
numberOfProfileView: "Visualizzazioni profilo"
like: "Mi piace!"
unlike: "Non mi piace"
defaultLike: "Emoji predefinita per \"mi piace\""
numberOfLikes: "Numero di Like"
show: "Visualizza"
neverShow: "Non mostrare più"
Expand Down Expand Up @@ -1266,6 +1270,8 @@ _serverSettings:
shortName: "Abbreviazione"
shortNameDescription: "Un'abbreviazione o un nome comune che può essere visualizzato al posto del nome ufficiale lungo del server."
fanoutTimelineDescription: "Attivando questa funzionalità migliori notevolmente la capacità delle Timeline di collezionare Note, riducendo il carico sul database. Tuttavia, aumenterà l'impiego di memoria RAM per Redis. Disattiva se il tuo server ha poca RAM o la funzionalità è irregolare."
fanoutTimelineDbFallback: "Ripiega sul database"
fanoutTimelineDbFallbackDescription: "Attivando questa funzionalità, nel caso che il contenuto di una Timeline non sia presente nella cache, verrà consultato il database. Disattivandola, il carico sul database sarà ulteriormente ridotto, ma le Timeline saranno limitate"
_accountMigration:
moveFrom: "Migra un altro profilo dentro a questo"
moveFromSub: "Crea un alias verso un altro profilo remoto"
Expand Down Expand Up @@ -1702,6 +1708,7 @@ _serverDisconnectedBehavior:
reload: "Ricarica automaticamente"
dialog: "Apri avviso in finestra"
quiet: "Visualizza avviso in modo discreto"
disabled: "Non visualizzare l'avviso"
_channel:
create: "Nuovo canale"
edit: "Gerisci canale"
Expand Down Expand Up @@ -1817,6 +1824,14 @@ _ago:
monthsAgo: "{n} mesi fa"
yearsAgo: "{n} anni fa"
invalid: "Niente da visualizzare"
_timeIn:
seconds: "fra {n} secondi"
minutes: "fra {n} minuti"
hours: "fra {n} ore"
days: "fra {n} giorni"
weeks: "fra {n} settimane"
months: "fra {n} mesi"
years: "fra {n} anni"
_time:
second: "s"
minute: "min"
Expand Down
8 changes: 6 additions & 2 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ addToAntenna: "アンテナに追加"
sendMessage: "メッセージを送信"
copyRSS: "RSSをコピー"
copyUsername: "ユーザー名をコピー"
openRemoteProfile: "リモートプロファイルを開く"
copyUserId: "ユーザーIDをコピー"
copyNoteId: "ノートIDをコピー"
copyFileId: "ファイルIDをコピー"
Expand Down Expand Up @@ -111,7 +112,6 @@ unrenote: "リノート解除"
renoted: "ブースト。"
quoted: "引用。"
rmboost: "アンブースト。"
rmquote: "引用を削除しました。"
cantRenote: "この投稿はリノートできません。"
cantReRenote: "リノートをリノートすることはできません。"
quote: "引用"
Expand Down Expand Up @@ -891,6 +891,7 @@ continueThread: "さらにスレッドを見る"
deleteAccountConfirm: "アカウントが削除されます。よろしいですか?"
incorrectPassword: "パスワードが間違っています。"
voteConfirm: "「{choice}」に投票しますか?"
voteConfirmMulti: "「{choice}」に投票しますか?\n 確認後、選択肢を増やすことができます。"
hide: "隠す"
useDrawerReactionPickerForMobile: "モバイルデバイスのときドロワーで表示"
welcomeBackWithName: "おかえりなさい、{name}さん"
Expand Down Expand Up @@ -987,6 +988,7 @@ cannotLoad: "読み込めません"
numberOfProfileView: "プロフィール表示回数"
like: "いいね!"
unlike: "いいねを解除"
defaultLike: "絵文字のようなデフォルト"
numberOfLikes: "いいね数"
show: "表示"
neverShow: "今後表示しない"
Expand Down Expand Up @@ -2029,6 +2031,7 @@ _widgets:
_userList:
chooseList: "リストを選択"
clicker: "クリッカー"
search: "検索"

_cw:
hide: "隠す"
Expand Down Expand Up @@ -2058,6 +2061,7 @@ _poll:
remainingHours: "終了まであと{h}時間{m}分"
remainingMinutes: "終了まであと{m}分{s}秒"
remainingSeconds: "終了まであと{s}秒"
multiple: "複数の選択肢"

_visibility:
public: "パブリック"
Expand Down Expand Up @@ -2403,7 +2407,7 @@ _externalResourceInstaller:
_themeInstallFailed:
title: "テーマのインストールに失敗しました"
description: "テーマのインストール中に問題が発生しました。もう一度お試しください。エラーの詳細はJavascriptコンソールをご覧ください。"

_animatedMFM:
play: "MFMアニメーションを再生"
stop: "MFMアニメーション停止"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sharkey",
"version": "2023.11.1",
"version": "2023.11.2",
"codename": "shonk",
"repository": {
"type": "git",
Expand Down
19 changes: 18 additions & 1 deletion packages/backend/src/core/CustomEmojiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js';
import { GlobalEventService } from '@/core/GlobalEventService.js';
import type { MiDriveFile } from '@/models/DriveFile.js';
import type { MiEmoji } from '@/models/Emoji.js';
import type { EmojisRepository, MiRole, MiUser } from '@/models/_.js';
import type { DriveFilesRepository, EmojisRepository, MiRole, MiUser } from '@/models/_.js';
import { bindThis } from '@/decorators.js';
import { MemoryKVCache, RedisSingleCache } from '@/misc/cache.js';
import { UtilityService } from '@/core/UtilityService.js';
import { query } from '@/misc/prelude/url.js';
import type { Serialized } from '@/types.js';
import { ModerationLogService } from '@/core/ModerationLogService.js';
import type { Config } from '@/config.js';
import { DriveService } from './DriveService.js';

const parseEmojiStrRegexp = /^(\w+)(?:@([\w.-]+))?$/;

Expand All @@ -38,11 +39,15 @@ export class CustomEmojiService implements OnApplicationShutdown {
@Inject(DI.emojisRepository)
private emojisRepository: EmojisRepository,

@Inject(DI.driveFilesRepository)
private driveFilesRepository: DriveFilesRepository,

private utilityService: UtilityService,
private idService: IdService,
private emojiEntityService: EmojiEntityService,
private moderationLogService: ModerationLogService,
private globalEventService: GlobalEventService,
private driveService: DriveService,
) {
this.cache = new MemoryKVCache<MiEmoji | null>(1000 * 60 * 60 * 12);

Expand Down Expand Up @@ -259,6 +264,12 @@ export class CustomEmojiService implements OnApplicationShutdown {

this.localEmojisCache.refresh();

const file = await this.driveFilesRepository.findOneBy({ url: emoji.originalUrl, userHost: emoji.host ? emoji.host : IsNull() });

if (file) {
await this.driveService.deleteFile(file, false, moderator ? moderator : undefined);
}

this.globalEventService.publishBroadcastStream('emojiDeleted', {
emojis: [await this.emojiEntityService.packDetailed(emoji)],
});
Expand All @@ -280,6 +291,12 @@ export class CustomEmojiService implements OnApplicationShutdown {
for (const emoji of emojis) {
await this.emojisRepository.delete(emoji.id);

const file = await this.driveFilesRepository.findOneBy({ url: emoji.originalUrl, userHost: emoji.host ? emoji.host : IsNull() });

if (file) {
await this.driveService.deleteFile(file, false, moderator ? moderator : undefined);
}

if (moderator) {
this.moderationLogService.log(moderator, 'deleteCustomEmoji', {
emojiId: emoji.id,
Expand Down
Loading

0 comments on commit 1022280

Please sign in to comment.