From 7c714f57889b7e56cf7f53f0453de45d36541143 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 10 May 2019 14:18:18 +0900 Subject: [PATCH] Improve MisskeyPages --- src/misc/aiscript/evaluator.ts | 5 +++-- src/misc/aiscript/index.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/misc/aiscript/evaluator.ts b/src/misc/aiscript/evaluator.ts index 2100b565d4..664e0037ab 100644 --- a/src/misc/aiscript/evaluator.ts +++ b/src/misc/aiscript/evaluator.ts @@ -31,7 +31,7 @@ export class ASEvaluator { VERSION: opts.version, URL: opts.page ? `${opts.url}/@${opts.page.user.username}/pages/${opts.page.name}` : '', LOGIN: opts.visitor != null, - NAME: opts.visitor ? opts.visitor.name : '', + NAME: opts.visitor ? opts.visitor.name || opts.visitor.username : '', USERNAME: opts.visitor ? opts.visitor.username : '', USERID: opts.visitor ? opts.visitor.id : '', NOTES_COUNT: opts.visitor ? opts.visitor.notesCount : 0, @@ -42,7 +42,8 @@ export class ASEvaluator { MY_FOLLOWERS_COUNT: opts.user ? opts.user.followersCount : 0, MY_FOLLOWING_COUNT: opts.user ? opts.user.followingCount : 0, SEED: opts.randomSeed ? opts.randomSeed : '', - YMD: `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}` + YMD: `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`, + NULL: null }; } diff --git a/src/misc/aiscript/index.ts b/src/misc/aiscript/index.ts index 4e1d5591f4..236b332da7 100644 --- a/src/misc/aiscript/index.ts +++ b/src/misc/aiscript/index.ts @@ -127,6 +127,7 @@ export const envVarsDef: Record = { MY_FOLLOWING_COUNT: 'number', SEED: null, YMD: 'string', + NULL: null, }; export function isLiteralBlock(v: Block) {