Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into merge-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
taiyme committed Apr 26, 2024
2 parents e44a64b + 85339ca commit 8e2a2b9
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 68 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- Enhance: リプライにて引用がある場合テキストが空でもノートできるように
- 引用したいノートのURLをコピーしリプライ投稿画面にペーストして添付することで達成できます
- Enhance: フォローするかどうかの確認ダイアログを出せるように
- Chore: AiScriptを0.18.0にバージョンアップ
- Fix: 一部のページ内リンクが正しく動作しない問題を修正
- Fix: 周年の実績が閏年を考慮しない問題を修正
- Fix: ローカルURLのプレビューポップアップが左上に表示される
Expand Down
14 changes: 11 additions & 3 deletions packages/backend/src/server/ServerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,20 @@ export class ServerService implements OnApplicationShutdown {
return;
}

const name = path.split('@')[0].replace(/\.webp$/i, '');
const host = path.split('@')[1]?.replace(/\.webp$/i, '');
const emojiPath = path.replace(/\.webp$/i, '');
const pathChunks = emojiPath.split('@');

if (pathChunks.length > 2) {
reply.code(400);
return;
}

const name = pathChunks.shift();
const host = pathChunks.pop();

const emoji = await this.emojisRepository.findOneBy({
// `@.` is the spec of ReactionService.decodeReaction
host: (host == null || host === '.') ? IsNull() : host,
host: (host === undefined || host === '.') ? IsNull() : host,
name: name,
});

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@rollup/plugin-json": "6.1.0",
"@rollup/plugin-replace": "5.0.5",
"@rollup/pluginutils": "5.1.0",
"@syuilo/aiscript": "0.17.0",
"@syuilo/aiscript": "0.18.0",
"@tabler/icons-webfont": "2.44.0",
"@twemoji/parser": "15.0.0",
"@vitejs/plugin-vue": "5.0.4",
Expand Down
34 changes: 17 additions & 17 deletions packages/frontend/src/pages/flash/flash-edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import MkInput from '@/components/MkInput.vue';
import MkSelect from '@/components/MkSelect.vue';
import { useRouter } from '@/router/supplier.js';
const PRESET_DEFAULT = `/// @ 0.16.0
const PRESET_DEFAULT = `/// @ 0.18.0
var name = ""
Expand All @@ -60,13 +60,13 @@ Ui:render([
Ui:C:button({
text: "Hello"
onClick: @() {
Mk:dialog(null \`Hello, {name}!\`)
Mk:dialog(null, \`Hello, {name}!\`)
}
})
])
`;
const PRESET_OMIKUJI = `/// @ 0.16.0
const PRESET_OMIKUJI = `/// @ 0.18.0
// ユーザーごとに日替わりのおみくじのプリセット
// 選択肢
Expand All @@ -81,11 +81,11 @@ let choices = [
"大凶"
]
// シードが「ユーザーID+今日の日付」である乱数生成器を用意
let random = Math:gen_rng(\`{USER_ID}{Date:year()}{Date:month()}{Date:day()}\`)
// シードが「PlayID+ユーザーID+今日の日付」である乱数生成器を用意
let random = Math:gen_rng(\`{THIS_ID}{USER_ID}{Date:year()}{Date:month()}{Date:day()}\`)
// ランダムに選択肢を選ぶ
let chosen = choices[random(0 (choices.len - 1))]
let chosen = choices[random(0, (choices.len - 1))]
// 結果のテキスト
let result = \`今日のあなたの運勢は **{chosen}** です。\`
Expand All @@ -109,7 +109,7 @@ Ui:render([
])
`;
const PRESET_SHUFFLE = `/// @ 0.16.0
const PRESET_SHUFFLE = `/// @ 0.18.0
// 巻き戻し可能な文字シャッフルのプリセット
let string = "ペペロンチーノ"
Expand All @@ -123,13 +123,13 @@ var cursor = 0
@do() {
if (cursor != 0) {
results = results.slice(0 (cursor + 1))
results = results.slice(0, (cursor + 1))
cursor = 0
}
let chars = []
for (let i, length) {
let r = Math:rnd(0 (length - 1))
let r = Math:rnd(0, (length - 1))
chars.push(string.pick(r))
}
let result = chars.join("")
Expand Down Expand Up @@ -188,27 +188,27 @@ var cursor = 0
do()
`;
const PRESET_QUIZ = `/// @ 0.16.0
const PRESET_QUIZ = `/// @ 0.18.0
let title = '地理クイズ'
let qas = [{
q: 'オーストラリアの首都は?'
choices: ['シドニー' 'キャンベラ' 'メルボルン']
choices: ['シドニー', 'キャンベラ', 'メルボルン']
a: 'キャンベラ'
aDescription: '最大の都市はシドニーですが首都はキャンベラです。'
} {
q: '国土面積2番目の国は?'
choices: ['カナダ' 'アメリカ' '中国']
choices: ['カナダ', 'アメリカ', '中国']
a: 'カナダ'
aDescription: '大きい順にロシア、カナダ、アメリカ、中国です。'
} {
q: '二重内陸国ではないのは?'
choices: ['リヒテンシュタイン' 'ウズベキスタン' 'レソト']
choices: ['リヒテンシュタイン', 'ウズベキスタン', 'レソト']
a: 'レソト'
aDescription: 'レソトは(一重)内陸国です。'
} {
q: '閘門がない運河は?'
choices: ['キール運河' 'スエズ運河' 'パナマ運河']
choices: ['キール運河', 'スエズ運河', 'パナマ運河']
a: 'スエズ運河'
aDescription: 'スエズ運河は高低差がないので閘門はありません。'
}]
Expand Down Expand Up @@ -296,12 +296,12 @@ qaEls.push(Ui:C:container({
onClick: finish
})
]
} 'footer'))
}, 'footer'))
Ui:render(qaEls)
`;
const PRESET_TIMELINE = `/// @ 0.16.0
const PRESET_TIMELINE = `/// @ 0.18.0
// APIリクエストを行いローカルタイムラインを表示するプリセット
@fetch() {
Expand All @@ -315,7 +315,7 @@ const PRESET_TIMELINE = `/// @ 0.16.0
])
// タイムライン取得
let notes = Mk:api("notes/local-timeline" {})
let notes = Mk:api("notes/local-timeline", {})
// それぞれのノートごとにUI要素作成
let noteEls = []
Expand Down
Loading

0 comments on commit 8e2a2b9

Please sign in to comment.