From 23f2370c4b1ffd9a7c3a7a51209be4f7e2580092 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 2 Aug 2018 07:53:11 +0900 Subject: [PATCH 01/12] Improve i18n --- src/client/app/common/views/widgets/calendar.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/app/common/views/widgets/calendar.vue b/src/client/app/common/views/widgets/calendar.vue index 68a58f8936..eb15030370 100644 --- a/src/client/app/common/views/widgets/calendar.vue +++ b/src/client/app/common/views/widgets/calendar.vue @@ -4,10 +4,10 @@

- %i18n:@year-english%{{ year }}%i18n:@year-japanese% - %i18n:@month-english%{{ month }}%i18n:@month-japanese% + {{ '%i18n:@year%'.split('{}')[0] }}{{ year }}{{ '%i18n:@year%'.split('{}')[1] }} + {{ '%i18n:@month%'.split('{}')[0] }}{{ month }}{{ '%i18n:@month%'.split('{}')[1] }}

-

%i18n:@day-english%{{ day }}%i18n:@day-japanese%

+

{{ '%i18n:@day%'.split('{}')[0] }}{{ day }}{{ '%i18n:@day%'.split('{}')[1] }}

{{ weekDay }}

From 635eee980dcb9bdd150db9557fa700d3fbcfec2c Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 2 Aug 2018 07:54:59 +0900 Subject: [PATCH 02/12] Update --- locales/ja.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/locales/ja.yml b/locales/ja.yml index 6f1a00309d..76ae7553de 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -318,14 +318,9 @@ common/views/widgets/broadcast.vue: next: "次" common/views/widgets/calendar.vue: - year-english: "" - year-japanese: "年" - month-english: "" - month-japanese: "月" - day-english: "" - day-japanese: "日" - weekday-english: "" - weekday-japanese: "曜日" + year: "{}年" + month: "{}月" + day: "{}日" today: "今日:" this-month: "今月:" this-year: "今年:" From 1d4f4b829f9594ee8f962f434f7a1c028c0e665f Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 2 Aug 2018 08:04:16 +0900 Subject: [PATCH 03/12] Improve i18n --- locales/ja.yml | 15 +++------------ src/client/app/desktop/views/pages/search.vue | 2 +- src/client/app/desktop/views/pages/tag.vue | 2 +- src/client/app/mobile/views/pages/tag.vue | 2 +- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/locales/ja.yml b/locales/ja.yml index 76ae7553de..342c90fbae 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -867,20 +867,14 @@ desktop/views/pages/selectdrive.vue: desktop/views/pages/search.vue: not-available: "検索機能を利用することができません。" - not-found-quotes1: "「" - not-found-quotes2: "」" - not-found-text-english: "" - not-found-text-japanese: "に関する投稿は見つかりませんでした。" + not-found: "「{}」に関する投稿は見つかりませんでした。" desktop/views/pages/share.vue: share-with: "Misskeyで共有" close: "閉じる" desktop/views/pages/tag.vue: - no-posts-found-english: "" - no-posts-found-japanese: "に関する投稿は見つかりませんでした。" - left-quote: "「" - right-quote: "」" + no-posts-found: "ハッシュタグ「{}」が付けられた投稿は見つかりませんでした。" desktop/views/pages/user-list.users.vue: users: "ユーザー" @@ -1126,10 +1120,7 @@ mobile/views/pages/home.vue: global: "グローバル" mobile/views/pages/tag.vue: - no-posts-found-japanese: "に関する投稿は見つかりませんでした。" - no-posts-found-english: "" - left-quote: "「" - right-quote: "」" + no-posts-found: "ハッシュタグ「{}」が付けられた投稿は見つかりませんでした。" mobile/views/pages/welcome.vue: signup: "新規登録" diff --git a/src/client/app/desktop/views/pages/search.vue b/src/client/app/desktop/views/pages/search.vue index 2db9617db4..0b6c9a032a 100644 --- a/src/client/app/desktop/views/pages/search.vue +++ b/src/client/app/desktop/views/pages/search.vue @@ -7,7 +7,7 @@

%i18n:@not-available%

-

%fa:search%%i18n:@not-found-text-english%%i18n:@not-found-quotes1%{{ q }}%i18n:@not-found-quotes2%%i18n:@not-found-text-japanese%

+

%fa:search% {{ '%i18n:not-found%'.split('{}')[0] }}{{ q }}{{ '%i18n:not-found%'.split('{}')[1] }}

diff --git a/src/client/app/desktop/views/pages/tag.vue b/src/client/app/desktop/views/pages/tag.vue index 19f7ad1c1b..04b377e0ab 100644 --- a/src/client/app/desktop/views/pages/tag.vue +++ b/src/client/app/desktop/views/pages/tag.vue @@ -6,7 +6,7 @@
-

%i18n:no-posts-found-english%%fa:search%%i18n:left-quote%{{ q }}%i18n:right-quote%%i18n:no-posts-found-japanese%

+

%fa:search% {{ '%i18n:no-posts-found%'.split('{}')[0] }}{{ q }}{{ '%i18n:no-posts-found%'.split('{}')[1] }}

diff --git a/src/client/app/mobile/views/pages/tag.vue b/src/client/app/mobile/views/pages/tag.vue index c94fcec7da..a545e2b839 100644 --- a/src/client/app/mobile/views/pages/tag.vue +++ b/src/client/app/mobile/views/pages/tag.vue @@ -3,7 +3,7 @@ %fa:hashtag%{{ $route.params.tag }}
-

%fa:search%%i18n:@no-posts-found-english%%i18n:@left-quote%{{ q }}%i18n:@right-quote%%i18n:@no-posts-found-japanese%

+

%fa:search% {{ '%i18n:no-posts-found%'.split('{}')[0] }}{{ q }}{{ '%i18n:no-posts-found%'.split('{}')[1] }}

From ab009cfbd7a220d201a3f656d0e0a7cbbf62f05f Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 2 Aug 2018 09:24:08 +0900 Subject: [PATCH 04/12] :art: --- .../app/common/views/components/messaging-room.message.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/app/common/views/components/messaging-room.message.vue b/src/client/app/common/views/components/messaging-room.message.vue index 65231aed17..648d0eee18 100644 --- a/src/client/app/common/views/components/messaging-room.message.vue +++ b/src/client/app/common/views/components/messaging-room.message.vue @@ -79,7 +79,8 @@ root(isDark) > .content > .balloon - display block + display flex + align-items center padding 0 max-width calc(100% - 16px) min-height 38px @@ -254,7 +255,7 @@ root(isDark) font-size 11px &[data-is-deleted] - > .baloon + > .balloon opacity 0.5 .message[data-darkmode] From bcf854b7bb13ac63d90a554631219de80437476f Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 2 Aug 2018 09:27:30 +0900 Subject: [PATCH 05/12] Clean up --- src/server/api/endpoints/i/notifications.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index b6865fba52..a5f3d23f25 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -41,8 +41,7 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = } const mute = await Mute.find({ - muterId: user._id, - deletedAt: { $exists: false } + muterId: user._id }); const query = { From dfa5cb567f9bf84b28e41830a16fdf3eafb6be98 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 2 Aug 2018 09:29:46 +0900 Subject: [PATCH 06/12] Define new index --- src/models/notification.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/models/notification.ts b/src/models/notification.ts index 097e3e691f..835c89cd56 100644 --- a/src/models/notification.ts +++ b/src/models/notification.ts @@ -5,6 +5,7 @@ import { IUser, pack as packUser } from './user'; import { pack as packNote } from './note'; const Notification = db.get('notifications'); +Notification.createIndex('notifieeId'); export default Notification; export interface INotification { From ce0f6f7ebe7aea9186eefb385733686f8434aafb Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 2 Aug 2018 09:30:57 +0900 Subject: [PATCH 07/12] =?UTF-8?q?type=E6=8C=87=E5=AE=9A=E5=BB=83=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/endpoints/i/notifications.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/server/api/endpoints/i/notifications.ts b/src/server/api/endpoints/i/notifications.ts index a5f3d23f25..46242b9d9f 100644 --- a/src/server/api/endpoints/i/notifications.ts +++ b/src/server/api/endpoints/i/notifications.ts @@ -19,10 +19,6 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = const [markAsRead = true, markAsReadErr] = $.bool.optional.get(params.markAsRead); if (markAsReadErr) return rej('invalid markAsRead param'); - // Get 'type' parameter - const [type, typeErr] = $.arr($.str).optional.unique().get(params.type); - if (typeErr) return rej('invalid type param'); - // Get 'limit' parameter const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit); if (limitErr) return rej('invalid limit param'); @@ -68,12 +64,6 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) = }); } - if (type) { - query.type = { - $in: type - }; - } - if (sinceId) { sort._id = 1; query._id = { From e6915244161ff2fd33aa0f2f9910c212a0b9ebb4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 2 Aug 2018 09:37:13 +0900 Subject: [PATCH 08/12] Fix bug --- src/services/note/create.ts | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/services/note/create.ts b/src/services/note/create.ts index 6e644ef1d3..20dfc78c04 100644 --- a/src/services/note/create.ts +++ b/src/services/note/create.ts @@ -164,14 +164,19 @@ export default async (user: IUser, data: Option, silent = false) => new Promise< } // 通知 - nm.push(data.reply.userId, 'reply'); + if (isLocalUser(data.reply._user)) { + nm.push(data.reply.userId, 'reply'); + } } // If it is renote if (data.renote) { - // Notify const type = data.text ? 'quote' : 'renote'; - nm.push(data.renote.userId, type); + + // Notify + if (isLocalUser(data.renote._user)) { + nm.push(data.renote.userId, type); + } // Fetch watchers nmRelatedPromises.push(notifyToWatchersOfRenotee(data.renote, user, nm, type)); @@ -181,15 +186,9 @@ export default async (user: IUser, data: Option, silent = false) => new Promise< watch(user._id, data.renote); } - // If it is quote renote - if (data.text) { - // Add mention - nm.push(data.renote.userId, 'quote'); - } else { - // Publish event - if (!user._id.equals(data.renote.userId)) { - publishUserStream(data.renote.userId, 'renote', noteObj); - } + // Publish event + if (!user._id.equals(data.renote.userId)) { + publishUserStream(data.renote.userId, 'renote', noteObj); } } From 5c497d7563c70865c83dedaad2ed914bc722bd98 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 2 Aug 2018 09:52:47 +0900 Subject: [PATCH 09/12] :v: --- .../views/components/games/reversi/reversi.game.vue | 8 ++++---- .../views/components/games/reversi/reversi.room.vue | 2 +- .../app/common/views/components/games/reversi/reversi.vue | 8 ++++---- src/misc/get-user-name.ts | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/client/app/common/views/components/games/reversi/reversi.game.vue b/src/client/app/common/views/components/games/reversi/reversi.game.vue index 0c183b343e..de9c0395c7 100644 --- a/src/client/app/common/views/components/games/reversi/reversi.game.vue +++ b/src/client/app/common/views/components/games/reversi/reversi.game.vue @@ -1,14 +1,14 @@