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/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/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, diff --git a/src/client/app/common/views/components/nav.vue b/src/client/app/common/views/components/nav.vue index 1f745bf69..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.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; }); } }); 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/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/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/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/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%
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; + }); } }); 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, 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/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/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; } } 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/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); 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); }