diff options
| -rw-r--r-- | .config/example.yml | 3 | ||||
| -rw-r--r-- | locales/ja-JP.yml | 1 | ||||
| -rw-r--r-- | src/client/app/common/views/components/nav.vue | 4 | ||||
| -rw-r--r-- | src/client/app/desktop/views/components/settings.vue | 7 | ||||
| -rw-r--r-- | src/client/app/desktop/views/components/ui.header.vue | 2 | ||||
| -rw-r--r-- | src/client/app/desktop/views/components/user-preview.vue | 2 | ||||
| -rw-r--r-- | src/client/app/store.ts | 1 | ||||
| -rw-r--r-- | src/config/types.ts | 2 | ||||
| -rw-r--r-- | src/mfm/parse/core/syntax-highlighter.ts | 2 | ||||
| -rw-r--r-- | src/mfm/parse/elements/hashtag.ts | 2 | ||||
| -rw-r--r-- | src/mfm/parse/elements/link.ts | 2 | ||||
| -rw-r--r-- | src/misc/fa.ts | 4 | ||||
| -rw-r--r-- | src/queue/processors/http/process-inbox.ts | 2 | ||||
| -rw-r--r-- | src/server/api/common/is-native-token.ts | 2 | ||||
| -rw-r--r-- | src/server/web/url-preview.ts | 11 | ||||
| -rw-r--r-- | webpack/i18n.ts | 2 |
16 files changed, 36 insertions, 13 deletions
diff --git a/.config/example.yml b/.config/example.yml index 9ea048f70b..ecb1dd1934 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 238f1fbecb..55f08d1fcf 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/common/views/components/nav.vue b/src/client/app/common/views/components/nav.vue index 1f745bf69d..e5079045b6 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 df131a1a65..7d6f1d55fb 100644 --- a/src/client/app/desktop/views/components/settings.vue +++ b/src/client/app/desktop/views/components/settings.vue @@ -49,6 +49,7 @@ </div> <mk-switch v-model="$store.state.settings.showPostFormOnTopOfTl" @change="onChangeShowPostFormOnTopOfTl" text="%i18n:@post-form-on-timeline%"/> <mk-switch v-model="$store.state.settings.suggestRecentHashtags" @change="onChangeSuggestRecentHashtags" text="%i18n:@suggest-recent-hashtags%"/> + <mk-switch v-model="$store.state.settings.showClockOnHeader" @change="onChangeShowClockOnHeader" text="%i18n:@show-clock-on-header%"/> <mk-switch v-model="$store.state.settings.showReplyTarget" @change="onChangeShowReplyTarget" text="%i18n:@show-reply-target%"/> <mk-switch v-model="$store.state.settings.showMyRenotes" @change="onChangeShowMyRenotes" text="%i18n:@show-my-renotes%"/> <mk-switch v-model="$store.state.settings.showRenotedMyNotes" @change="onChangeShowRenotedMyNotes" text="%i18n:@show-renoted-my-notes%"/> @@ -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 edd9829c1c..6de4eaf744 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 @@ <x-account v-if="$store.getters.isSignedIn"/> <x-notifications v-if="$store.getters.isSignedIn"/> <x-post v-if="$store.getters.isSignedIn"/> - <x-clock/> + <x-clock v-if="$store.state.settings.showClockOnHeader"/> </div> </div> </div> diff --git a/src/client/app/desktop/views/components/user-preview.vue b/src/client/app/desktop/views/components/user-preview.vue index 7ef8dff5be..1e1755ec3c 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/store.ts b/src/client/app/store.ts index ba91a11f25..0f3ff4a380 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 f220e15822..a1dc9a5bd4 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 3fb7a3b73d..2b13608d2b 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: `<span class="regexp">/${escape(regexp)}/</span>`, diff --git a/src/mfm/parse/elements/hashtag.ts b/src/mfm/parse/elements/hashtag.ts index 129041774f..f4b6a78fa8 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 b353aebc5c..796aeb1ab3 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 077bb51e6d..8be06362c3 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 0738853dd1..c9c2fa72cb 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<void> => { // アクティビティを送信してきたユーザーがまだ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 0769a4812e..6afbc99ab5 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 e96eb309fe..41ca6bad8b 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 f73af72584..4fd439d1d5 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); } |