Compare commits
47 Commits
Author | SHA1 | Date | |
---|---|---|---|
2870a7e463 | |||
65e5cfa68e | |||
10e59957d1 | |||
4f74373df3 | |||
2d414bbf86 | |||
a199969b81 | |||
3aef5e6748 | |||
2b536a7443 | |||
20fe68de05 | |||
c7684b59de | |||
a7237d157a | |||
35f91fa280 | |||
299ac32225 | |||
a038738d72 | |||
2b0a919fb5 | |||
946c706913 | |||
89b5d976ee | |||
6f679bb6b4 | |||
db4e7b0e16 | |||
9ca942490d | |||
ebcf249c8b | |||
939c487503 | |||
981a8b267e | |||
9531da80a0 | |||
e1109b168c | |||
b7c70039aa | |||
17b6f6cf2a | |||
dd88483ba4 | |||
0ff27f65b3 | |||
b1655740df | |||
6d562aece1 | |||
2182c3372b | |||
d3331bfe82 | |||
cfc4a2e8b4 | |||
36c41c8eb3 | |||
d255157e6e | |||
c12e07277d | |||
06b4fb5095 | |||
8fafdcb428 | |||
537a606bb6 | |||
3dc7a4463c | |||
fd6ff05b60 | |||
1a159e41b8 | |||
23533cdd16 | |||
2f598b8fa1 | |||
bca349fec1 | |||
719fac6480 |
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "詳細"
|
||||
copy-link: "リンクをコピー"
|
||||
favorite: "お気に入り"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "ピン留め"
|
||||
unpin: "ピン留め解除"
|
||||
delete: "削除"
|
||||
|
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "詳細"
|
||||
copy-link: "リンクをコピー"
|
||||
favorite: "Diese Anmerkung favorisieren"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "An die Profilseite pinnen"
|
||||
unpin: "ピン留め解除"
|
||||
delete: "Löschen"
|
||||
|
@ -265,40 +265,40 @@ common/views/components/media-banner.vue:
|
||||
sensitive: "NSFW"
|
||||
click-to-show: "Click to show"
|
||||
common/views/components/theme.vue:
|
||||
light-theme: "非ダークモード時に使用するテーマ"
|
||||
dark-theme: "ダークモード時に使用するテーマ"
|
||||
light-themes: "明るいテーマ"
|
||||
dark-themes: "暗いテーマ"
|
||||
install-a-theme: "テーマのインストール"
|
||||
theme-code: "テーマコード"
|
||||
install: "インストール"
|
||||
installed: "「{}」をインストールしました"
|
||||
create-a-theme: "テーマの作成"
|
||||
save-created-theme: "テーマを保存"
|
||||
primary-color: "プライマリ カラー"
|
||||
secondary-color: "セカンダリ カラー"
|
||||
text-color: "文字色"
|
||||
base-theme: "ベーステーマ"
|
||||
light-theme: "Theme during non-dark mode"
|
||||
dark-theme: "Theme during dark mode"
|
||||
light-themes: "Light theme"
|
||||
dark-themes: "Dark theme"
|
||||
install-a-theme: "Install a theme"
|
||||
theme-code: "Theme code"
|
||||
install: "Install"
|
||||
installed: "\"{}\" has been installed"
|
||||
create-a-theme: "Create a theme"
|
||||
save-created-theme: "Save a theme"
|
||||
primary-color: "Primary color"
|
||||
secondary-color: "Secondary color"
|
||||
text-color: "Text color"
|
||||
base-theme: "Base theme"
|
||||
base-theme-light: "Light"
|
||||
base-theme-dark: "Dark"
|
||||
theme-name: "テーマ名"
|
||||
preview-created-theme: "プレビュー"
|
||||
invalid-theme: "テーマが正しくありません。"
|
||||
already-installed: "既にそのテーマはインストールされています。"
|
||||
saved: "保存しました"
|
||||
manage-themes: "テーマの管理"
|
||||
builtin-themes: "標準テーマ"
|
||||
my-themes: "マイテーマ"
|
||||
installed-themes: "インストールされたテーマ"
|
||||
select-theme: "テーマを選択してください"
|
||||
uninstall: "アンインストール"
|
||||
uninstalled: "「{}」をアンインストールしました"
|
||||
author: "作者"
|
||||
desc: "説明"
|
||||
export: "エクスポート"
|
||||
import: "インポート"
|
||||
import-by-code: "またはコードをペースト"
|
||||
theme-name-required: "テーマ名は必須です。"
|
||||
theme-name: "Theme name"
|
||||
preview-created-theme: "Preview"
|
||||
invalid-theme: "Not valid theme"
|
||||
already-installed: "This theme is already installed."
|
||||
saved: "Saved"
|
||||
manage-themes: "Themes manager"
|
||||
builtin-themes: "Standard themes"
|
||||
my-themes: "My themes"
|
||||
installed-themes: "Installed themes"
|
||||
select-theme: "Select your theme"
|
||||
uninstall: "Uninstall"
|
||||
uninstalled: "\"{}\" has been uninstalled"
|
||||
author: "Author"
|
||||
desc: "Description"
|
||||
export: "Export"
|
||||
import: "Import"
|
||||
import-by-code: "or paste code"
|
||||
theme-name-required: "Theme name is required"
|
||||
common/views/components/cw-button.vue:
|
||||
hide: "Hide"
|
||||
show: "See more"
|
||||
@ -335,8 +335,9 @@ common/views/components/note-menu.vue:
|
||||
detail: "Details"
|
||||
copy-link: "Copy link"
|
||||
favorite: "Favorite this note"
|
||||
unfavorite: "Unfavorite"
|
||||
pin: "Pin to your profile"
|
||||
unpin: "ピン留め解除"
|
||||
unpin: "Unpin"
|
||||
delete: "Delete"
|
||||
delete-confirm: "Delete this post?"
|
||||
remote: "Show original note"
|
||||
@ -514,13 +515,13 @@ desktop/views/components/charts.vue:
|
||||
notes: "The number of posts: increase/decrease (Combined)"
|
||||
local-notes: "The number of posts: increase/decrease (Local)"
|
||||
remote-notes: "The number of posts: increase/decrease (Remote)"
|
||||
notes-total: "投稿の積算"
|
||||
notes-total: "Total posts"
|
||||
users: "The number of users: increase/decrease"
|
||||
users-total: "ユーザーの積算"
|
||||
users-total: "Total users"
|
||||
drive: "Capacity used as the storage: increase/decrease"
|
||||
drive-total: "ドライブ使用量の積算"
|
||||
drive-total: "Total usage of Drive"
|
||||
drive-files: "The number of files on the storage: increase/decrease"
|
||||
drive-files-total: "ドライブのファイル数の積算"
|
||||
drive-files-total: "Total number of files on Drive"
|
||||
network-requests: "Requests"
|
||||
network-time: "Response time"
|
||||
network-usage: "Traffic"
|
||||
@ -730,8 +731,8 @@ desktop/views/components/settings.vue:
|
||||
choose-wallpaper: "Choose a background"
|
||||
delete-wallpaper: "Remove background"
|
||||
dark-mode: "Dark Mode"
|
||||
use-shadow: "UIに影を使用"
|
||||
rounded-corners: "UIの角を丸める"
|
||||
use-shadow: "Use shadows in the UI"
|
||||
rounded-corners: "Round corners of UI"
|
||||
circle-icons: "Use circle icons"
|
||||
contrasted-acct: "Add contrast to username"
|
||||
post-form-on-timeline: "Display post form at the top of the timeline"
|
||||
|
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "Detalles"
|
||||
copy-link: "Copiar enlace"
|
||||
favorite: "Me gusta esta nota"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "Fijar en el perfil"
|
||||
unpin: "ピン留め解除"
|
||||
delete: "Borrar"
|
||||
|
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "Détails"
|
||||
copy-link: "Copier le lien"
|
||||
favorite: "Mettre cette note en favoris"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "Épingler sur votre profil"
|
||||
unpin: "Désépingler"
|
||||
delete: "Supprimer"
|
||||
|
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "詳細"
|
||||
copy-link: "リンクをコピー"
|
||||
favorite: "お気に入り"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "ピン留め"
|
||||
unpin: "ピン留め解除"
|
||||
delete: "削除"
|
||||
|
@ -363,6 +363,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "詳細"
|
||||
copy-link: "リンクをコピー"
|
||||
favorite: "お気に入り"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "ピン留め"
|
||||
unpin: "ピン留め解除"
|
||||
delete: "削除"
|
||||
@ -937,6 +938,7 @@ desktop/views/components/settings.profile.vue:
|
||||
save: "保存"
|
||||
locked-account: "アカウントの保護"
|
||||
is-locked: "フォローを承認制にする"
|
||||
careful-bot: "Botからのフォローだけ承認制にする"
|
||||
other: "その他"
|
||||
is-bot: "このアカウントはBotです"
|
||||
is-cat: "このアカウントはCatです"
|
||||
@ -1419,6 +1421,7 @@ mobile/views/pages/settings/settings.profile.vue:
|
||||
banner: "バナー"
|
||||
is-cat: "このアカウントはCatです"
|
||||
is-locked: "フォローを承認制にする"
|
||||
careful-bot: "Botからのフォローだけ承認制にする"
|
||||
advanced: "その他"
|
||||
privacy: "プライバシー"
|
||||
save: "保存"
|
||||
|
@ -265,40 +265,40 @@ common/views/components/media-banner.vue:
|
||||
sensitive: "見せたらあかん"
|
||||
click-to-show: "押してみ、見せたるわ"
|
||||
common/views/components/theme.vue:
|
||||
light-theme: "非ダークモード時に使用するテーマ"
|
||||
dark-theme: "ダークモード時に使用するテーマ"
|
||||
light-themes: "明るいテーマ"
|
||||
dark-themes: "暗いテーマ"
|
||||
install-a-theme: "テーマのインストール"
|
||||
light-theme: "ナイトゲームちゃう時のテーマどないする?"
|
||||
dark-theme: "ナイトゲームの時のテーマどないする?"
|
||||
light-themes: "デイゲーム"
|
||||
dark-themes: "ナイトゲーム"
|
||||
install-a-theme: "テーマ入れるで"
|
||||
theme-code: "テーマコード"
|
||||
install: "インストール"
|
||||
installed: "「{}」をインストールしました"
|
||||
create-a-theme: "テーマの作成"
|
||||
save-created-theme: "テーマを保存"
|
||||
primary-color: "プライマリ カラー"
|
||||
secondary-color: "セカンダリ カラー"
|
||||
text-color: "文字色"
|
||||
base-theme: "ベーステーマ"
|
||||
installed: "「{}」を入れたで!"
|
||||
create-a-theme: "テーマ作る"
|
||||
save-created-theme: "テーマ保存"
|
||||
primary-color: "この色一番重要や"
|
||||
secondary-color: "次はこの色出したって"
|
||||
text-color: "文字はこの色や!"
|
||||
base-theme: "この色が背景や!"
|
||||
base-theme-light: "Light"
|
||||
base-theme-dark: "Dark"
|
||||
theme-name: "テーマ名"
|
||||
preview-created-theme: "プレビュー"
|
||||
invalid-theme: "テーマが正しくありません。"
|
||||
already-installed: "既にそのテーマはインストールされています。"
|
||||
saved: "保存しました"
|
||||
preview-created-theme: "試してみる"
|
||||
invalid-theme: "このテーマあかんわ、なんか間違うとる"
|
||||
already-installed: "このテーマもうあるで"
|
||||
saved: "保存したで!"
|
||||
manage-themes: "テーマの管理"
|
||||
builtin-themes: "標準テーマ"
|
||||
my-themes: "マイテーマ"
|
||||
installed-themes: "インストールされたテーマ"
|
||||
select-theme: "テーマを選択してください"
|
||||
uninstall: "アンインストール"
|
||||
uninstalled: "「{}」をアンインストールしました"
|
||||
author: "作者"
|
||||
builtin-themes: "いつものテーマ"
|
||||
my-themes: "ワイのテーマ"
|
||||
installed-themes: "入れたテーマ"
|
||||
select-theme: "テーマ選んでや!"
|
||||
uninstall: "ほかす"
|
||||
uninstalled: "「{}」をほかしてもうたわ"
|
||||
author: "作った人"
|
||||
desc: "説明"
|
||||
export: "エクスポート"
|
||||
import: "インポート"
|
||||
import-by-code: "またはコードをペースト"
|
||||
theme-name-required: "テーマ名は必須です。"
|
||||
import-by-code: "それかコードを貼っつける"
|
||||
theme-name-required: "テーマ名は絶対要るで"
|
||||
common/views/components/cw-button.vue:
|
||||
hide: "もうええわ"
|
||||
show: "見たいやろ?"
|
||||
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "もっと"
|
||||
copy-link: "リンクをコピー"
|
||||
favorite: "お気に入り"
|
||||
unfavorite: "お気に入りやめる"
|
||||
pin: "ピン留め"
|
||||
unpin: "ピン留めやめる"
|
||||
delete: "ほかす"
|
||||
@ -475,7 +476,7 @@ common/views/pages/follow.vue:
|
||||
following: "フォローしとる"
|
||||
follow: "フォロー"
|
||||
request-pending: "フォローの許し待っとる"
|
||||
follow-processing: "フォロー処理中"
|
||||
follow-processing: "今フォロー処理やっとる‥"
|
||||
follow-request: "フォロー許してくれや!言うてみる"
|
||||
desktop:
|
||||
banner-crop-title: "どこバナーとして出す?"
|
||||
@ -602,7 +603,7 @@ desktop/views/components/follow-button.vue:
|
||||
following: "フォローしとる"
|
||||
follow: "フォロー"
|
||||
request-pending: "フォローの許し待っとる"
|
||||
follow-processing: "フォロー処理中"
|
||||
follow-processing: "今フォロー処理やっとる‥"
|
||||
follow-request: "フォロー許してくれや!言うてみる"
|
||||
desktop/views/components/followers-window.vue:
|
||||
followers: "{} のフォロワー"
|
||||
@ -1083,7 +1084,7 @@ mobile/views/components/follow-button.vue:
|
||||
following: "フォローしとる"
|
||||
follow: "フォロー"
|
||||
request-pending: "フォローの許し待っとる"
|
||||
follow-processing: "フォロー処理中"
|
||||
follow-processing: "今フォロー処理やっとる‥"
|
||||
follow-request: "フォロー許してくれや!言うてみる"
|
||||
mobile/views/components/friends-maker.vue:
|
||||
title: "おもろそうやな"
|
||||
@ -1223,9 +1224,9 @@ mobile/views/pages/settings/settings.profile.vue:
|
||||
avatar: "アイコン"
|
||||
banner: "バナー"
|
||||
is-cat: "このアカウントはCatや"
|
||||
is-locked: "他人のフォローは許してからや!"
|
||||
is-locked: "他人のフォローは許可してからや!"
|
||||
advanced: "その他"
|
||||
privacy: "プライバシー⇔オカンの年齢"
|
||||
privacy: "プライバシーってなんや?オカンの年齢か?"
|
||||
save: "保存"
|
||||
saved: "プロフィールを保存したで"
|
||||
uploading: "アップロードしとるで…"
|
||||
@ -1245,7 +1246,7 @@ mobile/views/pages/settings.vue:
|
||||
specify-language: "言語選びや"
|
||||
design: "見た感じ"
|
||||
dark-mode: "ナイトゲームや!"
|
||||
i-am-under-limited-internet: "電波がバァーっといけへんねん"
|
||||
i-am-under-limited-internet: "電波と阪神がザコいんや"
|
||||
circle-icons: "アイコンもタコ焼きも丸いやんな?"
|
||||
contrasted-acct: "ユーザー名ようわからんし見やすしといて"
|
||||
timeline: "タイムライン"
|
||||
@ -1257,8 +1258,8 @@ mobile/views/pages/settings.vue:
|
||||
post-style-standard: "標準"
|
||||
post-style-smart: "べっぴんさん"
|
||||
notification-position: "通知どこ見せる?"
|
||||
notification-position-bottom: "ミナミ"
|
||||
notification-position-top: "キタ"
|
||||
notification-position-bottom: "ミナミの方"
|
||||
notification-position-top: "キタの方"
|
||||
theme: "テーマ"
|
||||
behavior: "動き"
|
||||
fetch-on-scroll: "スクロールしたらもっと見せてや"
|
||||
|
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "詳細"
|
||||
copy-link: "링크 복사"
|
||||
favorite: "お気に入り"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "ピン留め"
|
||||
unpin: "ピン留め解除"
|
||||
delete: "削除"
|
||||
|
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "詳細"
|
||||
copy-link: "リンクをコピー"
|
||||
favorite: "Deze notitie toevoegen aan favorieten"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "Vastmaken aan profielpagina"
|
||||
unpin: "ピン留め解除"
|
||||
delete: "削除"
|
||||
|
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "Detaljer"
|
||||
copy-link: "リンクをコピー"
|
||||
favorite: "Merket som favoritt"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "Fest til profilen din"
|
||||
unpin: "ピン留め解除"
|
||||
delete: "Slett"
|
||||
|
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "詳細"
|
||||
copy-link: "リンクをコピー"
|
||||
favorite: "Dodaj do ulubionych"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "Przypnij do profilu"
|
||||
unpin: "ピン留め解除"
|
||||
delete: "Usuń"
|
||||
|
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "詳細"
|
||||
copy-link: "リンクをコピー"
|
||||
favorite: "お気に入り"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "ピン留め"
|
||||
unpin: "ピン留め解除"
|
||||
delete: "削除"
|
||||
|
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "詳細"
|
||||
copy-link: "リンクをコピー"
|
||||
favorite: "お気に入り"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "ピン留め"
|
||||
unpin: "ピン留め解除"
|
||||
delete: "削除"
|
||||
|
@ -335,6 +335,7 @@ common/views/components/note-menu.vue:
|
||||
detail: "詳細"
|
||||
copy-link: "リンクをコピー"
|
||||
favorite: "お気に入り"
|
||||
unfavorite: "お気に入り解除"
|
||||
pin: "ピン留め"
|
||||
unpin: "ピン留め解除"
|
||||
delete: "削除"
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"author": "syuilo <i@syuilo.com>",
|
||||
"version": "10.10.1",
|
||||
"clientVersion": "1.0.10469",
|
||||
"version": "10.13.0",
|
||||
"clientVersion": "1.0.10517",
|
||||
"codename": "nighthike",
|
||||
"main": "./built/index.js",
|
||||
"private": true,
|
||||
@ -176,7 +176,7 @@
|
||||
"qrcode": "1.3.0",
|
||||
"ratelimiter": "3.2.0",
|
||||
"recaptcha-promise": "0.1.3",
|
||||
"reconnecting-websocket": "4.1.5",
|
||||
"reconnecting-websocket": "4.1.8",
|
||||
"redis": "2.8.0",
|
||||
"request": "2.88.0",
|
||||
"request-promise-native": "1.0.5",
|
||||
|
@ -142,7 +142,7 @@
|
||||
localStorage.setItem('shouldFlush', 'false');
|
||||
|
||||
// Random
|
||||
localStorage.setItem('salt', Math.random().toString());
|
||||
localStorage.setItem('salt', Math.random().toString().substr(2, 8));
|
||||
|
||||
// Clear cache (service worker)
|
||||
try {
|
||||
|
@ -1,7 +1,8 @@
|
||||
import parse from '../../../../mfm/parse';
|
||||
import { sum } from '../../../../prelude/array';
|
||||
import MkNoteMenu from '..//views/components/note-menu.vue';
|
||||
import MkNoteMenu from '../views/components/note-menu.vue';
|
||||
import MkReactionPicker from '../views/components/reaction-picker.vue';
|
||||
import Ok from '../views/components/ok.vue';
|
||||
|
||||
function focus(el, fn) {
|
||||
const target = fn(el);
|
||||
@ -31,6 +32,8 @@ export default (opts: Opts = {}) => ({
|
||||
'r|left': () => this.reply(true),
|
||||
'e|a|plus': () => this.react(true),
|
||||
'q|right': () => this.renote(true),
|
||||
'f|b': this.favorite,
|
||||
'delete|ctrl+d': this.del,
|
||||
'ctrl+q|ctrl+right': this.renoteDirectly,
|
||||
'up|k|shift+tab': this.focusBefore,
|
||||
'down|j|tab': this.focusAfter,
|
||||
@ -129,6 +132,20 @@ export default (opts: Opts = {}) => ({
|
||||
});
|
||||
},
|
||||
|
||||
favorite() {
|
||||
(this as any).api('notes/favorites/create', {
|
||||
noteId: this.appearNote.id
|
||||
}).then(() => {
|
||||
(this as any).os.new(Ok);
|
||||
});
|
||||
},
|
||||
|
||||
del() {
|
||||
(this as any).api('notes/delete', {
|
||||
noteId: this.appearNote.id
|
||||
});
|
||||
},
|
||||
|
||||
menu(viaKeyboard = false) {
|
||||
(this as any).os.new(MkNoteMenu, {
|
||||
source: this.$refs.menuButton,
|
||||
|
@ -156,7 +156,7 @@ class Pool {
|
||||
this.channel = channel;
|
||||
this.stream = stream;
|
||||
|
||||
this.id = Math.random().toString();
|
||||
this.id = Math.random().toString().substr(2, 8);
|
||||
|
||||
this.stream.on('_disconnected_', this.onStreamDisconnected);
|
||||
}
|
||||
@ -275,7 +275,7 @@ class NonSharedConnection extends Connection {
|
||||
super(stream, channel);
|
||||
|
||||
this.params = params;
|
||||
this.id = Math.random().toString();
|
||||
this.id = Math.random().toString().substr(2, 8);
|
||||
|
||||
this.connect();
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ export default Vue.extend({
|
||||
max-width 600px
|
||||
margin 0 auto
|
||||
padding 0
|
||||
//background rgba(var(--face), 0.95)
|
||||
background var(--messagingRoomBg)
|
||||
background-clip content-box
|
||||
|
||||
> .new-message
|
||||
|
@ -22,12 +22,34 @@ export default Vue.extend({
|
||||
icon: '%fa:link%',
|
||||
text: '%i18n:@copy-link%',
|
||||
action: this.copyLink
|
||||
}, null, {
|
||||
icon: '%fa:star%',
|
||||
text: '%i18n:@favorite%',
|
||||
action: this.favorite
|
||||
}];
|
||||
|
||||
if (this.note.uri) {
|
||||
items.push({
|
||||
icon: '%fa:external-link-square-alt%',
|
||||
text: '%i18n:@remote%',
|
||||
action: () => {
|
||||
window.open(this.note.uri, '_blank');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
items.push(null);
|
||||
|
||||
if (this.note.isFavorited) {
|
||||
items.push({
|
||||
icon: '%fa:star%',
|
||||
text: '%i18n:@unfavorite%',
|
||||
action: this.unfavorite
|
||||
});
|
||||
} else {
|
||||
items.push({
|
||||
icon: '%fa:star%',
|
||||
text: '%i18n:@favorite%',
|
||||
action: this.favorite
|
||||
});
|
||||
}
|
||||
|
||||
if (this.note.userId == this.$store.state.i.id) {
|
||||
if ((this.$store.state.i.pinnedNoteIds || []).includes(this.note.id)) {
|
||||
items.push({
|
||||
@ -45,6 +67,7 @@ export default Vue.extend({
|
||||
}
|
||||
|
||||
if (this.note.userId == this.$store.state.i.id || this.$store.state.i.isAdmin) {
|
||||
items.push(null);
|
||||
items.push({
|
||||
icon: '%fa:trash-alt R%',
|
||||
text: '%i18n:@delete%',
|
||||
@ -52,16 +75,6 @@ export default Vue.extend({
|
||||
});
|
||||
}
|
||||
|
||||
if (this.note.uri) {
|
||||
items.push({
|
||||
icon: '%fa:external-link-square-alt%',
|
||||
text: '%i18n:@remote%',
|
||||
action: () => {
|
||||
window.open(this.note.uri, '_blank');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
},
|
||||
@ -110,6 +123,15 @@ export default Vue.extend({
|
||||
});
|
||||
},
|
||||
|
||||
unfavorite() {
|
||||
(this as any).api('notes/favorites/delete', {
|
||||
noteId: this.note.id
|
||||
}).then(() => {
|
||||
(this as any).os.new(Ok);
|
||||
this.destroyDom();
|
||||
});
|
||||
},
|
||||
|
||||
closed() {
|
||||
this.$nextTick(() => {
|
||||
this.destroyDom();
|
||||
|
@ -114,7 +114,7 @@ export default define({
|
||||
this.connection.on('stats', this.onStats);
|
||||
this.connection.on('statsLog', this.onStatsLog);
|
||||
this.connection.send('requestLog',{
|
||||
id: Math.random().toString()
|
||||
id: Math.random().toString().substr(2, 8)
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
@ -92,7 +92,7 @@ export default Vue.extend({
|
||||
this.connection.on('stats', this.onStats);
|
||||
this.connection.on('statsLog', this.onStatsLog);
|
||||
this.connection.send('requestLog', {
|
||||
id: Math.random().toString()
|
||||
id: Math.random().toString().substr(2, 8)
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
@ -9,14 +9,14 @@ export default (os: OS) => opts => {
|
||||
note: o.renote,
|
||||
animation: o.animation == null ? true : o.animation
|
||||
});
|
||||
if (opts.cb) vm.$once('closed', opts.cb);
|
||||
if (o.cb) vm.$once('closed', o.cb);
|
||||
document.body.appendChild(vm.$el);
|
||||
} else {
|
||||
const vm = os.new(PostFormWindow, {
|
||||
reply: o.reply,
|
||||
animation: o.animation == null ? true : o.animation
|
||||
});
|
||||
if (opts.cb) vm.$once('closed', opts.cb);
|
||||
if (o.cb) vm.$once('closed', o.cb);
|
||||
document.body.appendChild(vm.$el);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@
|
||||
<mk-url-preview v-for="url in urls" :url="url" :key="url"/>
|
||||
</div>
|
||||
</div>
|
||||
<footer v-if="appearNote.deletedAt == null">
|
||||
<footer>
|
||||
<mk-reactions-viewer :note="appearNote" ref="reactionsViewer"/>
|
||||
<button class="replyButton" @click="reply()" title="%i18n:@reply%">
|
||||
<template v-if="appearNote.reply">%fa:reply-all%</template>
|
||||
|
@ -21,12 +21,13 @@
|
||||
<ui-button primary @click="save">%i18n:@save%</ui-button>
|
||||
<section>
|
||||
<h2>%i18n:@locked-account%</h2>
|
||||
<ui-switch v-model="$store.state.i.isLocked" @change="onChangeIsLocked">%i18n:@is-locked%</ui-switch>
|
||||
<ui-switch v-model="isLocked" @change="save(false)">%i18n:@is-locked%</ui-switch>
|
||||
<ui-switch v-model="carefulBot" @change="save(false)">%i18n:@careful-bot%</ui-switch>
|
||||
</section>
|
||||
<section>
|
||||
<h2>%i18n:@other%</h2>
|
||||
<ui-switch v-model="$store.state.i.isBot" @change="onChangeIsBot">%i18n:@is-bot%</ui-switch>
|
||||
<ui-switch v-model="$store.state.i.isCat" @change="onChangeIsCat">%i18n:@is-cat%</ui-switch>
|
||||
<ui-switch v-model="isBot" @change="save(false)">%i18n:@is-bot%</ui-switch>
|
||||
<ui-switch v-model="isCat" @change="save(false)">%i18n:@is-cat%</ui-switch>
|
||||
<ui-switch v-model="alwaysMarkNsfw">%i18n:common.always-mark-nsfw%</ui-switch>
|
||||
</section>
|
||||
</div>
|
||||
@ -42,6 +43,10 @@ export default Vue.extend({
|
||||
location: null,
|
||||
description: null,
|
||||
birthday: null,
|
||||
isBot: false,
|
||||
isCat: false,
|
||||
isLocked: false,
|
||||
carefulBot: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -55,34 +60,29 @@ export default Vue.extend({
|
||||
this.location = this.$store.state.i.profile.location;
|
||||
this.description = this.$store.state.i.description;
|
||||
this.birthday = this.$store.state.i.profile.birthday;
|
||||
this.isCat = this.$store.state.i.isCat;
|
||||
this.isBot = this.$store.state.i.isBot;
|
||||
this.isLocked = this.$store.state.i.isLocked;
|
||||
this.carefulBot = this.$store.state.i.carefulBot;
|
||||
},
|
||||
methods: {
|
||||
updateAvatar() {
|
||||
(this as any).apis.updateAvatar();
|
||||
},
|
||||
save() {
|
||||
save(notify) {
|
||||
(this as any).api('i/update', {
|
||||
name: this.name || null,
|
||||
location: this.location || null,
|
||||
description: this.description || null,
|
||||
birthday: this.birthday || null
|
||||
birthday: this.birthday || null,
|
||||
isCat: this.isCat,
|
||||
isBot: this.isBot,
|
||||
isLocked: this.isLocked,
|
||||
carefulBot: this.carefulBot
|
||||
}).then(() => {
|
||||
(this as any).apis.notify('%i18n:@profile-updated%');
|
||||
});
|
||||
},
|
||||
onChangeIsLocked() {
|
||||
(this as any).api('i/update', {
|
||||
isLocked: this.$store.state.i.isLocked
|
||||
});
|
||||
},
|
||||
onChangeIsBot() {
|
||||
(this as any).api('i/update', {
|
||||
isBot: this.$store.state.i.isBot
|
||||
});
|
||||
},
|
||||
onChangeIsCat() {
|
||||
(this as any).api('i/update', {
|
||||
isCat: this.$store.state.i.isCat
|
||||
if (notify) {
|
||||
(this as any).apis.notify('%i18n:@profile-updated%');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
<li @click="list">
|
||||
<p>%fa:list%<span>%i18n:@lists%</span>%fa:angle-right%</p>
|
||||
</li>
|
||||
<li @click="followRequests" v-if="$store.state.i.isLocked">
|
||||
<li @click="followRequests" v-if="($store.state.i.isLocked || $store.state.i.carefulBot)">
|
||||
<p>%fa:envelope R%<span>%i18n:@follow-requests%<i v-if="$store.state.i.pendingReceivedFollowRequestsCount">{{ $store.state.i.pendingReceivedFollowRequestsCount }}</i></span>%fa:angle-right%</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -78,7 +78,7 @@ export default Vue.extend({
|
||||
this.connection.on('stats', this.onStats);
|
||||
this.connection.on('statsLog', this.onStatsLog);
|
||||
this.connection.send('requestLog', {
|
||||
id: Math.random().toString(),
|
||||
id: Math.random().toString().substr(2, 8),
|
||||
length: 200
|
||||
});
|
||||
},
|
||||
|
@ -8,8 +8,6 @@
|
||||
<div>
|
||||
<span class="username"><mk-acct :user="user" :detail="true" /></span>
|
||||
<span v-if="user.isBot" title="%i18n:@is-bot%">%fa:robot%</span>
|
||||
<span class="location" v-if="user.host === null && user.profile.location">%fa:map-marker% {{ user.profile.location }}</span>
|
||||
<span class="birthday" v-if="user.host === null && user.profile.birthday">%fa:birthday-cake% {{ user.profile.birthday.replace('-', '年').replace('-', '月') + '日' }} ({{ age }}歳)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -18,6 +16,10 @@
|
||||
<div class="description">
|
||||
<misskey-flavored-markdown v-if="user.description" :text="user.description" :i="$store.state.i"/>
|
||||
</div>
|
||||
<div class="info">
|
||||
<span class="location" v-if="user.host === null && user.profile.location">%fa:map-marker% {{ user.profile.location }}</span>
|
||||
<span class="birthday" v-if="user.host === null && user.profile.birthday">%fa:birthday-cake% {{ user.profile.birthday.replace('-', '年').replace('-', '月') + '日' }} ({{ age }}歳)</span>
|
||||
</div>
|
||||
<div class="status">
|
||||
<span class="notes-count"><b>{{ user.notesCount | number }}</b>%i18n:@posts%</span>
|
||||
<span class="following clickable" @click="showFollowing"><b>{{ user.followingCount | number }}</b>%i18n:@following%</span>
|
||||
@ -182,6 +184,14 @@ export default Vue.extend({
|
||||
padding 16px 16px 16px 154px
|
||||
color var(--text)
|
||||
|
||||
> .info
|
||||
margin-top 16px
|
||||
padding-top 16px
|
||||
border-top solid 1px var(--faceDivider)
|
||||
|
||||
> *
|
||||
margin-right 16px
|
||||
|
||||
> .status
|
||||
margin-top 16px
|
||||
padding-top 16px
|
||||
|
@ -446,7 +446,7 @@ export default class MiOS extends EventEmitter {
|
||||
const viaStream = this.stream && this.store.state.device.apiViaStream && !forceFetch;
|
||||
|
||||
if (viaStream) {
|
||||
const id = Math.random().toString();
|
||||
const id = Math.random().toString().substr(2, 8);
|
||||
|
||||
this.stream.once(`api:${id}`, res => {
|
||||
if (res == null || Object.keys(res).length == 0) {
|
||||
|
@ -18,7 +18,7 @@ export default (os) => (opts) => {
|
||||
}).$mount();
|
||||
vm.$once('cancel', recover);
|
||||
vm.$once('posted', recover);
|
||||
if (opts.cb) vm.$once('closed', opts.cb);
|
||||
if (o.cb) vm.$once('closed', o.cb);
|
||||
document.body.appendChild(vm.$el);
|
||||
(vm as any).focus();
|
||||
};
|
||||
|
@ -43,7 +43,7 @@
|
||||
</div>
|
||||
<span class="app" v-if="appearNote.app">via <b>{{ appearNote.app.name }}</b></span>
|
||||
</div>
|
||||
<footer v-if="appearNote.deletedAt == null">
|
||||
<footer>
|
||||
<mk-reactions-viewer :note="appearNote" ref="reactionsViewer"/>
|
||||
<button @click="reply()">
|
||||
<template v-if="appearNote.reply">%fa:reply-all%</template>
|
||||
|
@ -18,7 +18,7 @@
|
||||
<li><router-link to="/" :data-active="$route.name == 'index'">%fa:home%%i18n:@timeline%%fa:angle-right%</router-link></li>
|
||||
<li><router-link to="/i/notifications" :data-active="$route.name == 'notifications'">%fa:R bell%%i18n:@notifications%<template v-if="hasUnreadNotification">%fa:circle%</template>%fa:angle-right%</router-link></li>
|
||||
<li><router-link to="/i/messaging" :data-active="$route.name == 'messaging'">%fa:R comments%%i18n:@messaging%<template v-if="hasUnreadMessagingMessage">%fa:circle%</template>%fa:angle-right%</router-link></li>
|
||||
<li v-if="$store.getters.isSignedIn && $store.state.i.isLocked"><router-link to="/i/received-follow-requests" :data-active="$route.name == 'received-follow-requests'">%fa:R envelope%%i18n:@follow-requests%<template v-if="$store.getters.isSignedIn && $store.state.i.pendingReceivedFollowRequestsCount">%fa:circle%</template>%fa:angle-right%</router-link></li>
|
||||
<li v-if="$store.getters.isSignedIn && ($store.state.i.isLocked || $store.state.i.carefulBot)"><router-link to="/i/received-follow-requests" :data-active="$route.name == 'received-follow-requests'">%fa:R envelope%%i18n:@follow-requests%<template v-if="$store.getters.isSignedIn && $store.state.i.pendingReceivedFollowRequestsCount">%fa:circle%</template>%fa:angle-right%</router-link></li>
|
||||
<li><router-link to="/reversi" :data-active="$route.name == 'reversi'">%fa:gamepad%%i18n:@game%<template v-if="hasGameInvitation">%fa:circle%</template>%fa:angle-right%</router-link></li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
@ -8,7 +8,14 @@
|
||||
<x-profile/>
|
||||
|
||||
<ui-card>
|
||||
<div slot="title">%fa:palette% %i18n:@design%</div>
|
||||
<div slot="title">%fa:palette% %i18n:@theme%</div>
|
||||
<section>
|
||||
<mk-theme/>
|
||||
</section>
|
||||
</ui-card>
|
||||
|
||||
<ui-card>
|
||||
<div slot="title">%fa:poll-h% %i18n:@design%</div>
|
||||
|
||||
<section>
|
||||
<ui-switch v-model="darkmode">%i18n:@dark-mode%</ui-switch>
|
||||
@ -23,13 +30,6 @@
|
||||
<ui-switch v-model="games_reversi_useContrastStones">%i18n:common.use-contrast-reversi-stones%</ui-switch>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header>%i18n:@theme%</header>
|
||||
<div>
|
||||
<mk-theme/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<header>%i18n:@timeline%</header>
|
||||
<div>
|
||||
@ -54,7 +54,7 @@
|
||||
</ui-card>
|
||||
|
||||
<ui-card>
|
||||
<div slot="title">%fa:cog% %i18n:@behavior%</div>
|
||||
<div slot="title">%fa:sliders-h% %i18n:@behavior%</div>
|
||||
|
||||
<section>
|
||||
<ui-switch v-model="fetchOnScroll">%i18n:@fetch-on-scroll%</ui-switch>
|
||||
|
@ -58,6 +58,7 @@
|
||||
|
||||
<div>
|
||||
<ui-switch v-model="isLocked" @change="save(false)">%i18n:@is-locked%</ui-switch>
|
||||
<ui-switch v-model="carefulBot" @change="save(false)">%i18n:@careful-bot%</ui-switch>
|
||||
</div>
|
||||
</section>
|
||||
</ui-card>
|
||||
@ -80,6 +81,7 @@ export default Vue.extend({
|
||||
bannerId: null,
|
||||
isCat: false,
|
||||
isLocked: false,
|
||||
carefulBot: false,
|
||||
saving: false,
|
||||
avatarUploading: false,
|
||||
bannerUploading: false
|
||||
@ -103,6 +105,7 @@ export default Vue.extend({
|
||||
this.bannerId = this.$store.state.i.bannerId;
|
||||
this.isCat = this.$store.state.i.isCat;
|
||||
this.isLocked = this.$store.state.i.isLocked;
|
||||
this.carefulBot = this.$store.state.i.carefulBot;
|
||||
},
|
||||
|
||||
methods: {
|
||||
@ -161,7 +164,8 @@ export default Vue.extend({
|
||||
avatarId: this.avatarId,
|
||||
bannerId: this.bannerId,
|
||||
isCat: this.isCat,
|
||||
isLocked: this.isLocked
|
||||
isLocked: this.isLocked,
|
||||
carefulBot: this.carefulBot
|
||||
}).then(i => {
|
||||
this.saving = false;
|
||||
this.$store.state.i.avatarId = i.avatarId;
|
||||
|
@ -62,6 +62,8 @@ export type Source = {
|
||||
*/
|
||||
ghost?: string;
|
||||
|
||||
proxy?: string;
|
||||
|
||||
summalyProxy?: string;
|
||||
|
||||
accesslog?: string;
|
||||
|
@ -30,6 +30,8 @@
|
||||
<tr><td><kbd class="group"><kbd class="key">Ctrl</kbd> + <kbd class="key">→</kbd></kbd>, <kbd class="group"><kbd class="key">Ctrl</kbd> + <kbd class="key">Q</kbd></kbd></td><td>即刻Renoteする(フォームを開かずに)</td><td>-</td></tr>
|
||||
<tr><td><kbd class="key">E</kbd>, <kbd class="key">A</kbd>, <kbd class="key">+</kbd></td><td>リアクションフォームを開く</td><td><b>E</b>mote, re<b>A</b>ction</td></tr>
|
||||
<tr><td><kbd class="key">0</kbd>~<kbd class="key">9</kbd></td><td>数字に対応したリアクションをする(対応については後述)</td><td>-</td></tr>
|
||||
<tr><td><kbd class="key">F</kbd>, <kbd class="key">B</kbd></td><td>お気に入りに登録</td><td><b>F</b>avorite, <b>B</b>ookmark</td></tr>
|
||||
<tr><td><kbd class="key">Del</kbd>, <kbd class="group"><kbd class="key">Ctrl</kbd> + <kbd class="key">D</kbd></kbd></td><td>投稿を削除</td><td><b>D</b>elete</tr>
|
||||
<tr><td><kbd class="key">M</kbd>, <kbd class="key">O</kbd></td><td>投稿に対するメニューを開く</td><td><b>M</b>ore, <b>O</b>ther</td></tr>
|
||||
<tr><td><kbd class="key">S</kbd></td><td>CWで隠された部分を表示 or 隠す</td><td><b>S</b>how, <b>S</b>ee</td></tr>
|
||||
<tr><td><kbd class="key">Esc</kbd></td><td>フォーカスを外す</td><td>-</td></tr>
|
||||
|
@ -11,6 +11,8 @@ import DriveFileThumbnail, { deleteDriveFileThumbnail } from './drive-file-thumb
|
||||
const DriveFile = monkDb.get<IDriveFile>('driveFiles.files');
|
||||
DriveFile.createIndex('md5');
|
||||
DriveFile.createIndex('metadata.uri');
|
||||
DriveFile.createIndex('metadata.userId');
|
||||
DriveFile.createIndex('metadata.folderId');
|
||||
export default DriveFile;
|
||||
|
||||
export const DriveFileChunk = monkDb.get('driveFiles.chunks');
|
||||
|
@ -4,6 +4,7 @@ import db from '../db/mongodb';
|
||||
import DriveFile from './drive-file';
|
||||
|
||||
const DriveFolder = db.get<IDriveFolder>('driveFolders');
|
||||
DriveFolder.createIndex('userId');
|
||||
export default DriveFolder;
|
||||
|
||||
export type IDriveFolder = {
|
||||
|
@ -75,7 +75,9 @@ export const pack = (
|
||||
delete _favorite._id;
|
||||
|
||||
// Populate note
|
||||
_favorite.note = await packNote(_favorite.noteId, me);
|
||||
_favorite.note = await packNote(_favorite.noteId, me, {
|
||||
detail: true
|
||||
});
|
||||
|
||||
// (データベースの不具合などで)投稿が見つからなかったら
|
||||
if (_favorite.note == null) {
|
||||
|
@ -358,8 +358,8 @@ export const pack = async (
|
||||
})(_note.poll);
|
||||
}
|
||||
|
||||
// Fetch my reaction
|
||||
if (meId) {
|
||||
// Fetch my reaction
|
||||
_note.myReaction = (async () => {
|
||||
const reaction = await Reaction
|
||||
.findOne({
|
||||
@ -374,6 +374,19 @@ export const pack = async (
|
||||
|
||||
return null;
|
||||
})();
|
||||
|
||||
// isFavorited
|
||||
_note.isFavorited = (async () => {
|
||||
const favorite = await Favorite
|
||||
.count({
|
||||
userId: meId,
|
||||
noteId: id
|
||||
}, {
|
||||
limit: 1
|
||||
});
|
||||
|
||||
return favorite === 1;
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,6 +65,16 @@ type IUserBase = {
|
||||
*/
|
||||
isLocked: boolean;
|
||||
|
||||
/**
|
||||
* Botか否か
|
||||
*/
|
||||
isBot: boolean;
|
||||
|
||||
/**
|
||||
* Botからのフォローを承認制にするか
|
||||
*/
|
||||
carefulBot: boolean;
|
||||
|
||||
/**
|
||||
* このアカウントに届いているフォローリクエストの数
|
||||
*/
|
||||
@ -94,7 +104,6 @@ export interface ILocalUser extends IUserBase {
|
||||
tags: string[];
|
||||
};
|
||||
lastUsedAt: Date;
|
||||
isBot: boolean;
|
||||
isCat: boolean;
|
||||
isAdmin?: boolean;
|
||||
isVerified?: boolean;
|
||||
|
@ -2,7 +2,7 @@ import * as debug from 'debug';
|
||||
|
||||
import uploadFromUrl from '../../../services/drive/upload-from-url';
|
||||
import { IRemoteUser } from '../../../models/user';
|
||||
import { IDriveFile } from '../../../models/drive-file';
|
||||
import DriveFile, { IDriveFile } from '../../../models/drive-file';
|
||||
import Resolver from '../resolver';
|
||||
|
||||
const log = debug('misskey:activitypub');
|
||||
@ -24,7 +24,22 @@ export async function createImage(actor: IRemoteUser, value: any): Promise<IDriv
|
||||
|
||||
log(`Creating the Image: ${image.url}`);
|
||||
|
||||
return await uploadFromUrl(image.url, actor, null, image.url, image.sensitive);
|
||||
let file = await uploadFromUrl(image.url, actor, null, image.url, image.sensitive);
|
||||
|
||||
// URLが異なっている場合、同じ画像が以前に異なるURLで登録されていたということなので、
|
||||
// URLを更新する
|
||||
if (file.metadata.url !== image.url) {
|
||||
file = await DriveFile.findOneAndUpdate({ _id: file._id }, {
|
||||
$set: {
|
||||
'metadata.url': image.url,
|
||||
'metadata.uri': image.url
|
||||
}
|
||||
}, {
|
||||
returnNewDocument: true
|
||||
});
|
||||
}
|
||||
|
||||
return file;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -51,6 +51,7 @@ export default class Resolver {
|
||||
|
||||
const object = await request({
|
||||
url: value,
|
||||
proxy: config.proxy,
|
||||
timeout: this.timeout,
|
||||
headers: {
|
||||
'User-Agent': config.user_agent,
|
||||
|
@ -67,6 +67,12 @@ export const meta = {
|
||||
}
|
||||
}),
|
||||
|
||||
carefulBot: $.bool.optional.note({
|
||||
desc: {
|
||||
'ja-JP': 'Botからのフォローを承認制にするか'
|
||||
}
|
||||
}),
|
||||
|
||||
isBot: $.bool.optional.note({
|
||||
desc: {
|
||||
'ja-JP': 'Botか否か'
|
||||
@ -110,6 +116,7 @@ export default async (params: any, user: ILocalUser, app: IApp) => new Promise(a
|
||||
if (ps.wallpaperId !== undefined) updates.wallpaperId = ps.wallpaperId;
|
||||
if (typeof ps.isLocked == 'boolean') updates.isLocked = ps.isLocked;
|
||||
if (typeof ps.isBot == 'boolean') updates.isBot = ps.isBot;
|
||||
if (typeof ps.carefulBot == 'boolean') updates.carefulBot = ps.carefulBot;
|
||||
if (typeof ps.isCat == 'boolean') updates.isCat = ps.isCat;
|
||||
if (typeof ps.autoWatch == 'boolean') updates['settings.autoWatch'] = ps.autoWatch;
|
||||
if (typeof ps.alwaysMarkNsfw == 'boolean') updates['settings.alwaysMarkNsfw'] = ps.alwaysMarkNsfw;
|
||||
|
@ -30,22 +30,20 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) =>
|
||||
.replace('{{limit}}', limit)
|
||||
.replace('{{offset}}', offset);
|
||||
|
||||
request(
|
||||
{
|
||||
url: url,
|
||||
timeout: timeout,
|
||||
json: true,
|
||||
followRedirect: true,
|
||||
followAllRedirects: true
|
||||
},
|
||||
(error: any, response: any, body: any) => {
|
||||
if (!error && response.statusCode == 200) {
|
||||
res(body);
|
||||
} else {
|
||||
res([]);
|
||||
}
|
||||
request({
|
||||
url: url,
|
||||
proxy: config.proxy,
|
||||
timeout: timeout,
|
||||
json: true,
|
||||
followRedirect: true,
|
||||
followAllRedirects: true
|
||||
}, (error: any, response: any, body: any) => {
|
||||
if (!error && response.statusCode == 200) {
|
||||
res(body);
|
||||
} else {
|
||||
res([]);
|
||||
}
|
||||
);
|
||||
});
|
||||
} else {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
|
@ -63,6 +63,7 @@ handler.on('status', event => {
|
||||
// Fetch parent status
|
||||
request({
|
||||
url: `${parent.url}/statuses`,
|
||||
proxy: config.proxy,
|
||||
headers: {
|
||||
'User-Agent': 'misskey'
|
||||
}
|
||||
|
@ -146,9 +146,9 @@ export default class Connection {
|
||||
*/
|
||||
@autobind
|
||||
private onChannelConnectRequested(payload: any) {
|
||||
const { channel, id, params } = payload;
|
||||
const { channel, id, params, pong } = payload;
|
||||
log(`CH CONNECT: ${id} ${channel} by @${this.user.username}`);
|
||||
this.connectChannel(id, params, channel);
|
||||
this.connectChannel(id, params, channel, pong);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -177,7 +177,7 @@ export default class Connection {
|
||||
* チャンネルに接続
|
||||
*/
|
||||
@autobind
|
||||
public connectChannel(id: string, params: any, channel: string) {
|
||||
public connectChannel(id: string, params: any, channel: string, pong = false) {
|
||||
// 共有可能チャンネルに接続しようとしていて、かつそのチャンネルに既に接続していたら無意味なので無視
|
||||
if ((channels as any)[channel].shouldShare && this.channels.some(c => c.chName === channel)) {
|
||||
return;
|
||||
@ -186,9 +186,12 @@ export default class Connection {
|
||||
const ch: Channel = new (channels as any)[channel](id, this);
|
||||
this.channels.push(ch);
|
||||
ch.init(params);
|
||||
this.sendMessageToWs('connected', {
|
||||
id: id
|
||||
});
|
||||
|
||||
if (pong) {
|
||||
this.sendMessageToWs('connected', {
|
||||
id: id
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -64,14 +64,14 @@ module.exports = (server: http.Server) => {
|
||||
}));
|
||||
};
|
||||
|
||||
main.connectChannel(Math.random().toString(), null,
|
||||
main.connectChannel(Math.random().toString().substr(2, 8), null,
|
||||
request.resourceURL.pathname === '/' ? 'homeTimeline' :
|
||||
request.resourceURL.pathname === '/local-timeline' ? 'localTimeline' :
|
||||
request.resourceURL.pathname === '/hybrid-timeline' ? 'hybridTimeline' :
|
||||
request.resourceURL.pathname === '/global-timeline' ? 'globalTimeline' : null);
|
||||
|
||||
if (request.resourceURL.pathname === '/') {
|
||||
main.connectChannel(Math.random().toString(), null, 'main');
|
||||
main.connectChannel(Math.random().toString().substr(2, 8), null, 'main');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ module.exports = async (ctx: Koa.Context) => {
|
||||
try {
|
||||
const summary = config.summalyProxy ? await request.get({
|
||||
url: config.summalyProxy,
|
||||
proxy: config.proxy,
|
||||
qs: {
|
||||
url: ctx.query.url
|
||||
},
|
||||
|
@ -37,6 +37,7 @@ export default async (url: string, user: IUser, folderId: mongodb.ObjectID = nul
|
||||
const requestUrl = URL.parse(url).pathname.match(/[^\u0021-\u00ff]/) ? encodeURI(url) : url;
|
||||
request({
|
||||
url: requestUrl,
|
||||
proxy: config.proxy,
|
||||
headers: {
|
||||
'User-Agent': config.user_agent
|
||||
}
|
||||
|
@ -11,70 +11,75 @@ import { deliver } from '../../queue';
|
||||
import createFollowRequest from './requests/create';
|
||||
|
||||
export default async function(follower: IUser, followee: IUser) {
|
||||
if (followee.isLocked || isLocalUser(follower) && isRemoteUser(followee)) {
|
||||
// フォロー対象が鍵アカウントである or
|
||||
// フォロワーがBotであり、フォロー対象がBotからのフォローに慎重である or
|
||||
// フォロワーがローカルユーザーであり、フォロー対象がリモートユーザーである
|
||||
// 上記のいずれかに当てはまる場合はすぐフォローせずにフォローリクエストを発行しておく
|
||||
if (followee.isLocked || (followee.carefulBot && follower.isBot) || (isLocalUser(follower) && isRemoteUser(followee))) {
|
||||
await createFollowRequest(follower, followee);
|
||||
} else {
|
||||
const following = await Following.insert({
|
||||
createdAt: new Date(),
|
||||
followerId: follower._id,
|
||||
followeeId: followee._id,
|
||||
return;
|
||||
}
|
||||
|
||||
// 非正規化
|
||||
_follower: {
|
||||
host: follower.host,
|
||||
inbox: isRemoteUser(follower) ? follower.inbox : undefined,
|
||||
sharedInbox: isRemoteUser(follower) ? follower.sharedInbox : undefined
|
||||
},
|
||||
_followee: {
|
||||
host: followee.host,
|
||||
inbox: isRemoteUser(followee) ? followee.inbox : undefined,
|
||||
sharedInbox: isRemoteUser(followee) ? followee.sharedInbox : undefined
|
||||
}
|
||||
});
|
||||
const following = await Following.insert({
|
||||
createdAt: new Date(),
|
||||
followerId: follower._id,
|
||||
followeeId: followee._id,
|
||||
|
||||
//#region Increment following count
|
||||
User.update({ _id: follower._id }, {
|
||||
$inc: {
|
||||
followingCount: 1
|
||||
}
|
||||
});
|
||||
|
||||
FollowingLog.insert({
|
||||
createdAt: following.createdAt,
|
||||
userId: follower._id,
|
||||
count: follower.followingCount + 1
|
||||
});
|
||||
//#endregion
|
||||
|
||||
//#region Increment followers count
|
||||
User.update({ _id: followee._id }, {
|
||||
$inc: {
|
||||
followersCount: 1
|
||||
}
|
||||
});
|
||||
FollowedLog.insert({
|
||||
createdAt: following.createdAt,
|
||||
userId: followee._id,
|
||||
count: followee.followersCount + 1
|
||||
});
|
||||
//#endregion
|
||||
|
||||
// Publish follow event
|
||||
if (isLocalUser(follower)) {
|
||||
packUser(followee, follower).then(packed => publishMainStream(follower._id, 'follow', packed));
|
||||
// 非正規化
|
||||
_follower: {
|
||||
host: follower.host,
|
||||
inbox: isRemoteUser(follower) ? follower.inbox : undefined,
|
||||
sharedInbox: isRemoteUser(follower) ? follower.sharedInbox : undefined
|
||||
},
|
||||
_followee: {
|
||||
host: followee.host,
|
||||
inbox: isRemoteUser(followee) ? followee.inbox : undefined,
|
||||
sharedInbox: isRemoteUser(followee) ? followee.sharedInbox : undefined
|
||||
}
|
||||
});
|
||||
|
||||
// Publish followed event
|
||||
if (isLocalUser(followee)) {
|
||||
packUser(follower, followee).then(packed => publishMainStream(followee._id, 'followed', packed)),
|
||||
|
||||
// 通知を作成
|
||||
notify(followee._id, follower._id, 'follow');
|
||||
//#region Increment following count
|
||||
User.update({ _id: follower._id }, {
|
||||
$inc: {
|
||||
followingCount: 1
|
||||
}
|
||||
});
|
||||
|
||||
if (isRemoteUser(follower) && isLocalUser(followee)) {
|
||||
const content = pack(renderAccept(renderFollow(follower, followee)));
|
||||
deliver(followee, content, follower.inbox);
|
||||
FollowingLog.insert({
|
||||
createdAt: following.createdAt,
|
||||
userId: follower._id,
|
||||
count: follower.followingCount + 1
|
||||
});
|
||||
//#endregion
|
||||
|
||||
//#region Increment followers count
|
||||
User.update({ _id: followee._id }, {
|
||||
$inc: {
|
||||
followersCount: 1
|
||||
}
|
||||
});
|
||||
FollowedLog.insert({
|
||||
createdAt: following.createdAt,
|
||||
userId: followee._id,
|
||||
count: followee.followersCount + 1
|
||||
});
|
||||
//#endregion
|
||||
|
||||
// Publish follow event
|
||||
if (isLocalUser(follower)) {
|
||||
packUser(followee, follower).then(packed => publishMainStream(follower._id, 'follow', packed));
|
||||
}
|
||||
|
||||
// Publish followed event
|
||||
if (isLocalUser(followee)) {
|
||||
packUser(follower, followee).then(packed => publishMainStream(followee._id, 'followed', packed)),
|
||||
|
||||
// 通知を作成
|
||||
notify(followee._id, follower._id, 'follow');
|
||||
}
|
||||
|
||||
if (isRemoteUser(follower) && isLocalUser(followee)) {
|
||||
const content = pack(renderAccept(renderFollow(follower, followee)));
|
||||
deliver(followee, content, follower.inbox);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user