summaryrefslogtreecommitdiff
path: root/src/client/components/note.vue
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2020-07-27 13:34:20 +0900
committerGitHub <noreply@github.com>2020-07-27 13:34:20 +0900
commitcf43dd6ec530ba4a3f589ae917e89533b352f6a3 (patch)
tree76f35d06299b40370ec061ee5ed58182847d2e6e /src/client/components/note.vue
parentrefactor(client): Do not mutate prop directly (diff)
downloadmisskey-cf43dd6ec530ba4a3f589ae917e89533b352f6a3.tar.gz
misskey-cf43dd6ec530ba4a3f589ae917e89533b352f6a3.tar.bz2
misskey-cf43dd6ec530ba4a3f589ae917e89533b352f6a3.zip
ワードミュート (#6594)
* wip * wip * wip * wip * wip * wip * wip * wip * wip
Diffstat (limited to 'src/client/components/note.vue')
-rw-r--r--src/client/components/note.vue27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/client/components/note.vue b/src/client/components/note.vue
index dc3cce9e57..9bbf763494 100644
--- a/src/client/components/note.vue
+++ b/src/client/components/note.vue
@@ -1,6 +1,7 @@
<template>
<div
class="note _panel"
+ v-if="!muted"
v-show="!isDeleted"
:tabindex="!isDeleted ? '-1' : null"
:class="{ renote: isRenote }"
@@ -84,6 +85,13 @@
</article>
<x-sub v-for="note in replies" :key="note.id" :note="note" class="reply" :detail="true"/>
</div>
+<div v-else class="_panel muted" @click="muted = false">
+ <i18n path="userSaysSomething" tag="small">
+ <router-link class="name" :to="appearNote.user | userPage" v-user-preview="appearNote.userId" place="name">
+ <mk-user-name :user="appearNote.user"/>
+ </router-link>
+ </i18n>
+</div>
</template>
<script lang="ts">
@@ -105,6 +113,7 @@ import pleaseLogin from '../scripts/please-login';
import { focusPrev, focusNext } from '../scripts/focus';
import { url } from '../config';
import copyToClipboard from '../scripts/copy-to-clipboard';
+import { checkWordMute } from '../scripts/check-word-mute';
export default Vue.extend({
components: {
@@ -142,6 +151,7 @@ export default Vue.extend({
replies: [],
showContent: false,
isDeleted: false,
+ muted: false,
myReaction: null,
reactions: {},
emojis: [],
@@ -227,15 +237,16 @@ export default Vue.extend({
}
},
- created() {
- this.emojis = [...this.appearNote.emojis];
- this.reactions = { ...this.appearNote.reactions };
- this.myReaction = this.appearNote.myReaction;
-
+ async created() {
if (this.$store.getters.isSignedIn) {
this.connection = this.$root.stream;
}
+ this.emojis = [...this.appearNote.emojis];
+ this.reactions = { ...this.appearNote.reactions };
+ this.myReaction = this.appearNote.myReaction;
+ this.muted = await checkWordMute(this.appearNote, this.$store.state.i, this.$store.state.settings.mutedWords);
+
if (this.detail) {
this.$root.api('notes/children', {
noteId: this.appearNote.id,
@@ -976,4 +987,10 @@ export default Vue.extend({
}
}
}
+
+.muted {
+ padding: 8px;
+ text-align: center;
+ opacity: 0.7;
+}
</style>