diff --git a/CHANGELOG.md b/CHANGELOG.md index 96319e1f5c..2e4a528379 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,20 +10,27 @@ --> -## 12.x.x (unreleased) +## 12.96.0 (2021/11/13) ### Improvements - フォロー/フォロワーを非公開にできるように - インスタンスプロフィールレンダリング ready - 通知のリアクションアイコンをホバーで拡大できるように +- RenoteボタンをホバーでRenoteしたユーザー一覧を表示するように +- 返信の際にメンションを含めるように +- 通報があったときに管理者へEメールで通知されるように - メールアドレスのバリデーションを強化 ### Bugfixes +- アカウント削除処理があると高負荷になる問題を修正 - クライアント: 長いメニューが画面からはみ出す問題を修正 - クライアント: コントロールパネルのジョブキューに個々のジョブが表示されないのを修正 - クライアント: fix missing i18n string - fix html conversion issue with code blocks +### Changes +- ノートにモバイルからの投稿か否かの情報を含めないように + ## 12.95.0 (2021/10/31) ### Improvements diff --git a/locales/fr-FR.yml b/locales/fr-FR.yml index c3964fff6d..5d67b5269a 100644 --- a/locales/fr-FR.yml +++ b/locales/fr-FR.yml @@ -797,6 +797,15 @@ unread: "Non lu" filter: "Filtre" controlPanel: "Panneau de contrôle" manageAccounts: "Gérer les comptes" +classic: "Classique" +_emailUnavailable: + format: "Le format de cette adresse de courriel est invalide" + mx: "Ce serveur de courriels est invalide" + smtp: "Ce serveur de courriels ne répond pas" +_ffVisibility: + public: "Public" + followers: "Visible uniquement pour les abonné·e·s" + private: "Privé" _signup: almostThere: "Bientôt fini" emailAddressInfo: "Insérez votre adresse e-mail." @@ -808,13 +817,6 @@ _accountDelete: requestAccountDelete: "Demander la suppression de votre compte" started: "La procédure de suppression a commencé." inProgress: "Suppression en cours" -_docs: - continueReading: "Lire plus" - features: "Fonctionnalités" - generalTopics: "Sujets généraux" - advancedTopics: "Sujets avancés" - admin: "Gestion" - translateWarn: "Ceci est une traduction dont le contenu peut différer du texte original." _ad: back: "Retour" reduceFrequencyOfThisAd: "Voir cette publicité moins souvent" diff --git a/locales/id-ID.yml b/locales/id-ID.yml index 06df4ce8e9..f4997e3a64 100644 --- a/locales/id-ID.yml +++ b/locales/id-ID.yml @@ -81,6 +81,8 @@ somethingHappened: "Terjadi kesalahan" retry: "Coba lagi" pageLoadError: "Gagal memuat halaman." pageLoadErrorDescription: "Umumnya disebabkan jaringan atau tembolok perambah. Cobalah bersihkan tembolok peramban lalu tunggu sesaat sebelum mencoba kembali." +serverIsDead: "Tidak ada respon dari server. Mohon tunggu dan coba beberapa saat lagi." +youShouldUpgradeClient: "Untuk melihat halaman ini, mohon muat ulang untuk memutakhirkan klienmu." enterListName: "Masukkan nama daftar" privacy: "Privasi" makeFollowManuallyApprove: "Permintaan mengikuti membutuhkan persetujuan" @@ -529,6 +531,8 @@ removeAllFollowing: "Tahan semua mengikuti" removeAllFollowingDescription: "Batal mengikuti semua akun dari {host}. Mohon jalankan ini ketika instansi sudah tidak ada lagi." userSuspended: "Pengguna ini telah dibekukan." userSilenced: "Pengguna ini telah dibungkam." +yourAccountSuspendedTitle: "Akun ini dibekukan" +yourAccountSuspendedDescription: "Akun ini dibekukan karena melanggar ketentuan penggunaan layanan server atau semacamnya. Hubungi admin apabila ingin tahu alasan lebih lanjut. Mohon untuk tidak membuat akun baru." menu: "Menu" divider: "Pembagi" addItem: "Tambahkan item" @@ -616,6 +620,8 @@ reportAbuse: "Laporkan" reportAbuseOf: "Laporkan {name}" fillAbuseReportDescription: "Mohon isi rincian laporan. Jika laporan ini mengenai catatan yang spesifik, mohon lampirkan serta URL catatan tersebut." abuseReported: "Laporan kamu telah dikirimkan. Terima kasih." +reporteeOrigin: "Yang dilaporkan" +reporterOrigin: "Pelapor" send: "Kirim" abuseMarkAsResolved: "Tandai laporan sebagai selesai" openInNewTab: "Buka di tab baru" @@ -762,6 +768,7 @@ middle: "Sedang" low: "Rendah" emailNotConfiguredWarning: "Alamat surel tidak disetel." ratio: "Rasio" +previewNoteText: "Tampilkan pratinjau" customCss: "Custom CSS" customCssWarn: "Pengaturan ini seharusnya digunakan jika kamu tahu cara kerjanya. Memasukkan nilai yang tidak tepat dapat menyebabkan klien tidak berfungsi semestinya." global: "Global" @@ -779,8 +786,40 @@ translate: "Terjemahkan" translatedFrom: "Terjemahkan dari {x}" accountDeletionInProgress: "Penghapusan akun sedang dalam proses" usernameInfo: "Nama yang mengidentifikasikan akun kamu dari yang lain pada server ini. Kamu dapat menggunakan alfabet (a~z, A~Z), digit (0~9) atau garis bawah (_). Username tidak dapat diubah setelahnya." +aiChanMode: "Mode Ai" keepCw: "Biarkan Peringatan Konten" +pubSub: "Akun Pub/Sub" +lastCommunication: "Komunikasi terakhir" +resolved: "Selesai" +unresolved: "Belum selesai" +itsOn: "Aktif" +itsOff: "Nonaktif" +emailRequiredForSignup: "Membutuhkan alamat surel untuk mendaftar" +unread: "Belum dibaca" +filter: "Saring" controlPanel: "Panel kontrol" +manageAccounts: "Kelola Akun" +makeReactionsPublic: "Tampilkan riwayat reaksi ke publik" +makeReactionsPublicDescription: "Pengaturan ini akan membuat daftar dari semua reaksi masa lalu kamu ditampilkan secara publik." +classic: "Klasik" +muteThread: "Bisukan thread" +unmuteThread: "Suarakan thread" +ffVisibility: "Visibilitas Mengikuti/Pengikut" +ffVisibilityDescription: "Mengatur siapa yang dapat melihat pengikutmu dan yang kamu ikuti." +_emailUnavailable: + used: "Alamat surel ini telah digunakan" + format: "Format tidak valid." + disposable: "Alamat surel temporer tidak dapat digunakan" + mx: "Server alamat surel ini tidak valid" + smtp: "Server alamat surel ini tidak merespon" +_ffVisibility: + public: "Terbitkan" + followers: "Tampil untuk pengikut saja" + private: "Tersembunyi" +_signup: + almostThere: "Hampir selesai" + emailAddressInfo: "Mohon masukkan alamat surel kamu." + emailSent: "Konfirmasi surel telah dikirimkan ke alamat surel kamu ({email}). Mohon klik tautan yang tercantum di dalamnya untuk menyelesaikan pembuatan akun." _accountDelete: accountDelete: "Hapus akun" mayTakeTime: "Karena penghapusan akun merupakan proses yang berat dan intensif, kemungkinan dapat membutuhkan waktu untuk menyelesaikan tergantung daripada berapa banyak konten yang kamu buat dan berapa banyak berkas yang telah kamu unggah." @@ -788,13 +827,6 @@ _accountDelete: requestAccountDelete: "Minta penghapusan akun" started: "Penghapusan telah dimulai" inProgress: "Penghapusan sedang dalam proses" -_docs: - continueReading: "Baca lebih lanjut" - features: "Fitur" - generalTopics: "Topik umum" - advancedTopics: "Topik tingkat lanjut" - admin: "Manajemen" - translateWarn: "Ini merupakan dokumen terjemahan. Konten di dalamnya kemungkinan dapat berbeda dari yang aslinya." _ad: back: "Kembali" reduceFrequencyOfThisAd: "Tampilkan iklan ini lebih sedikit" @@ -895,6 +927,8 @@ _mfm: fontDescription: "Setel font yang ditampilkan untuk konten." rainbow: "Pelangi" rainbowDescription: "Membuat konten muncul dalam warna pelangi." + sparkle: "Kelap-kelip" + sparkleDescription: "Memberikan konten efek partikel kelap-kelip." _reversi: reversi: "Reversi" gameSettings: "Pengaturan permainan" @@ -1121,6 +1155,10 @@ _permissions: "write:user-groups": "Sunting atau hapus grup pengguna" "read:channels": "Lihat saluran" "write:channels": "Sunting saluran" + "read:gallery": "Lihat galeri" + "write:gallery": "Sunting galeri" + "read:gallery-likes": "Lihat daftar postingan galeri yang disukai" + "write:gallery-likes": "Sunting daftar postingan galeri yang disukai" _auth: shareAccess: "Apakah kamu ingin mengijinkan \"{name}\" untuk mengakses akun ini?" shareAccessAsk: "Apakah kamu ingin mengijinkan aplikasi ini untuk mengakses akun kamu?" diff --git a/locales/tr-TR.yml b/locales/tr-TR.yml new file mode 100644 index 0000000000..46204d33c4 --- /dev/null +++ b/locales/tr-TR.yml @@ -0,0 +1,62 @@ +--- +_lang_: "Türkçe" +introMisskey: "Açık kaynaklı bir dağıtılmış mikroblog hizmeti olan Misskey'e hoş geldiniz.\nMisskey, neler olup bittiğini paylaşmak ve herkese sizden bahsetmek için \"notlar\" oluşturmanıza olanak tanıyan, açık kaynaklı, dağıtılmış bir mikroblog hizmetidir.\nHerkesin notlarına kendi tepkilerinizi hızlıca eklemek için \"Tepkiler\" özelliğini de kullanabilirsiniz👍.\nYeni bir dünyayı keşfedin🚀." +monthAndDay: "{month}Ay {day}Gün" +search: "Arama" +notifications: "Bildirim" +username: "Kullanıcı Adı" +password: "Şifre" +forgotPassword: "şifremi unuttum" +ok: "TAMAM" +gotIt: "Anladım" +cancel: "İptal" +enterUsername: "Kullanıcı adınızı giriniz" +noNotes: "Notlar mevcut değil." +noNotifications: "Bildirim bulunmuyor" +settings: "Ayarlar" +basicSettings: "Temel Ayarlar" +otherSettings: "Diğer Ayarlar" +openInWindow: "Bir pencere ile aç" +profile: "Profil" +timeline: "Zaman çizelgesi" +noAccountDescription: "Bu kullanıcı henüz biyografisini yazmadı" +login: "Giriş Yap " +logout: "Çıkış Yap" +signup: "Kayıt Ol" +uploading: "Yükleniyor" +users: "Kullanıcı" +addUser: "Kullanıcı Ekle" +favorite: "Favoriler" +favorites: "Favoriler" +unfavorite: "Favorilerden Kaldır" +favorited: "Favorilerime eklendi." +alreadyFavorited: "Zaten favorilerinizde kayıtlı." +pin: "Sabitlenmiş" +unpin: "Sabitlemeyi kaldır" +copyContent: "İçeriği kopyala" +copyLink: "Bağlantıyı Kopyala" +delete: "Sil" +deleteAndEdit: "Sil ve yeniden düzenle" +deleteAndEditConfirm: "Bu notu silip yeniden düzenlemek istiyor musunuz? Bu nota ilişkin tüm Tepkiler, Yeniden Notlar ve Yanıtlar da silinecektir." +addToList: "Listeye ekle" +sendMessage: "Mesaj Gönder" +copyUsername: "Kullanıcı Adını Kopyala" +searchUser: "Kullanıcıları ara" +pinned: "Sabitlenmiş" +remove: "Sil" +smtpUser: "Kullanıcı Adı" +smtpPass: "Şifre" +user: "Kullanıcı" +_mfm: + search: "Arama" +_sfx: + notification: "Bildirim" +_widgets: + notifications: "Bildirim" + timeline: "Zaman çizelgesi" +_profile: + username: "Kullanıcı Adı" +_deck: + _columns: + notifications: "Bildirim" + tl: "Zaman çizelgesi" diff --git a/package.json b/package.json index 20824aca10..86f8a03cbe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.95.0", + "version": "12.96.0", "codename": "indigo", "repository": { "type": "git", diff --git a/packages/backend/@types/ms.d.ts b/packages/backend/@types/ms.d.ts deleted file mode 100644 index 2f0156d104..0000000000 --- a/packages/backend/@types/ms.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare module 'ms' { - interface IMSOptions { - long: boolean; - } - - function ms(value: string): number; - function ms(value: number, options?: IMSOptions): string; - - namespace ms {} // Hack - - export = ms; -} diff --git a/packages/backend/package.json b/packages/backend/package.json index 4376dc4887..6c41245e66 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -59,6 +59,7 @@ "@types/redis": "2.8.32", "@types/rename": "1.0.4", "@types/request-stats": "3.0.0", + "@types/sanitize-html": "2.5.0", "@types/seedrandom": "2.4.28", "@types/sharp": "0.29.3", "@types/sinonjs__fake-timers": "6.0.4", @@ -135,7 +136,7 @@ "mfm-js": "0.20.0", "misskey-js": "0.0.8", "mocha": "8.4.0", - "ms": "2.1.3", + "ms": "3.0.0-canary.1", "multer": "1.4.3", "nested-property": "4.0.0", "node-fetch": "2.6.1", @@ -163,6 +164,7 @@ "require-all": "3.0.0", "rndstr": "1.0.0", "s-age": "1.1.2", + "sanitize-html": "2.5.3", "seedrandom": "3.0.5", "sharp": "0.29.2", "speakeasy": "2.0.0", diff --git a/packages/backend/src/server/api/endpoints/ap/get.ts b/packages/backend/src/server/api/endpoints/ap/get.ts index 78919f43b0..2f97a24774 100644 --- a/packages/backend/src/server/api/endpoints/ap/get.ts +++ b/packages/backend/src/server/api/endpoints/ap/get.ts @@ -2,7 +2,7 @@ import $ from 'cafy'; import define from '../../define'; import Resolver from '@/remote/activitypub/resolver'; import { ApiError } from '../../error'; -import * as ms from 'ms'; +import ms from 'ms'; export const meta = { tags: ['federation'], diff --git a/packages/backend/src/server/api/endpoints/ap/show.ts b/packages/backend/src/server/api/endpoints/ap/show.ts index 2280d93724..32685d44bd 100644 --- a/packages/backend/src/server/api/endpoints/ap/show.ts +++ b/packages/backend/src/server/api/endpoints/ap/show.ts @@ -11,7 +11,7 @@ import { Note } from '@/models/entities/note'; import { User } from '@/models/entities/user'; import { fetchMeta } from '@/misc/fetch-meta'; import { isActor, isPost, getApId } from '@/remote/activitypub/type'; -import * as ms from 'ms'; +import ms from 'ms'; export const meta = { tags: ['federation'], diff --git a/packages/backend/src/server/api/endpoints/blocking/create.ts b/packages/backend/src/server/api/endpoints/blocking/create.ts index 2953252394..4d33c09479 100644 --- a/packages/backend/src/server/api/endpoints/blocking/create.ts +++ b/packages/backend/src/server/api/endpoints/blocking/create.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; -import * as ms from 'ms'; +import ms from 'ms'; import create from '@/services/blocking/create'; import define from '../../define'; import { ApiError } from '../../error'; diff --git a/packages/backend/src/server/api/endpoints/blocking/delete.ts b/packages/backend/src/server/api/endpoints/blocking/delete.ts index a66e46fdf0..ae5dab020a 100644 --- a/packages/backend/src/server/api/endpoints/blocking/delete.ts +++ b/packages/backend/src/server/api/endpoints/blocking/delete.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; -import * as ms from 'ms'; +import ms from 'ms'; import deleteBlocking from '@/services/blocking/delete'; import define from '../../define'; import { ApiError } from '../../error'; diff --git a/packages/backend/src/server/api/endpoints/drive/files/create.ts b/packages/backend/src/server/api/endpoints/drive/files/create.ts index 2abc104e6c..89755d9498 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/create.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/create.ts @@ -1,4 +1,4 @@ -import * as ms from 'ms'; +import ms from 'ms'; import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; import create from '@/services/drive/add-file'; diff --git a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts index 9f10a42d24..adb5126fbe 100644 --- a/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts +++ b/packages/backend/src/server/api/endpoints/drive/files/upload-from-url.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; -import * as ms from 'ms'; +import ms from 'ms'; import uploadFromUrl from '@/services/drive/upload-from-url'; import define from '../../../define'; import { DriveFiles } from '@/models/index'; diff --git a/packages/backend/src/server/api/endpoints/following/create.ts b/packages/backend/src/server/api/endpoints/following/create.ts index ba9ca1092d..92e86bf6b2 100644 --- a/packages/backend/src/server/api/endpoints/following/create.ts +++ b/packages/backend/src/server/api/endpoints/following/create.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; -import * as ms from 'ms'; +import ms from 'ms'; import create from '@/services/following/create'; import define from '../../define'; import { ApiError } from '../../error'; diff --git a/packages/backend/src/server/api/endpoints/following/delete.ts b/packages/backend/src/server/api/endpoints/following/delete.ts index 0b0158b86e..030d30c9b5 100644 --- a/packages/backend/src/server/api/endpoints/following/delete.ts +++ b/packages/backend/src/server/api/endpoints/following/delete.ts @@ -1,6 +1,6 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; -import * as ms from 'ms'; +import ms from 'ms'; import deleteFollowing from '@/services/following/delete'; import define from '../../define'; import { ApiError } from '../../error'; diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts index 38b487e6ea..34af72695d 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/create.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/create.ts @@ -1,5 +1,5 @@ import $ from 'cafy'; -import * as ms from 'ms'; +import ms from 'ms'; import define from '../../../define'; import { ID } from '../../../../../misc/cafy-id'; import { DriveFiles, GalleryPosts } from '@/models/index'; diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts index 54eea130d3..f94606acf2 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/update.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/update.ts @@ -1,5 +1,5 @@ import $ from 'cafy'; -import * as ms from 'ms'; +import ms from 'ms'; import define from '../../../define'; import { ID } from '../../../../../misc/cafy-id'; import { DriveFiles, GalleryPosts } from '@/models/index'; diff --git a/packages/backend/src/server/api/endpoints/i/export-blocking.ts b/packages/backend/src/server/api/endpoints/i/export-blocking.ts index e4797da0c1..e276ecf384 100644 --- a/packages/backend/src/server/api/endpoints/i/export-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/export-blocking.ts @@ -1,6 +1,6 @@ import define from '../../define'; import { createExportBlockingJob } from '@/queue/index'; -import * as ms from 'ms'; +import ms from 'ms'; export const meta = { secure: true, diff --git a/packages/backend/src/server/api/endpoints/i/export-following.ts b/packages/backend/src/server/api/endpoints/i/export-following.ts index b0f154cda8..a351161111 100644 --- a/packages/backend/src/server/api/endpoints/i/export-following.ts +++ b/packages/backend/src/server/api/endpoints/i/export-following.ts @@ -1,6 +1,6 @@ import define from '../../define'; import { createExportFollowingJob } from '@/queue/index'; -import * as ms from 'ms'; +import ms from 'ms'; export const meta = { secure: true, diff --git a/packages/backend/src/server/api/endpoints/i/export-mute.ts b/packages/backend/src/server/api/endpoints/i/export-mute.ts index 46d547fa53..b176c7ee8d 100644 --- a/packages/backend/src/server/api/endpoints/i/export-mute.ts +++ b/packages/backend/src/server/api/endpoints/i/export-mute.ts @@ -1,6 +1,6 @@ import define from '../../define'; import { createExportMuteJob } from '@/queue/index'; -import * as ms from 'ms'; +import ms from 'ms'; export const meta = { secure: true, diff --git a/packages/backend/src/server/api/endpoints/i/export-notes.ts b/packages/backend/src/server/api/endpoints/i/export-notes.ts index 441bf16896..8cba04552e 100644 --- a/packages/backend/src/server/api/endpoints/i/export-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/export-notes.ts @@ -1,6 +1,6 @@ import define from '../../define'; import { createExportNotesJob } from '@/queue/index'; -import * as ms from 'ms'; +import ms from 'ms'; export const meta = { secure: true, diff --git a/packages/backend/src/server/api/endpoints/i/export-user-lists.ts b/packages/backend/src/server/api/endpoints/i/export-user-lists.ts index 24043a862a..44d43c0bea 100644 --- a/packages/backend/src/server/api/endpoints/i/export-user-lists.ts +++ b/packages/backend/src/server/api/endpoints/i/export-user-lists.ts @@ -1,6 +1,6 @@ import define from '../../define'; import { createExportUserListsJob } from '@/queue/index'; -import * as ms from 'ms'; +import ms from 'ms'; export const meta = { secure: true, diff --git a/packages/backend/src/server/api/endpoints/i/import-blocking.ts b/packages/backend/src/server/api/endpoints/i/import-blocking.ts index d44d0b6077..4822bd5868 100644 --- a/packages/backend/src/server/api/endpoints/i/import-blocking.ts +++ b/packages/backend/src/server/api/endpoints/i/import-blocking.ts @@ -2,7 +2,7 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; import define from '../../define'; import { createImportBlockingJob } from '@/queue/index'; -import * as ms from 'ms'; +import ms from 'ms'; import { ApiError } from '../../error'; import { DriveFiles } from '@/models/index'; diff --git a/packages/backend/src/server/api/endpoints/i/import-following.ts b/packages/backend/src/server/api/endpoints/i/import-following.ts index b3de397661..19aa2fa933 100644 --- a/packages/backend/src/server/api/endpoints/i/import-following.ts +++ b/packages/backend/src/server/api/endpoints/i/import-following.ts @@ -2,7 +2,7 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; import define from '../../define'; import { createImportFollowingJob } from '@/queue/index'; -import * as ms from 'ms'; +import ms from 'ms'; import { ApiError } from '../../error'; import { DriveFiles } from '@/models/index'; diff --git a/packages/backend/src/server/api/endpoints/i/import-muting.ts b/packages/backend/src/server/api/endpoints/i/import-muting.ts index c17434c587..c474dd7186 100644 --- a/packages/backend/src/server/api/endpoints/i/import-muting.ts +++ b/packages/backend/src/server/api/endpoints/i/import-muting.ts @@ -2,7 +2,7 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; import define from '../../define'; import { createImportMutingJob } from '@/queue/index'; -import * as ms from 'ms'; +import ms from 'ms'; import { ApiError } from '../../error'; import { DriveFiles } from '@/models/index'; diff --git a/packages/backend/src/server/api/endpoints/i/import-user-lists.ts b/packages/backend/src/server/api/endpoints/i/import-user-lists.ts index 9069a019a9..ceccdd1852 100644 --- a/packages/backend/src/server/api/endpoints/i/import-user-lists.ts +++ b/packages/backend/src/server/api/endpoints/i/import-user-lists.ts @@ -2,7 +2,7 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; import define from '../../define'; import { createImportUserListsJob } from '@/queue/index'; -import * as ms from 'ms'; +import ms from 'ms'; import { ApiError } from '../../error'; import { DriveFiles } from '@/models/index'; diff --git a/packages/backend/src/server/api/endpoints/i/update-email.ts b/packages/backend/src/server/api/endpoints/i/update-email.ts index 9b6fb9c410..ff5a9f292c 100644 --- a/packages/backend/src/server/api/endpoints/i/update-email.ts +++ b/packages/backend/src/server/api/endpoints/i/update-email.ts @@ -3,7 +3,7 @@ import { publishMainStream } from '@/services/stream'; import define from '../../define'; import rndstr from 'rndstr'; import config from '@/config/index'; -import * as ms from 'ms'; +import ms from 'ms'; import * as bcrypt from 'bcryptjs'; import { Users, UserProfiles } from '@/models/index'; import { sendEmail } from '@/services/send-email'; diff --git a/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts b/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts index bd4890fc8a..25bf676383 100644 --- a/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts +++ b/packages/backend/src/server/api/endpoints/messaging/messages/delete.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; import define from '../../../define'; -import * as ms from 'ms'; +import ms from 'ms'; import { ApiError } from '../../../error'; import { MessagingMessages } from '@/models/index'; import { deleteMessage } from '@/services/messages/delete'; diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index f4a98fe8fc..f5af080a6b 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -1,5 +1,5 @@ import $ from 'cafy'; -import * as ms from 'ms'; +import ms from 'ms'; import { length } from 'stringz'; import create from '@/services/note/create'; import define from '../../define'; diff --git a/packages/backend/src/server/api/endpoints/notes/delete.ts b/packages/backend/src/server/api/endpoints/notes/delete.ts index 7163a2b9d2..7f0d59669e 100644 --- a/packages/backend/src/server/api/endpoints/notes/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/delete.ts @@ -2,7 +2,7 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; import deleteNote from '@/services/note/delete'; import define from '../../define'; -import * as ms from 'ms'; +import ms from 'ms'; import { getNote } from '../../common/getters'; import { ApiError } from '../../error'; import { Users } from '@/models/index'; diff --git a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts index 69550f96de..ea851458d2 100644 --- a/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/reactions/delete.ts @@ -1,7 +1,7 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; import define from '../../../define'; -import * as ms from 'ms'; +import ms from 'ms'; import deleteReaction from '@/services/note/reaction/delete'; import { getNote } from '../../../common/getters'; import { ApiError } from '../../../error'; diff --git a/packages/backend/src/server/api/endpoints/notes/unrenote.ts b/packages/backend/src/server/api/endpoints/notes/unrenote.ts index dce43d9d9c..d3fba66095 100644 --- a/packages/backend/src/server/api/endpoints/notes/unrenote.ts +++ b/packages/backend/src/server/api/endpoints/notes/unrenote.ts @@ -2,7 +2,7 @@ import $ from 'cafy'; import { ID } from '@/misc/cafy-id'; import deleteNote from '@/services/note/delete'; import define from '../../define'; -import * as ms from 'ms'; +import ms from 'ms'; import { getNote } from '../../common/getters'; import { ApiError } from '../../error'; import { Notes, Users } from '@/models/index'; diff --git a/packages/backend/src/server/api/endpoints/pages/create.ts b/packages/backend/src/server/api/endpoints/pages/create.ts index c23978f093..0ec287c592 100644 --- a/packages/backend/src/server/api/endpoints/pages/create.ts +++ b/packages/backend/src/server/api/endpoints/pages/create.ts @@ -1,5 +1,5 @@ import $ from 'cafy'; -import * as ms from 'ms'; +import ms from 'ms'; import define from '../../define'; import { ID } from '@/misc/cafy-id'; import { Pages, DriveFiles } from '@/models/index'; diff --git a/packages/backend/src/server/api/endpoints/pages/update.ts b/packages/backend/src/server/api/endpoints/pages/update.ts index b3a7f26963..4aaf2aed5d 100644 --- a/packages/backend/src/server/api/endpoints/pages/update.ts +++ b/packages/backend/src/server/api/endpoints/pages/update.ts @@ -1,5 +1,5 @@ import $ from 'cafy'; -import * as ms from 'ms'; +import ms from 'ms'; import define from '../../define'; import { ApiError } from '../../error'; import { Pages, DriveFiles } from '@/models/index'; diff --git a/packages/backend/src/server/api/endpoints/request-reset-password.ts b/packages/backend/src/server/api/endpoints/request-reset-password.ts index f9928c2ee6..7bb50bf6a6 100644 --- a/packages/backend/src/server/api/endpoints/request-reset-password.ts +++ b/packages/backend/src/server/api/endpoints/request-reset-password.ts @@ -3,7 +3,7 @@ import { publishMainStream } from '@/services/stream'; import define from '../define'; import rndstr from 'rndstr'; import config from '@/config/index'; -import * as ms from 'ms'; +import ms from 'ms'; import { Users, UserProfiles, PasswordResetRequests } from '@/models/index'; import { sendEmail } from '@/services/send-email'; import { ApiError } from '../error'; diff --git a/packages/backend/src/server/api/endpoints/users/recommendation.ts b/packages/backend/src/server/api/endpoints/users/recommendation.ts index dde6bb1037..7c775c4dcf 100644 --- a/packages/backend/src/server/api/endpoints/users/recommendation.ts +++ b/packages/backend/src/server/api/endpoints/users/recommendation.ts @@ -1,4 +1,4 @@ -import * as ms from 'ms'; +import ms from 'ms'; import $ from 'cafy'; import define from '../../define'; import { Users, Followings } from '@/models/index'; diff --git a/packages/backend/src/server/api/endpoints/users/report-abuse.ts b/packages/backend/src/server/api/endpoints/users/report-abuse.ts index 2c8672cd47..a1d8376651 100644 --- a/packages/backend/src/server/api/endpoints/users/report-abuse.ts +++ b/packages/backend/src/server/api/endpoints/users/report-abuse.ts @@ -1,4 +1,5 @@ import $ from 'cafy'; +import * as sanitizeHtml from 'sanitize-html'; import { ID } from '@/misc/cafy-id'; import define from '../../define'; import { publishAdminStream } from '@/services/stream'; @@ -6,6 +7,8 @@ import { ApiError } from '../../error'; import { getUser } from '../../common/getters'; import { AbuseUserReports, Users } from '@/models/index'; import { genId } from '@/misc/gen-id'; +import { sendEmail } from '@/services/send-email'; +import { fetchMeta } from '@/misc/fetch-meta'; export const meta = { tags: ['users'], @@ -26,23 +29,24 @@ export const meta = { noSuchUser: { message: 'No such user.', code: 'NO_SUCH_USER', - id: '1acefcb5-0959-43fd-9685-b48305736cb5' + id: '1acefcb5-0959-43fd-9685-b48305736cb5', }, cannotReportYourself: { message: 'Cannot report yourself.', code: 'CANNOT_REPORT_YOURSELF', - id: '1e13149e-b1e8-43cf-902e-c01dbfcb202f' + id: '1e13149e-b1e8-43cf-902e-c01dbfcb202f', }, cannotReportAdmin: { message: 'Cannot report the admin.', code: 'CANNOT_REPORT_THE_ADMIN', - id: '35e166f5-05fb-4f87-a2d5-adb42676d48f' - } - } + id: '35e166f5-05fb-4f87-a2d5-adb42676d48f', + }, + }, }; +// eslint-disable-next-line import/no-default-export export default define(meta, async (ps, me) => { // Lookup user const user = await getUser(ps.userId).catch(e => { @@ -72,10 +76,10 @@ export default define(meta, async (ps, me) => { setTimeout(async () => { const moderators = await Users.find({ where: [{ - isAdmin: true + isAdmin: true, }, { - isModerator: true - }] + isModerator: true, + }], }); for (const moderator of moderators) { @@ -83,8 +87,15 @@ export default define(meta, async (ps, me) => { id: report.id, targetUserId: report.targetUserId, reporterId: report.reporterId, - comment: report.comment + comment: report.comment, }); } + + const meta = await fetchMeta(); + if (meta.email) { + sendEmail(meta.email, 'New abuse report', + sanitizeHtml(ps.comment), + sanitizeHtml(ps.comment)); + } }, 1); }); diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts index fc95a36a87..d80d73f252 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -3,7 +3,7 @@ */ import { dirname } from 'path'; -import * as ms from 'ms'; +import ms from 'ms'; import * as Koa from 'koa'; import * as Router from '@koa/router'; import * as send from 'koa-send'; diff --git a/packages/backend/src/services/send-email.ts b/packages/backend/src/services/send-email.ts index d24168ec46..f5f36148f6 100644 --- a/packages/backend/src/services/send-email.ts +++ b/packages/backend/src/services/send-email.ts @@ -21,8 +21,8 @@ export async function sendEmail(to: string, subject: string, html: string, text: proxy: config.proxySmtp, auth: enableAuth ? { user: meta.smtpUser, - pass: meta.smtpPass - } : undefined + pass: meta.smtpPass, + } : undefined, } as any); try { @@ -33,86 +33,85 @@ export async function sendEmail(to: string, subject: string, html: string, text: subject: subject, text: text, html: ` - -
- -