From 203cbe3a071074fc427d2b1e9b0c6dcdc4c439ba Mon Sep 17 00:00:00 2001
From: rinsuki <428rinsuki+git@gmail.com>
Date: Tue, 17 Apr 2018 17:14:25 +0900
Subject: [PATCH 001/292] add feedback link
---
locales/en.yml | 1 +
locales/ja.yml | 1 +
src/client/app/desktop/views/components/ui.header.account.vue | 3 +++
3 files changed, 5 insertions(+)
diff --git a/locales/en.yml b/locales/en.yml
index 446ef371b..cfd075f7d 100644
--- a/locales/en.yml
+++ b/locales/en.yml
@@ -369,6 +369,7 @@ desktop/views/components/ui.header.account.vue:
mentions: "Mentions"
customize: "Customize"
settings: "Settings"
+ feedback: "Feedback"
signout: "Sign out"
desktop/views/components/ui.header.nav.vue:
diff --git a/locales/ja.yml b/locales/ja.yml
index b5479b5ce..470a393b8 100644
--- a/locales/ja.yml
+++ b/locales/ja.yml
@@ -369,6 +369,7 @@ desktop/views/components/ui.header.account.vue:
mentions: "あなた宛て"
customize: "カスタマイズ"
settings: "設定"
+ feedback: "フィードバック"
signout: "サインアウト"
desktop/views/components/ui.header.nav.vue:
diff --git a/src/client/app/desktop/views/components/ui.header.account.vue b/src/client/app/desktop/views/components/ui.header.account.vue
index 558aaa6dc..28e13f148 100644
--- a/src/client/app/desktop/views/components/ui.header.account.vue
+++ b/src/client/app/desktop/views/components/ui.header.account.vue
@@ -24,6 +24,9 @@
%fa:cog%%i18n:@settings%%fa:angle-right%
+
+ %fa:comment%%i18n:@feedback%%fa:external-link-alt%
+
-
From c2d8d958a65f7c1056ec282870f64dc94b05b45a Mon Sep 17 00:00:00 2001
From: syuilo
Date: Tue, 17 Apr 2018 19:32:18 +0900
Subject: [PATCH 002/292] :art:
---
.../app/desktop/views/components/timeline.vue | 32 ++++++++++++++-----
1 file changed, 24 insertions(+), 8 deletions(-)
diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue
index e0215ad1a..c1afbb6be 100644
--- a/src/client/app/desktop/views/components/timeline.vue
+++ b/src/client/app/desktop/views/components/timeline.vue
@@ -74,20 +74,36 @@ export default Vue.extend({
border-radius 6px
> header
- padding 8px 16px
- border-bottom solid 1px #eee
+ padding 0 8px
+ z-index 1
+ box-shadow 0 1px rgba(0, 0, 0, 0.08)
> span
- margin-right 16px
- line-height 27px
- font-size 14px
- color #555
+ display inline-block
+ padding 0 10px
+ line-height 42px
+ font-size 12px
+ user-select none
+
+ &[data-is-active]
+ color $theme-color
+ cursor default
+
+ &:before
+ content ""
+ display block
+ position absolute
+ bottom 0
+ left -8px
+ width calc(100% + 16px)
+ height 2px
+ background $theme-color
&:not([data-is-active])
- color $theme-color
+ color #6f7477
cursor pointer
&:hover
- text-decoration underline
+ color #525a5f
From 6056ffe582c744ac665ad9bc5341a7c96d2c8f5e Mon Sep 17 00:00:00 2001
From: syuilo
Date: Tue, 17 Apr 2018 19:33:43 +0900
Subject: [PATCH 003/292] :art:
---
src/client/app/desktop/views/components/timeline.vue | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue
index c1afbb6be..f64b7eba9 100644
--- a/src/client/app/desktop/views/components/timeline.vue
+++ b/src/client/app/desktop/views/components/timeline.vue
@@ -88,6 +88,7 @@ export default Vue.extend({
&[data-is-active]
color $theme-color
cursor default
+ font-weight bold
&:before
content ""
From 273ce6f621adfa314715951c8c01719cdaeabb27 Mon Sep 17 00:00:00 2001
From: syuilo
Date: Tue, 17 Apr 2018 19:40:02 +0900
Subject: [PATCH 004/292] =?UTF-8?q?=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC?=
=?UTF-8?q?=E6=95=B4=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
locales/en.yml | 3 +--
locales/fr.yml | 2 +-
locales/ja.yml | 3 +--
src/client/app/common/views/components/nav.vue | 10 ++--------
.../app/desktop/views/components/ui.header.account.vue | 6 ------
5 files changed, 5 insertions(+), 19 deletions(-)
diff --git a/locales/en.yml b/locales/en.yml
index cfd075f7d..b0f77838a 100644
--- a/locales/en.yml
+++ b/locales/en.yml
@@ -95,6 +95,7 @@ common/views/components/nav.vue:
donors: "Donators"
repository: "Repository"
develop: "Developers"
+ feedback: "Feedback"
common/views/components/note-menu.vue:
pin: "Pin to profile page"
@@ -366,10 +367,8 @@ desktop/views/components/settings.profile.vue:
desktop/views/components/ui.header.account.vue:
profile: "Your profile"
drive: "Drive"
- mentions: "Mentions"
customize: "Customize"
settings: "Settings"
- feedback: "Feedback"
signout: "Sign out"
desktop/views/components/ui.header.nav.vue:
diff --git a/locales/fr.yml b/locales/fr.yml
index 583104b4f..681bb6ba1 100644
--- a/locales/fr.yml
+++ b/locales/fr.yml
@@ -95,6 +95,7 @@ common/views/components/nav.vue:
donors: "Donateurs"
repository: "Repo"
develop: "Développeurs"
+ feedback: "フィードバック"
common/views/components/note-menu.vue:
pin: "Épingler sur votre profile"
@@ -366,7 +367,6 @@ desktop/views/components/settings.profile.vue:
desktop/views/components/ui.header.account.vue:
profile: "Votre profil"
drive: "Drive"
- mentions: "Mentions"
customize: "Modifications"
settings: "Réglages"
signout: "Déconnexion"
diff --git a/locales/ja.yml b/locales/ja.yml
index 470a393b8..c8e02f745 100644
--- a/locales/ja.yml
+++ b/locales/ja.yml
@@ -95,6 +95,7 @@ common/views/components/nav.vue:
donors: "ドナー"
repository: "リポジトリ"
develop: "開発者"
+ feedback: "フィードバック"
common/views/components/note-menu.vue:
pin: "ピン留め"
@@ -366,10 +367,8 @@ desktop/views/components/settings.profile.vue:
desktop/views/components/ui.header.account.vue:
profile: "プロフィール"
drive: "ドライブ"
- mentions: "あなた宛て"
customize: "カスタマイズ"
settings: "設定"
- feedback: "フィードバック"
signout: "サインアウト"
desktop/views/components/ui.header.nav.vue:
diff --git a/src/client/app/common/views/components/nav.vue b/src/client/app/common/views/components/nav.vue
index 229595792..cd1f99288 100644
--- a/src/client/app/common/views/components/nav.vue
+++ b/src/client/app/common/views/components/nav.vue
@@ -2,16 +2,10 @@
%i18n:@about%
・
- %i18n:@stats%
- ・
- %i18n:@status%
- ・
- %i18n:@wiki%
- ・
- %i18n:@donors%
- ・
%i18n:@repository%
・
+ %i18n:@feedback%
+ ・
%i18n:@develop%
・
Follow us on %fa:B twitter%
diff --git a/src/client/app/desktop/views/components/ui.header.account.vue b/src/client/app/desktop/views/components/ui.header.account.vue
index 28e13f148..2bf8678b8 100644
--- a/src/client/app/desktop/views/components/ui.header.account.vue
+++ b/src/client/app/desktop/views/components/ui.header.account.vue
@@ -13,9 +13,6 @@
-
%fa:cloud%%i18n:@drive%%fa:angle-right%
- -
- %fa:at%%i18n:@mentions%%fa:angle-right%
-
-
From aaf9d47564ac3fa4599c7d6d86a26aae9bd104e1 Mon Sep 17 00:00:00 2001
From: syuilo
Date: Tue, 17 Apr 2018 19:40:44 +0900
Subject: [PATCH 005/292] :v:
---
locales/fr.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/locales/fr.yml b/locales/fr.yml
index 681bb6ba1..137816ee9 100644
--- a/locales/fr.yml
+++ b/locales/fr.yml
@@ -446,7 +446,7 @@ desktop/views/widgets/trends.vue:
nothing: "Rien"
desktop/views/widgets/users.vue:
- title: "Utilisateurs recommandés"
+ title: "Utilisateurs"
refresh: "Afficher d'autres"
no-one: "Personne"
From 3fde15cc47546961449f13c18c65cbc8f2acf79f Mon Sep 17 00:00:00 2001
From: syuilo
Date: Tue, 17 Apr 2018 19:43:49 +0900
Subject: [PATCH 006/292] Delete publicKey of remote user
---
src/models/user.ts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/models/user.ts b/src/models/user.ts
index 741306fd2..9638d1593 100644
--- a/src/models/user.ts
+++ b/src/models/user.ts
@@ -359,6 +359,8 @@ export const pack = (
if (!opts.detail) {
delete _user.twoFactorEnabled;
}
+ } else {
+ delete _user.publicKey;
}
_user.avatarUrl = _user.avatarId != null
From c8a4e7f3f45312b4191410d56cda8aaa8a595073 Mon Sep 17 00:00:00 2001
From: syuilo
Date: Tue, 17 Apr 2018 19:55:58 +0900
Subject: [PATCH 007/292] #1414
---
src/models/drive-file.ts | 6 +++---
src/services/drive/add-file.ts | 33 ++++++++++++++++++++++++++++++---
2 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/src/models/drive-file.ts b/src/models/drive-file.ts
index fc9c15072..0d0a6523d 100644
--- a/src/models/drive-file.ts
+++ b/src/models/drive-file.ts
@@ -8,11 +8,11 @@ import MessagingMessage, { deleteMessagingMessage } from './messaging-message';
import User from './user';
const DriveFile = monkDb.get('driveFiles.files');
-
DriveFile.createIndex('metadata.uri', { sparse: true, unique: true });
-
export default DriveFile;
+export const DriveFileChunk = monkDb.get('driveFiles.chunks');
+
const getGridFSBucket = async (): Promise => {
const db = await nativeDbConn();
const bucket = new mongo.GridFSBucket(db, {
@@ -93,7 +93,7 @@ export async function deleteDriveFile(driveFile: string | mongo.ObjectID | IDriv
}
// このDriveFileのチャンクをすべて削除
- await monkDb.get('driveFiles.chunks').remove({
+ await DriveFileChunk.remove({
files_id: d._id
});
diff --git a/src/services/drive/add-file.ts b/src/services/drive/add-file.ts
index 30aae24ba..279cdf0bc 100644
--- a/src/services/drive/add-file.ts
+++ b/src/services/drive/add-file.ts
@@ -10,12 +10,12 @@ import * as debug from 'debug';
import fileType = require('file-type');
import prominence = require('prominence');
-import DriveFile, { IMetadata, getGridFSBucket, IDriveFile } from '../../models/drive-file';
+import DriveFile, { IMetadata, getGridFSBucket, IDriveFile, DriveFileChunk } from '../../models/drive-file';
import DriveFolder from '../../models/drive-folder';
import { pack } from '../../models/drive-file';
import event, { publishDriveStream } from '../../publishers/stream';
import getAcct from '../../acct/render';
-import { IUser } from '../../models/user';
+import { IUser, isLocalUser } from '../../models/user';
const gm = _gm.subClass({
imageMagick: true
@@ -207,7 +207,34 @@ const addFile = async (
// If usage limit exceeded
if (usage + size > user.driveCapacity) {
- throw 'no-free-space';
+ if (isLocalUser(user)) {
+ throw 'no-free-space';
+ } else {
+ //#region (アバターまたはバナーを含まず)最も古いファイルを削除する
+ const oldFile = await DriveFile.findOne({
+ _id: {
+ $nin: [user.avatarId, user.bannerId]
+ }
+ }, {
+ sort: {
+ _id: 1
+ }
+ });
+
+ if (oldFile) {
+ // チャンクをすべて削除
+ DriveFileChunk.remove({
+ files_id: oldFile._id
+ });
+
+ DriveFile.update({ _id: oldFile._id }, {
+ $set: {
+ 'metadata.deletedAt': new Date()
+ }
+ });
+ }
+ //#endregion
+ }
}
})()
]);
From 245eb5b59fa2793901a7940b4d18a277139a55d2 Mon Sep 17 00:00:00 2001
From: syuilo
Date: Tue, 17 Apr 2018 20:04:19 +0900
Subject: [PATCH 008/292] tombstone
---
src/models/drive-file.ts | 1 +
src/server/file/assets/tombstone.png | 3 +++
src/server/file/send-drive-file.ts | 6 ++++++
3 files changed, 10 insertions(+)
create mode 100644 src/server/file/assets/tombstone.png
diff --git a/src/models/drive-file.ts b/src/models/drive-file.ts
index 0d0a6523d..a8878d119 100644
--- a/src/models/drive-file.ts
+++ b/src/models/drive-file.ts
@@ -29,6 +29,7 @@ export type IMetadata = {
folderId: mongo.ObjectID;
comment: string;
uri: string;
+ deletedAt?: Date;
};
export type IDriveFile = {
diff --git a/src/server/file/assets/tombstone.png b/src/server/file/assets/tombstone.png
new file mode 100644
index 000000000..a5c8e828d
--- /dev/null
+++ b/src/server/file/assets/tombstone.png
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bbc253852228f7800fc028363615a040eef9b6adbf47c8ad09bc7aca9a98a5d2
+size 6387
diff --git a/src/server/file/send-drive-file.ts b/src/server/file/send-drive-file.ts
index e6ee19ff1..ef458265a 100644
--- a/src/server/file/send-drive-file.ts
+++ b/src/server/file/send-drive-file.ts
@@ -22,6 +22,12 @@ export default async function(ctx: Koa.Context) {
return;
}
+ if (file.metadata.deletedAt) {
+ ctx.status = 410;
+ await send(ctx, `${__dirname}/assets/tombstone.png`);
+ return;
+ }
+
const bucket = await getGridFSBucket();
const readable = bucket.openDownloadStream(fileId);
From 636e371882c91ad04ff1e7d63331793ca168f214 Mon Sep 17 00:00:00 2001
From: syuilo
Date: Tue, 17 Apr 2018 20:05:32 +0900
Subject: [PATCH 009/292] v4983
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 2fcd68b1c..b2947a4f6 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "misskey",
"author": "syuilo ",
- "version": "0.0.4970",
+ "version": "0.0.4983",
"codename": "nighthike",
"license": "MIT",
"description": "A miniblog-based SNS",
From e39b53b625860359888c4a5c8fec388670c24ab2 Mon Sep 17 00:00:00 2001
From: syuilo
Date: Tue, 17 Apr 2018 20:17:00 +0900
Subject: [PATCH 010/292] :art:
---
src/client/app/desktop/views/components/timeline.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue
index f64b7eba9..cadff8071 100644
--- a/src/client/app/desktop/views/components/timeline.vue
+++ b/src/client/app/desktop/views/components/timeline.vue
@@ -75,7 +75,7 @@ export default Vue.extend({
> header
padding 0 8px
- z-index 1
+ z-index 10
box-shadow 0 1px rgba(0, 0, 0, 0.08)
> span
From ba1ec7402f26b5699b25c6f63fa0beb058f584e6 Mon Sep 17 00:00:00 2001
From: syuilo
Date: Tue, 17 Apr 2018 22:17:55 +0900
Subject: [PATCH 011/292] Fix bug
---
src/server/activitypub.ts | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts
index e27e2552f..73ed43406 100644
--- a/src/server/activitypub.ts
+++ b/src/server/activitypub.ts
@@ -1,3 +1,4 @@
+import * as mongo from 'mongodb';
import * as Router from 'koa-router';
const json = require('koa-json-body');
const httpSignature = require('http-signature');
@@ -49,7 +50,7 @@ router.get('/notes/:note', async (ctx, next) => {
}
const note = await Note.findOne({
- _id: ctx.params.note
+ _id: new mongo.ObjectID(ctx.params.note)
});
if (note === null) {
@@ -62,7 +63,7 @@ router.get('/notes/:note', async (ctx, next) => {
// outbot
router.get('/users/:user/outbox', async ctx => {
- const userId = ctx.params.user;
+ const userId = new mongo.ObjectID(ctx.params.user);
const user = await User.findOne({ _id: userId });
@@ -84,7 +85,7 @@ router.get('/users/:user/outbox', async ctx => {
// publickey
router.get('/users/:user/publickey', async ctx => {
- const userId = ctx.params.user;
+ const userId = new mongo.ObjectID(ctx.params.user);
const user = await User.findOne({ _id: userId });
@@ -102,7 +103,7 @@ router.get('/users/:user/publickey', async ctx => {
// user
router.get('/users/:user', async ctx => {
- const userId = ctx.params.user;
+ const userId = new mongo.ObjectID(ctx.params.user);
const user = await User.findOne({ _id: userId });
From 6d83f029794214ec27c84374a2de00beeed657db Mon Sep 17 00:00:00 2001
From: syuilo
Date: Tue, 17 Apr 2018 22:20:25 +0900
Subject: [PATCH 012/292] Fix bug
---
src/remote/activitypub/models/note.ts | 4 +++-
src/remote/activitypub/models/person.ts | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/remote/activitypub/models/note.ts b/src/remote/activitypub/models/note.ts
index ab6dd99a7..b2b5077c5 100644
--- a/src/remote/activitypub/models/note.ts
+++ b/src/remote/activitypub/models/note.ts
@@ -1,3 +1,4 @@
+import * as mongo from 'mongodb';
import { JSDOM } from 'jsdom';
import * as debug from 'debug';
@@ -22,7 +23,8 @@ export async function fetchNote(value: string | IObject, resolver?: Resolver): P
// URIがこのサーバーを指しているならデータベースからフェッチ
if (uri.startsWith(config.url + '/')) {
- return await Note.findOne({ _id: uri.split('/').pop() });
+ const id = new mongo.ObjectID(uri.split('/').pop());
+ return await Note.findOne({ _id: id });
}
//#region このサーバーに既に登録されていたらそれを返す
diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts
index b755b2603..dd9a80ae2 100644
--- a/src/remote/activitypub/models/person.ts
+++ b/src/remote/activitypub/models/person.ts
@@ -1,3 +1,4 @@
+import * as mongo from 'mongodb';
import { JSDOM } from 'jsdom';
import { toUnicode } from 'punycode';
import * as debug from 'debug';
@@ -21,7 +22,8 @@ export async function fetchPerson(value: string | IObject, resolver?: Resolver):
// URIがこのサーバーを指しているならデータベースからフェッチ
if (uri.startsWith(config.url + '/')) {
- return await User.findOne({ _id: uri.split('/').pop() });
+ const id = new mongo.ObjectID(uri.split('/').pop());
+ return await User.findOne({ _id: id });
}
//#region このサーバーに既に登録されていたらそれを返す
From 9aef9c640f238b0d4977a6f1de3e25ec267e3acc Mon Sep 17 00:00:00 2001
From: syuilo
Date: Tue, 17 Apr 2018 22:25:51 +0900
Subject: [PATCH 013/292] =?UTF-8?q?=E8=89=AF=E3=81=84=E6=84=9F=E3=81=98?=
=?UTF-8?q?=E3=81=AB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
locales/en.yml | 4 ++--
locales/fr.yml | 4 ++--
locales/ja.yml | 4 ++--
src/client/app/desktop/views/pages/user/user.header.vue | 2 +-
src/client/app/mobile/views/pages/user.vue | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/locales/en.yml b/locales/en.yml
index b0f77838a..9388aedbf 100644
--- a/locales/en.yml
+++ b/locales/en.yml
@@ -406,7 +406,7 @@ desktop/views/pages/user/user.friends.vue:
no-users: "No users"
desktop/views/pages/user/user.header.vue:
- is-remote: "This user is not a user of Misskey, so the information is not accurate."
+ is-remote: "This user is a remote user, so the information is not accurate. "
view-remote: "See accurate information"
desktop/views/pages/user/user.home.vue:
@@ -591,7 +591,7 @@ mobile/views/pages/user.vue:
overview: "Overview"
timeline: "Timeline"
media: "Media"
- is-remote: "This user is not a user of Misskey, so the information might not be accurate."
+ is-remote: "This user is a remote user, so the information is not accurate. "
view-remote: "See accurate information"
mobile/views/pages/user/home.vue:
diff --git a/locales/fr.yml b/locales/fr.yml
index 137816ee9..cd756194a 100644
--- a/locales/fr.yml
+++ b/locales/fr.yml
@@ -406,7 +406,7 @@ desktop/views/pages/user/user.friends.vue:
no-users: "Pas d'utilisateurs"
desktop/views/pages/user/user.header.vue:
- is-remote: "Cet utilisateur n'est pas un utilisateur de Misskey. Certaines informations peuvent être erronées"
+ is-remote: "Cet utilisateur n'est pas un utilisateur de Misskey. Certaines informations peuvent être erronées "
view-remote: "Voir les informations détaillées"
desktop/views/pages/user/user.home.vue:
@@ -591,7 +591,7 @@ mobile/views/pages/user.vue:
overview: "Aperçu"
timeline: "Fil d'actualité"
media: "Media"
- is-remote: "Cet utilisateur n'est pas un utilisateur de Misskey. Certaines informations peuvent être erronées"
+ is-remote: "Cet utilisateur n'est pas un utilisateur de Misskey. Certaines informations peuvent être erronées "
view-remote: "Voir les informations détaillées"
mobile/views/pages/user/home.vue:
diff --git a/locales/ja.yml b/locales/ja.yml
index c8e02f745..96b4a1d0e 100644
--- a/locales/ja.yml
+++ b/locales/ja.yml
@@ -406,7 +406,7 @@ desktop/views/pages/user/user.friends.vue:
no-users: "よく話すユーザーはいません"
desktop/views/pages/user/user.header.vue:
- is-remote: "このユーザーはMisskeyのユーザーではないため情報が正確ではありません。"
+ is-remote: "このユーザーはリモートユーザーのため情報が正確ではありません。"
view-remote: "正確な情報を見る"
desktop/views/pages/user/user.home.vue:
@@ -591,7 +591,7 @@ mobile/views/pages/user.vue:
overview: "概要"
timeline: "タイムライン"
media: "メディア"
- is-remote: "このユーザーはMisskeyのユーザーではないため情報が正確ではありません。"
+ is-remote: "このユーザーはリモートユーザーのため情報が正確ではありません。"
view-remote: "正確な情報を見る"
mobile/views/pages/user/home.vue:
diff --git a/src/client/app/desktop/views/pages/user/user.header.vue b/src/client/app/desktop/views/pages/user/user.header.vue
index 7a0672d3d..d9ad61516 100644
--- a/src/client/app/desktop/views/pages/user/user.header.vue
+++ b/src/client/app/desktop/views/pages/user/user.header.vue
@@ -1,6 +1,6 @@