mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-15 09:15:44 +01:00
Resolve #5958
This commit is contained in:
parent
518bc92673
commit
02ac30c0d0
2 changed files with 11 additions and 2 deletions
|
@ -58,7 +58,7 @@
|
||||||
<template v-else><fa :icon="faReply"/></template>
|
<template v-else><fa :icon="faReply"/></template>
|
||||||
<p class="count" v-if="appearNote.repliesCount > 0">{{ appearNote.repliesCount }}</p>
|
<p class="count" v-if="appearNote.repliesCount > 0">{{ appearNote.repliesCount }}</p>
|
||||||
</button>
|
</button>
|
||||||
<button v-if="['public', 'home'].includes(appearNote.visibility)" @click="renote()" class="button _button" ref="renoteButton">
|
<button v-if="canRenote" @click="renote()" class="button _button" ref="renoteButton">
|
||||||
<fa :icon="faRetweet"/><p class="count" v-if="appearNote.renoteCount > 0">{{ appearNote.renoteCount }}</p>
|
<fa :icon="faRetweet"/><p class="count" v-if="appearNote.renoteCount > 0">{{ appearNote.renoteCount }}</p>
|
||||||
</button>
|
</button>
|
||||||
<button v-else class="button _button">
|
<button v-else class="button _button">
|
||||||
|
@ -190,6 +190,10 @@ export default Vue.extend({
|
||||||
return this.$store.getters.isSignedIn && (this.$store.state.i.id === this.appearNote.userId);
|
return this.$store.getters.isSignedIn && (this.$store.state.i.id === this.appearNote.userId);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
canRenote(): boolean {
|
||||||
|
return ['public', 'home'].includes(this.appearNote.visibility) || this.isMyNote;
|
||||||
|
},
|
||||||
|
|
||||||
reactionsCount(): number {
|
reactionsCount(): number {
|
||||||
return this.appearNote.reactions
|
return this.appearNote.reactions
|
||||||
? sum(Object.values(this.appearNote.reactions))
|
? sum(Object.values(this.appearNote.reactions))
|
||||||
|
|
|
@ -117,7 +117,7 @@ export default async (user: User, data: Option, silent = false) => new Promise<N
|
||||||
}
|
}
|
||||||
|
|
||||||
// Renote対象が「ホームまたは全体」以外の公開範囲ならreject
|
// Renote対象が「ホームまたは全体」以外の公開範囲ならreject
|
||||||
if (data.renote && data.renote.visibility != 'public' && data.renote.visibility != 'home') {
|
if (data.renote && data.renote.visibility != 'public' && data.renote.visibility != 'home' && data.renote.userId !== user.id) {
|
||||||
return rej('Renote target is not public or home');
|
return rej('Renote target is not public or home');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,6 +126,11 @@ export default async (user: User, data: Option, silent = false) => new Promise<N
|
||||||
data.visibility = 'home';
|
data.visibility = 'home';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Renote対象がfollowersならfollowersにする
|
||||||
|
if (data.renote && data.renote.visibility === 'followers') {
|
||||||
|
data.visibility = 'followers';
|
||||||
|
}
|
||||||
|
|
||||||
// 返信対象がpublicではないならhomeにする
|
// 返信対象がpublicではないならhomeにする
|
||||||
if (data.reply && data.reply.visibility != 'public' && data.visibility == 'public') {
|
if (data.reply && data.reply.visibility != 'public' && data.visibility == 'public') {
|
||||||
data.visibility = 'home';
|
data.visibility = 'home';
|
||||||
|
|
Loading…
Reference in a new issue