diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-05-17 15:29:18 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-17 15:29:18 +0900 |
| commit | 12cd3714e0d55024131dda8181d2f77ecc83576c (patch) | |
| tree | dd7c03538c4d4beb9b23ee26b059b677d4cd4c6f /src | |
| parent | New translations ja.yml (Korean) (diff) | |
| parent | oops (diff) | |
| download | misskey-12cd3714e0d55024131dda8181d2f77ecc83576c.tar.gz misskey-12cd3714e0d55024131dda8181d2f77ecc83576c.tar.bz2 misskey-12cd3714e0d55024131dda8181d2f77ecc83576c.zip | |
Merge branch 'master' into l10n_master
Diffstat (limited to 'src')
| -rw-r--r-- | src/build/i18n.ts | 17 | ||||
| -rw-r--r-- | src/client/app/desktop/views/components/calendar.vue | 2 | ||||
| -rw-r--r-- | src/client/app/desktop/views/components/timeline.vue | 8 | ||||
| -rw-r--r-- | src/models/user.ts | 3 | ||||
| -rw-r--r-- | src/queue/processors/http/deliver.ts | 2 | ||||
| -rw-r--r-- | src/remote/activitypub/models/person.ts | 5 | ||||
| -rw-r--r-- | src/remote/activitypub/type.ts | 1 | ||||
| -rw-r--r-- | src/text/html.ts | 3 |
8 files changed, 22 insertions, 19 deletions
diff --git a/src/build/i18n.ts b/src/build/i18n.ts index 6c0f633ad9..addc35ce59 100644 --- a/src/build/i18n.ts +++ b/src/build/i18n.ts @@ -7,7 +7,7 @@ import locale from '../../locales'; export default class Replacer { private lang: string; - public pattern = /%i18n:([a-z0-9_\-@\.\!]+?)%/g; + public pattern = /%i18n:([a-z0-9_\-\.\/\|\!]+?)%/g; constructor(lang: string) { this.lang = lang; @@ -53,23 +53,20 @@ export default class Replacer { } } - public replacement(ctx, match, key) { - const client = '/src/client/app/'; - let name = null; + public replacement(match, key) { + let path = null; const shouldEscape = key[0] == '!'; if (shouldEscape) { key = key.substr(1); } - if (key[0] == '@') { - name = ctx.src.substr(ctx.src.indexOf(client) + client.length); - key = key.substr(1); + if (key.indexOf('|') != -1) { + path = key.split('|')[0]; + key = key.split('|')[1]; } - if (ctx && ctx.lang) this.lang = ctx.lang; - - const txt = this.get(name, key); + const txt = this.get(path, key); return shouldEscape ? txt.replace(/'/g, '\\x27').replace(/"/g, '\\x22') diff --git a/src/client/app/desktop/views/components/calendar.vue b/src/client/app/desktop/views/components/calendar.vue index 1d8cc4f3a9..757eefac7e 100644 --- a/src/client/app/desktop/views/components/calendar.vue +++ b/src/client/app/desktop/views/components/calendar.vue @@ -64,7 +64,7 @@ export default Vue.extend({ '%i18n:!common.weekday-short.wednesday%', '%i18n:!common.weekday-short.thursday%', '%i18n:!common.weekday-short.friday%', - '%i18n:!common.weekday-short.satruday%' + '%i18n:!common.weekday-short.saturday%' ] }; }, diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue index 855d032586..a776e40a24 100644 --- a/src/client/app/desktop/views/components/timeline.vue +++ b/src/client/app/desktop/views/components/timeline.vue @@ -1,11 +1,11 @@ <template> <div class="mk-timeline"> <header> - <span :data-active="src == 'home'" @click="src = 'home'">%fa:home% ホーム</span> - <span :data-active="src == 'local'" @click="src = 'local'">%fa:R comments% ローカル</span> - <span :data-active="src == 'global'" @click="src = 'global'">%fa:globe% グローバル</span> + <span :data-active="src == 'home'" @click="src = 'home'">%fa:home% %i18n:@home%</span> + <span :data-active="src == 'local'" @click="src = 'local'">%fa:R comments% %i18n:@local%</span> + <span :data-active="src == 'global'" @click="src = 'global'">%fa:globe% %i18n:@global%</span> <span :data-active="src == 'list'" @click="src = 'list'" v-if="list">%fa:list% {{ list.title }}</span> - <button @click="chooseList" title="リスト">%fa:list%</button> + <button @click="chooseList" title="%i18n:@list%">%fa:list%</button> </header> <x-core v-if="src == 'home'" ref="tl" key="home" src="home"/> <x-core v-if="src == 'local'" ref="tl" key="local" src="local"/> diff --git a/src/models/user.ts b/src/models/user.ts index 352819f618..108111ceca 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -87,6 +87,7 @@ export interface ILocalUser extends IUserBase { export interface IRemoteUser extends IUserBase { inbox: string; + endpoints: string[]; uri: string; url?: string; publicKey: { @@ -114,7 +115,7 @@ export function validatePassword(password: string): boolean { } export function isValidName(name?: string): boolean { - return name === null || (typeof name == 'string' && name.length < 30 && name.trim() != ''); + return name === null || (typeof name == 'string' && name.length < 50 && name.trim() != ''); } export function isValidDescription(description: string): boolean { diff --git a/src/queue/processors/http/deliver.ts b/src/queue/processors/http/deliver.ts index 6810fa4d91..2c4bbe9bf0 100644 --- a/src/queue/processors/http/deliver.ts +++ b/src/queue/processors/http/deliver.ts @@ -14,7 +14,7 @@ export default async (job: kue.Job, done): Promise<void> => { done(); } else { console.warn(`deliver failed: ${res.statusMessage}`); - done(res); + done(res.statusMessage); } } }; diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts index be035097b9..33280f3d89 100644 --- a/src/remote/activitypub/models/person.ts +++ b/src/remote/activitypub/models/person.ts @@ -49,6 +49,7 @@ export async function createPerson(value: any, resolver?: Resolver): Promise<IUs object == null || object.type !== 'Person' || typeof object.preferredUsername !== 'string' || + typeof object.inbox !== 'string' || !validateUsername(object.preferredUsername) || !isValidName(object.name == '' ? null : object.name) ) { @@ -100,6 +101,7 @@ export async function createPerson(value: any, resolver?: Resolver): Promise<IUs publicKeyPem: person.publicKey.publicKeyPem }, inbox: person.inbox, + endpoints: person.endpoints, uri: person.id, url: person.url }) as IRemoteUser; @@ -207,7 +209,8 @@ export async function updatePerson(value: string | IObject, resolver?: Resolver) followingCount, notesCount, name: person.name, - url: person.url + url: person.url, + endpoints: person.endpoints } }); } diff --git a/src/remote/activitypub/type.ts b/src/remote/activitypub/type.ts index 10b29fe607..ca38ec2227 100644 --- a/src/remote/activitypub/type.ts +++ b/src/remote/activitypub/type.ts @@ -50,6 +50,7 @@ export interface IPerson extends IObject { followers: any; following: any; outbox: any; + endpoints: string[]; } export const isCollection = (object: IObject): object is ICollection => diff --git a/src/text/html.ts b/src/text/html.ts index f33ef4997b..40f86e4b2b 100644 --- a/src/text/html.ts +++ b/src/text/html.ts @@ -1,5 +1,6 @@ import { lib as emojilib } from 'emojilib'; import { JSDOM } from 'jsdom'; +import config from '../config'; const handlers = { bold({ document }, { bold }) { @@ -43,7 +44,7 @@ const handlers = { mention({ document }, { content }) { const a = document.createElement('a'); - a.href = '/' + content; + a.href = `${config.url}/${content}`; a.textContent = content; document.body.appendChild(a); }, |