From 385fb7586bd941b144b4857fea84dcb5b4832a9d Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sat, 25 Aug 2018 22:07:10 +0900 Subject: [PATCH 1/9] Use pencil-alt instead of pen --- src/client/app/desktop/views/pages/admin/admin.dashboard.vue | 4 ++-- src/client/app/desktop/views/pages/stats/stats.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/app/desktop/views/pages/admin/admin.dashboard.vue b/src/client/app/desktop/views/pages/admin/admin.dashboard.vue index fbb9f1818..ebb54d782 100644 --- a/src/client/app/desktop/views/pages/admin/admin.dashboard.vue +++ b/src/client/app/desktop/views/pages/admin/admin.dashboard.vue @@ -4,8 +4,8 @@
%fa:user% {{ stats.originalUsersCount | number }}%i18n:@original-users%
%fa:user% {{ stats.usersCount | number }}%i18n:@all-users%
-
%fa:pen% {{ stats.originalNotesCount | number }}%i18n:@original-notes%
-
%fa:pen% {{ stats.notesCount | number }}%i18n:@all-notes%
+
%fa:pencil-alt% {{ stats.originalNotesCount | number }}%i18n:@original-notes%
+
%fa:pencil-alt% {{ stats.notesCount | number }}%i18n:@all-notes%
diff --git a/src/client/app/desktop/views/pages/stats/stats.vue b/src/client/app/desktop/views/pages/stats/stats.vue index 5b1d780ae..6fcbf069e 100644 --- a/src/client/app/desktop/views/pages/stats/stats.vue +++ b/src/client/app/desktop/views/pages/stats/stats.vue @@ -3,8 +3,8 @@
%fa:user% {{ stats.originalUsersCount | number }}%i18n:@original-users%
%fa:user% {{ stats.usersCount | number }}%i18n:@all-users%
-
%fa:pen% {{ stats.originalNotesCount | number }}%i18n:@original-notes%
-
%fa:pen% {{ stats.notesCount | number }}%i18n:@all-notes%
+
%fa:pencil-alt% {{ stats.originalNotesCount | number }}%i18n:@original-notes%
+
%fa:pencil-alt% {{ stats.notesCount | number }}%i18n:@all-notes%
From 483a61d90d2ea6fed3bfd58568bec4b60b0948d6 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sat, 25 Aug 2018 22:24:58 +0900 Subject: [PATCH 2/9] Make clock on header optional --- locales/ja-JP.yml | 1 + src/client/app/desktop/views/components/settings.vue | 7 +++++++ src/client/app/desktop/views/components/ui.header.vue | 2 +- src/client/app/store.ts | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 238f1fbec..55f08d1fc 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -732,6 +732,7 @@ desktop/views/components/settings.vue: gradient-window-header: "ウィンドウのタイトルバーにグラデーションを使用" post-form-on-timeline: "タイムライン上部に投稿フォームを表示する" suggest-recent-hashtags: "最近のハッシュタグを投稿フォームに表示する" + show-clock-on-header: "右上に時計を表示する" show-reply-target: "リプライ先を表示する" show-my-renotes: "自分の行ったRenoteをタイムラインに表示する" show-renoted-my-notes: "自分の投稿のRenoteをタイムラインに表示する" diff --git a/src/client/app/desktop/views/components/settings.vue b/src/client/app/desktop/views/components/settings.vue index df131a1a6..7d6f1d55f 100644 --- a/src/client/app/desktop/views/components/settings.vue +++ b/src/client/app/desktop/views/components/settings.vue @@ -49,6 +49,7 @@
+ @@ -333,6 +334,12 @@ export default Vue.extend({ value: v }); }, + onChangeShowClockOnHeader(v) { + this.$store.dispatch('settings/set', { + key: 'showClockOnHeader', + value: v + }); + }, onChangeShowReplyTarget(v) { this.$store.dispatch('settings/set', { key: 'showReplyTarget', diff --git a/src/client/app/desktop/views/components/ui.header.vue b/src/client/app/desktop/views/components/ui.header.vue index edd9829c1..6de4eaf74 100644 --- a/src/client/app/desktop/views/components/ui.header.vue +++ b/src/client/app/desktop/views/components/ui.header.vue @@ -17,7 +17,7 @@ - +
diff --git a/src/client/app/store.ts b/src/client/app/store.ts index ba91a11f2..0f3ff4a38 100644 --- a/src/client/app/store.ts +++ b/src/client/app/store.ts @@ -13,6 +13,7 @@ const defaultSettings = { showMaps: true, showPostFormOnTopOfTl: false, suggestRecentHashtags: true, + showClockOnHeader: false, circleIcons: true, gradientWindowHeader: false, showReplyTarget: true, From a09a244242b9a81d6ad8a4194d586a3403892aff Mon Sep 17 00:00:00 2001 From: mei23 Date: Sat, 25 Aug 2018 22:25:40 +0900 Subject: [PATCH 3/9] Fix resolvePerson key --- src/queue/processors/http/process-inbox.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/queue/processors/http/process-inbox.ts b/src/queue/processors/http/process-inbox.ts index 0738853dd..c9c2fa72c 100644 --- a/src/queue/processors/http/process-inbox.ts +++ b/src/queue/processors/http/process-inbox.ts @@ -46,7 +46,7 @@ export default async (job: bq.Job, done: any): Promise => { // アクティビティを送信してきたユーザーがまだMisskeyサーバーに登録されていなかったら登録する if (user === null) { - user = await resolvePerson(signature.keyId) as IRemoteUser; + user = await resolvePerson(activity.actor) as IRemoteUser; } } From 08a59591ae25280cf11e49d0f5eab4d5a438e147 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sat, 25 Aug 2018 22:42:26 +0900 Subject: [PATCH 4/9] Use startsWith and endsWith for readability --- src/client/app/desktop/views/components/user-preview.vue | 2 +- src/mfm/parse/core/syntax-highlighter.ts | 2 +- src/mfm/parse/elements/hashtag.ts | 2 +- src/mfm/parse/elements/link.ts | 2 +- src/misc/fa.ts | 4 ++-- src/server/api/common/is-native-token.ts | 2 +- webpack/i18n.ts | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client/app/desktop/views/components/user-preview.vue b/src/client/app/desktop/views/components/user-preview.vue index 7ef8dff5b..1e1755ec3 100644 --- a/src/client/app/desktop/views/components/user-preview.vue +++ b/src/client/app/desktop/views/components/user-preview.vue @@ -48,7 +48,7 @@ export default Vue.extend({ this.open(); }); } else { - const query = this.user[0] == '@' ? + const query = this.user.startsWith('@') ? parseAcct(this.user.substr(1)) : { userId: this.user }; diff --git a/src/mfm/parse/core/syntax-highlighter.ts b/src/mfm/parse/core/syntax-highlighter.ts index 3fb7a3b73..2b13608d2 100644 --- a/src/mfm/parse/core/syntax-highlighter.ts +++ b/src/mfm/parse/core/syntax-highlighter.ts @@ -197,7 +197,7 @@ const elements: Element[] = [ if (thisIsNotARegexp) return null; if (regexp == '') return null; - if (regexp[0] == ' ' && regexp[regexp.length - 1] == ' ') return null; + if (regexp.startsWith(' ') && regexp.endsWith(' ')) return null; return { html: `/${escape(regexp)}/`, diff --git a/src/mfm/parse/elements/hashtag.ts b/src/mfm/parse/elements/hashtag.ts index 129041774..f4b6a78fa 100644 --- a/src/mfm/parse/elements/hashtag.ts +++ b/src/mfm/parse/elements/hashtag.ts @@ -10,7 +10,7 @@ export type TextElementHashtag = { export default function(text: string, i: number) { if (!(/^\s#[^\s]+/.test(text) || (i == 0 && /^#[^\s]+/.test(text)))) return null; - const isHead = text[0] == '#'; + const isHead = text.startsWith('#'); const hashtag = text.match(/^\s?#[^\s]+/)[0]; const res: any[] = !isHead ? [{ type: 'text', diff --git a/src/mfm/parse/elements/link.ts b/src/mfm/parse/elements/link.ts index b353aebc5..796aeb1ab 100644 --- a/src/mfm/parse/elements/link.ts +++ b/src/mfm/parse/elements/link.ts @@ -13,7 +13,7 @@ export type TextElementLink = { export default function(text: string) { const match = text.match(/^\??\[([^\[\]]+?)\]\((https?:\/\/[\w\/:%#@\$&\?!\(\)\[\]~\.=\+\-]+?)\)/); if (!match) return null; - const silent = text[0] == '?'; + const silent = text.startsWith('?'); const link = match[0]; const title = match[1]; const url = match[2]; diff --git a/src/misc/fa.ts b/src/misc/fa.ts index 077bb51e6..8be06362c 100644 --- a/src/misc/fa.ts +++ b/src/misc/fa.ts @@ -25,9 +25,9 @@ export const replacement = (match: string, key: string) => { arg == 'S' ? 'fas' : arg == 'B' ? 'fab' : ''; - } else if (arg[0] == '.') { + } else if (arg.startsWith('.')) { classes.push('fa-' + arg.substr(1)); - } else if (arg[0] == '-') { + } else if (arg.startsWith('-')) { transform = arg.substr(1).split('|').join(' '); } else { name = arg; diff --git a/src/server/api/common/is-native-token.ts b/src/server/api/common/is-native-token.ts index 0769a4812..6afbc99ab 100644 --- a/src/server/api/common/is-native-token.ts +++ b/src/server/api/common/is-native-token.ts @@ -1 +1 @@ -export default (token: string) => token[0] == '!'; +export default (token: string) => token.startsWith('!'); diff --git a/webpack/i18n.ts b/webpack/i18n.ts index f73af7258..4fd439d1d 100644 --- a/webpack/i18n.ts +++ b/webpack/i18n.ts @@ -8,7 +8,7 @@ export const replacement = (ctx: any, _: any, key: string) => { const client = '/src/client/app/'; let name = null; - if (key[0] == '@') { + if (key.startsWith('@')) { name = ctx.src.substr(ctx.src.indexOf(client) + client.length); key = key.substr(1); } From fa7c8cfe5bdf251b679ed6e87777cdd2ec7f600d Mon Sep 17 00:00:00 2001 From: xps2 <9610872+xps2@users.noreply.github.com> Date: Sun, 26 Aug 2018 01:00:13 +0900 Subject: [PATCH 5/9] =?UTF-8?q?=E3=83=AA=E3=83=9D=E3=82=B8=E3=83=88?= =?UTF-8?q?=E3=83=AA=E3=81=A8=E3=83=95=E3=82=A3=E3=83=BC=E3=83=89=E3=83=90?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=81=AEURL=E3=81=8C=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=8B=E3=82=89=E5=8F=8D?= =?UTF-8?q?=E6=98=A0=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/common/views/components/nav.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/app/common/views/components/nav.vue b/src/client/app/common/views/components/nav.vue index 1f745bf69..e5079045b 100644 --- a/src/client/app/common/views/components/nav.vue +++ b/src/client/app/common/views/components/nav.vue @@ -26,8 +26,8 @@ export default Vue.extend({ }, created() { (this as any).os.getMeta().then(meta => { - if (meta.repositoryUrl) this.repositoryUrl = meta.repositoryUrl; - if (meta.feedbackUrl) this.feedbackUrl = meta.feedbackUrl; + if (meta.maintainer.repository_url) this.repositoryUrl = meta.maintainer.repository_url; + if (meta.maintainer.feedback_url) this.feedbackUrl = meta.maintainer.feedback_url; }); } }); From c56ff5d88db282547a304456892dcacac2b0a490 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 26 Aug 2018 01:56:21 +0900 Subject: [PATCH 6/9] Add sunnaly proxy option --- .config/example.yml | 3 +++ src/config/types.ts | 2 ++ src/server/web/url-preview.ts | 11 ++++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.config/example.yml b/.config/example.yml index 9ea048f70..ecb1dd193 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -138,3 +138,6 @@ drive: # Clustering # clusterLimit: 1 + +# Summaly proxy +# summalyProxy: "http://example.com" diff --git a/src/config/types.ts b/src/config/types.ts index f220e1582..a1dc9a5bd 100644 --- a/src/config/types.ts +++ b/src/config/types.ts @@ -62,6 +62,8 @@ export type Source = { */ ghost?: string; + summalyProxy?: string; + accesslog?: string; twitter?: { consumer_key: string; diff --git a/src/server/web/url-preview.ts b/src/server/web/url-preview.ts index e96eb309f..41ca6bad8 100644 --- a/src/server/web/url-preview.ts +++ b/src/server/web/url-preview.ts @@ -1,11 +1,20 @@ import * as Koa from 'koa'; +import * as request from 'request-promise-native'; import summaly from 'summaly'; +import config from '../../config'; module.exports = async (ctx: Koa.Context) => { try { - const summary = await summaly(ctx.query.url, { + const summary = config.summalyProxy ? await request.get({ + url: config.summalyProxy, + qs: { + url: ctx.query.url + }, + json: true + }) : await summaly(ctx.query.url, { followRedirects: false }); + summary.icon = wrap(summary.icon); summary.thumbnail = wrap(summary.thumbnail); From 58da32358b25680ebaf304e3ea76ea659f89dedb Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 26 Aug 2018 02:05:13 +0900 Subject: [PATCH 7/9] Fix indent --- src/client/app/common/views/components/nav.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/app/common/views/components/nav.vue b/src/client/app/common/views/components/nav.vue index e5079045b..27e66358e 100644 --- a/src/client/app/common/views/components/nav.vue +++ b/src/client/app/common/views/components/nav.vue @@ -26,8 +26,8 @@ export default Vue.extend({ }, created() { (this as any).os.getMeta().then(meta => { - if (meta.maintainer.repository_url) this.repositoryUrl = meta.maintainer.repository_url; - if (meta.maintainer.feedback_url) this.feedbackUrl = meta.maintainer.feedback_url; + if (meta.maintainer.repository_url) this.repositoryUrl = meta.maintainer.repository_url; + if (meta.maintainer.feedback_url) this.feedbackUrl = meta.maintainer.feedback_url; }); } }); From 6677508ba7c0f08c8d8c472e911da2d57bc4948c Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 26 Aug 2018 02:05:42 +0900 Subject: [PATCH 8/9] Fix #2428 --- src/client/app/desktop/views/pages/share.vue | 7 ++++++- src/client/app/mobile/views/pages/share.vue | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/client/app/desktop/views/pages/share.vue b/src/client/app/desktop/views/pages/share.vue index 4dd608069..69ecbf115 100644 --- a/src/client/app/desktop/views/pages/share.vue +++ b/src/client/app/desktop/views/pages/share.vue @@ -16,7 +16,7 @@ import Vue from 'vue'; export default Vue.extend({ data() { return { - name: (this as any).os.instanceName, + name: null, posted: false, text: new URLSearchParams(location.search).get('text') }; @@ -25,6 +25,11 @@ export default Vue.extend({ close() { window.close(); } + }, + mounted() { + (this as any).os.getMeta().then(meta => { + this.name = meta.name; + }); } }); diff --git a/src/client/app/mobile/views/pages/share.vue b/src/client/app/mobile/views/pages/share.vue index 588b0941e..d75763c52 100644 --- a/src/client/app/mobile/views/pages/share.vue +++ b/src/client/app/mobile/views/pages/share.vue @@ -16,7 +16,7 @@ import Vue from 'vue'; export default Vue.extend({ data() { return { - name: (this as any).os.instanceName, + name: null, posted: false, text: new URLSearchParams(location.search).get('text') }; @@ -25,6 +25,11 @@ export default Vue.extend({ close() { window.close(); } + }, + mounted() { + (this as any).os.getMeta().then(meta => { + this.name = meta.name; + }); } }); From ecf2eb473817779172f9dbaab34635461f52c676 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 26 Aug 2018 02:33:04 +0900 Subject: [PATCH 9/9] 8.14.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8562e6f6c..8bde6935b 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "misskey", "author": "syuilo ", - "version": "8.13.0", - "clientVersion": "1.0.9001", + "version": "8.14.0", + "clientVersion": "1.0.9022", "codename": "nighthike", "main": "./built/index.js", "private": true,