From 30df8ea1213013072f139aa26a635330457cf2bc Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 29 Jul 2020 01:15:02 +0900 Subject: feat(client): AiScript: ノート書き換えAPI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/components/note.vue | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/client/components') diff --git a/src/client/components/note.vue b/src/client/components/note.vue index c3a199a805..a359287b41 100644 --- a/src/client/components/note.vue +++ b/src/client/components/note.vue @@ -35,19 +35,19 @@
- +

- +

({{ $t('private') }}) - + RN:
@@ -114,6 +114,7 @@ import { focusPrev, focusNext } from '../scripts/focus'; import { url } from '../config'; import copyToClipboard from '../scripts/copy-to-clipboard'; import { checkWordMute } from '../scripts/check-word-mute'; +import { utils } from '@syuilo/aiscript'; export default Vue.extend({ model: { @@ -246,6 +247,15 @@ export default Vue.extend({ this.connection = this.$root.stream; } + // plugin + if (this.$store.state.noteViewInterruptors.length > 0) { + let result = this.note; + for (const interruptor of this.$store.state.noteViewInterruptors) { + result = utils.valToJs(await interruptor.handler(JSON.parse(JSON.stringify(result)))); + } + this.$emit('updated', Object.freeze(result)); + } + this.muted = await checkWordMute(this.appearNote, this.$store.state.i, this.$store.state.settings.mutedWords); if (this.detail) { -- cgit v1.2.3-freya