summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2018-07-03 05:29:06 +0900
committerGitHub <noreply@github.com>2018-07-03 05:29:06 +0900
commit2118fc1f0a42acadd39972bf41ce63d4979da101 (patch)
treee568154a0a0843f09224c8c21f03cbc62d65f2fc /src
parentNew translations ja.yml (English) (diff)
parentMerge pull request #1835 from syuilo/greenkeeper/hard-source-webpack-plugin-0... (diff)
downloadsharkey-2118fc1f0a42acadd39972bf41ce63d4979da101.tar.gz
sharkey-2118fc1f0a42acadd39972bf41ce63d4979da101.tar.bz2
sharkey-2118fc1f0a42acadd39972bf41ce63d4979da101.zip
Merge branch 'master' into l10n_master
Diffstat (limited to 'src')
-rw-r--r--src/client/app/common/scripts/get-kao.ts2
-rw-r--r--src/mfm/html.ts4
-rw-r--r--src/mfm/parse/index.ts3
-rw-r--r--src/remote/activitypub/models/person.ts2
-rw-r--r--src/server/api/endpoints.ts2
5 files changed, 8 insertions, 5 deletions
diff --git a/src/client/app/common/scripts/get-kao.ts b/src/client/app/common/scripts/get-kao.ts
index d380187510..645196132b 100644
--- a/src/client/app/common/scripts/get-kao.ts
+++ b/src/client/app/common/scripts/get-kao.ts
@@ -1,5 +1,5 @@
export default () => [
'(=^・・^=)',
- 'v('ω')v',
+ 'v(\'ω\')v',
'🐡( \'-\' 🐡 )フグパンチ!!!!'
][Math.floor(Math.random() * 3)];
diff --git a/src/mfm/html.ts b/src/mfm/html.ts
index 64208af88b..71b4739476 100644
--- a/src/mfm/html.ts
+++ b/src/mfm/html.ts
@@ -92,6 +92,10 @@ const handlers: { [key: string]: (window: any, token: any, mentionedRemoteUsers:
};
export default (tokens: TextElement[], mentionedRemoteUsers: INote['mentionedRemoteUsers'] = []) => {
+ if (tokens == null) {
+ return null;
+ }
+
const { window } = new JSDOM('');
for (const token of tokens) {
diff --git a/src/mfm/parse/index.ts b/src/mfm/parse/index.ts
index 2b6a459b1e..8d71409e58 100644
--- a/src/mfm/parse/index.ts
+++ b/src/mfm/parse/index.ts
@@ -43,8 +43,7 @@ export type TextElement = { type: 'text', content: string }
export type TextElementProcessor = (text: string, i: number) => TextElement | TextElement[];
export default (source: string): TextElement[] => {
-
- if (source == '') {
+ if (source == null || source == '') {
return null;
}
diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts
index 94a6cee0bc..83afd68268 100644
--- a/src/remote/activitypub/models/person.ts
+++ b/src/remote/activitypub/models/person.ts
@@ -52,7 +52,7 @@ export async function createPerson(value: any, resolver?: Resolver): Promise<IUs
}
if (object.type != 'Person' && object.type != 'Service') {
- throw new Error('invalid person: object is not a person or service');
+ throw new Error(`invalid person: object is not a person or service '${object.type}'`);
}
if (typeof object.preferredUsername !== 'string') {
diff --git a/src/server/api/endpoints.ts b/src/server/api/endpoints.ts
index f613710c80..146de67253 100644
--- a/src/server/api/endpoints.ts
+++ b/src/server/api/endpoints.ts
@@ -509,7 +509,7 @@ const endpoints: Endpoint[] = [
withCredential: true,
limit: {
duration: ms('1hour'),
- max: 120,
+ max: 300,
minInterval: ms('1second')
},
kind: 'note-write'