mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 05:57:32 -07:00
Refactor
This commit is contained in:
parent
f058f40162
commit
69868d93eb
1 changed files with 4 additions and 4 deletions
|
@ -112,17 +112,17 @@ export default async (user: User, data: Option, silent = false) => new Promise<N
|
|||
if (data.localOnly == null) data.localOnly = false;
|
||||
|
||||
// サイレンス
|
||||
if (user.isSilenced && data.visibility == 'public') {
|
||||
if (user.isSilenced && data.visibility === 'public') {
|
||||
data.visibility = 'home';
|
||||
}
|
||||
|
||||
// Renote対象が「ホームまたは全体」以外の公開範囲ならreject
|
||||
if (data.renote && data.renote.visibility != 'public' && data.renote.visibility != 'home' && data.renote.userId !== user.id) {
|
||||
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');
|
||||
}
|
||||
|
||||
// Renote対象がpublicではないならhomeにする
|
||||
if (data.renote && data.renote.visibility != 'public' && data.visibility == 'public') {
|
||||
if (data.renote && data.renote.visibility !== 'public' && data.visibility === 'public') {
|
||||
data.visibility = 'home';
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ export default async (user: User, data: Option, silent = false) => new Promise<N
|
|||
}
|
||||
|
||||
// 返信対象が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';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue