View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/420 Approved-by: Leah <kevinlukej@gmail.com> Approved-by: Amelia Yukii <amelia.yukii@shourai.de> Approved-by: Marie <marie@kaifa.ch>
This commit is contained in:
commit
ec8a7b28a8
9 changed files with 118 additions and 298 deletions
|
|
@ -216,6 +216,7 @@ import MkRippleEffect from '@/components/MkRippleEffect.vue';
|
|||
import { showMovedDialog } from '@/scripts/show-moved-dialog.js';
|
||||
import { shouldCollapsed } from '@/scripts/collapsed.js';
|
||||
import { useRouter } from '@/router/supplier.js';
|
||||
import { boostMenuItems, type Visibility } from '@/scripts/boost-quote.js';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
note: Misskey.entities.Note;
|
||||
|
|
@ -407,58 +408,15 @@ if (!props.mock) {
|
|||
}
|
||||
}
|
||||
|
||||
type Visibility = 'public' | 'home' | 'followers' | 'specified';
|
||||
|
||||
// defaultStore.state.visibilityがstringなためstringも受け付けている
|
||||
function smallerVisibility(a: Visibility | string, b: Visibility | string): Visibility {
|
||||
if (a === 'specified' || b === 'specified') return 'specified';
|
||||
if (a === 'followers' || b === 'followers') return 'followers';
|
||||
if (a === 'home' || b === 'home') return 'home';
|
||||
// if (a === 'public' || b === 'public')
|
||||
return 'public';
|
||||
}
|
||||
|
||||
function boostVisibility() {
|
||||
if (!defaultStore.state.showVisibilitySelectorOnBoost) {
|
||||
renote(defaultStore.state.visibilityOnBoost);
|
||||
} else {
|
||||
os.popupMenu([
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['public'],
|
||||
action: () => {
|
||||
renote('public');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-house ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['home'],
|
||||
action: () => {
|
||||
renote('home');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-lock ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['followers'],
|
||||
action: () => {
|
||||
renote('followers');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-planet ph-bold ph-lg',
|
||||
text: i18n.ts._timelines.local,
|
||||
action: () => {
|
||||
renote('local');
|
||||
},
|
||||
}], renoteButton.value);
|
||||
os.popupMenu(boostMenuItems(appearNote, renote), renoteButton.value);
|
||||
}
|
||||
}
|
||||
|
||||
function renote(visibility: Visibility | 'local') {
|
||||
function renote(visibility: Visibility, localOnly: boolean = false) {
|
||||
pleaseLogin();
|
||||
showMovedDialog();
|
||||
|
||||
|
|
@ -489,18 +447,10 @@ function renote(visibility: Visibility | 'local') {
|
|||
os.popup(MkRippleEffect, { x, y }, {}, 'end');
|
||||
}
|
||||
|
||||
const configuredVisibility = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility;
|
||||
const localOnlySetting = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
|
||||
|
||||
let noteVisibility = visibility === 'local' || visibility === 'specified' ? smallerVisibility(appearNote.value.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility);
|
||||
if (appearNote.value.channel?.isSensitive) {
|
||||
noteVisibility = smallerVisibility(visibility === 'local' || visibility === 'specified' ? appearNote.value.visibility : visibility, 'home');
|
||||
}
|
||||
|
||||
if (!props.mock) {
|
||||
misskeyApi('notes/create', {
|
||||
localOnly: visibility === 'local' ? true : localOnlySetting,
|
||||
visibility: noteVisibility,
|
||||
localOnly: localOnly,
|
||||
visibility: visibility,
|
||||
renoteId: appearNote.value.id,
|
||||
}).then(() => {
|
||||
os.toast(i18n.ts.renoted);
|
||||
|
|
|
|||
|
|
@ -257,6 +257,7 @@ import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
|||
import MkPagination, { type Paging } from '@/components/MkPagination.vue';
|
||||
import MkReactionIcon from '@/components/MkReactionIcon.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { boostMenuItems, type Visibility } from '@/scripts/boost-quote.js';
|
||||
|
||||
const props = defineProps<{
|
||||
note: Misskey.entities.Note;
|
||||
|
|
@ -429,57 +430,15 @@ useTooltip(quoteButton, async (showing) => {
|
|||
}, {}, 'closed');
|
||||
});
|
||||
|
||||
type Visibility = 'public' | 'home' | 'followers' | 'specified';
|
||||
|
||||
function smallerVisibility(a: Visibility | string, b: Visibility | string): Visibility {
|
||||
if (a === 'specified' || b === 'specified') return 'specified';
|
||||
if (a === 'followers' || b === 'followers') return 'followers';
|
||||
if (a === 'home' || b === 'home') return 'home';
|
||||
// if (a === 'public' || b === 'public')
|
||||
return 'public';
|
||||
}
|
||||
|
||||
function boostVisibility() {
|
||||
if (!defaultStore.state.showVisibilitySelectorOnBoost) {
|
||||
renote(defaultStore.state.visibilityOnBoost);
|
||||
} else {
|
||||
os.popupMenu([
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['public'],
|
||||
action: () => {
|
||||
renote('public');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-house ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['home'],
|
||||
action: () => {
|
||||
renote('home');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-lock ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['followers'],
|
||||
action: () => {
|
||||
renote('followers');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-planet ph-bold ph-lg',
|
||||
text: i18n.ts._timelines.local,
|
||||
action: () => {
|
||||
renote('local');
|
||||
},
|
||||
}], renoteButton.value);
|
||||
os.popupMenu(boostMenuItems(appearNote, renote), renoteButton.value);
|
||||
}
|
||||
}
|
||||
|
||||
function renote(visibility: Visibility | 'local') {
|
||||
function renote(visibility: Visibility, localOnly: boolean = false) {
|
||||
pleaseLogin();
|
||||
showMovedDialog();
|
||||
|
||||
|
|
@ -508,17 +467,9 @@ function renote(visibility: Visibility | 'local') {
|
|||
os.popup(MkRippleEffect, { x, y }, {}, 'end');
|
||||
}
|
||||
|
||||
const configuredVisibility = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility;
|
||||
const localOnlySetting = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
|
||||
|
||||
let noteVisibility = visibility === 'local' || visibility === 'specified' ? smallerVisibility(appearNote.value.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility);
|
||||
if (appearNote.value.channel?.isSensitive) {
|
||||
noteVisibility = smallerVisibility(visibility === 'local' || visibility === 'specified' ? appearNote.value.visibility : visibility, 'home');
|
||||
}
|
||||
|
||||
misskeyApi('notes/create', {
|
||||
localOnly: visibility === 'local' ? true : localOnlySetting,
|
||||
visibility: noteVisibility,
|
||||
localOnly: localOnly,
|
||||
visibility: visibility,
|
||||
renoteId: appearNote.value.id,
|
||||
}).then(() => {
|
||||
os.toast(i18n.ts.renoted);
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ import { reactionPicker } from '@/scripts/reaction-picker.js';
|
|||
import { claimAchievement } from '@/scripts/achievements.js';
|
||||
import { getNoteMenu } from '@/scripts/get-note-menu.js';
|
||||
import { useNoteCapture } from '@/scripts/use-note-capture.js';
|
||||
import { boostMenuItems, type Visibility } from '@/scripts/boost-quote.js';
|
||||
|
||||
const canRenote = computed(() => ['public', 'home'].includes(props.note.visibility) || props.note.userId === $i.id);
|
||||
|
||||
|
|
@ -276,43 +277,11 @@ function boostVisibility() {
|
|||
if (!defaultStore.state.showVisibilitySelectorOnBoost) {
|
||||
renote(defaultStore.state.visibilityOnBoost);
|
||||
} else {
|
||||
os.popupMenu([
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['public'],
|
||||
action: () => {
|
||||
renote('public');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-house ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['home'],
|
||||
action: () => {
|
||||
renote('home');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-lock ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['followers'],
|
||||
action: () => {
|
||||
renote('followers');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-planet ph-bold ph-lg',
|
||||
text: i18n.ts._timelines.local,
|
||||
action: () => {
|
||||
renote('local');
|
||||
},
|
||||
}], renoteButton.value);
|
||||
os.popupMenu(boostMenuItems(appearNote, renote), renoteButton.value);
|
||||
}
|
||||
}
|
||||
|
||||
function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'local') {
|
||||
function renote(visibility: Visibility, localOnly: boolean = false) {
|
||||
pleaseLogin();
|
||||
showMovedDialog();
|
||||
|
||||
|
|
@ -326,8 +295,8 @@ function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'loc
|
|||
}
|
||||
|
||||
misskeyApi('notes/create', {
|
||||
renoteId: props.note.id,
|
||||
channelId: props.note.channelId,
|
||||
renoteId: appearNote.value.id,
|
||||
channelId: appearNote.value.channelId,
|
||||
}).then(() => {
|
||||
os.toast(i18n.ts.renoted);
|
||||
renoted.value = true;
|
||||
|
|
@ -342,9 +311,9 @@ function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'loc
|
|||
}
|
||||
|
||||
misskeyApi('notes/create', {
|
||||
renoteId: props.note.id,
|
||||
localOnly: visibility === 'local' ? true : false,
|
||||
visibility: visibility === 'local' || visibility === 'specified' ? props.note.visibility : visibility,
|
||||
renoteId: appearNote.value.id,
|
||||
localOnly: localOnly,
|
||||
visibility: visibility,
|
||||
}).then(() => {
|
||||
os.toast(i18n.ts.renoted);
|
||||
renoted.value = true;
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@ import MkRippleEffect from '@/components/MkRippleEffect.vue';
|
|||
import { showMovedDialog } from '@/scripts/show-moved-dialog.js';
|
||||
import { shouldCollapsed } from '@/scripts/collapsed.js';
|
||||
import { useRouter } from '@/router/supplier.js';
|
||||
import { boostMenuItems, type Visibility } from '@/scripts/boost-quote.js';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
note: Misskey.entities.Note;
|
||||
|
|
@ -408,58 +409,15 @@ if (!props.mock) {
|
|||
}
|
||||
}
|
||||
|
||||
type Visibility = 'public' | 'home' | 'followers' | 'specified';
|
||||
|
||||
// defaultStore.state.visibilityがstringなためstringも受け付けている
|
||||
function smallerVisibility(a: Visibility | string, b: Visibility | string): Visibility {
|
||||
if (a === 'specified' || b === 'specified') return 'specified';
|
||||
if (a === 'followers' || b === 'followers') return 'followers';
|
||||
if (a === 'home' || b === 'home') return 'home';
|
||||
// if (a === 'public' || b === 'public')
|
||||
return 'public';
|
||||
}
|
||||
|
||||
function boostVisibility() {
|
||||
if (!defaultStore.state.showVisibilitySelectorOnBoost) {
|
||||
renote(defaultStore.state.visibilityOnBoost);
|
||||
} else {
|
||||
os.popupMenu([
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['public'],
|
||||
action: () => {
|
||||
renote('public');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-house ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['home'],
|
||||
action: () => {
|
||||
renote('home');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-lock ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['followers'],
|
||||
action: () => {
|
||||
renote('followers');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-planet ph-bold ph-lg',
|
||||
text: i18n.ts._timelines.local,
|
||||
action: () => {
|
||||
renote('local');
|
||||
},
|
||||
}], renoteButton.value);
|
||||
os.popupMenu(boostMenuItems(appearNote, renote), renoteButton.value);
|
||||
}
|
||||
}
|
||||
|
||||
function renote(visibility: Visibility | 'local') {
|
||||
function renote(visibility: Visibility, localOnly: boolean = false) {
|
||||
pleaseLogin();
|
||||
showMovedDialog();
|
||||
|
||||
|
|
@ -490,18 +448,10 @@ function renote(visibility: Visibility | 'local') {
|
|||
os.popup(MkRippleEffect, { x, y }, {}, 'end');
|
||||
}
|
||||
|
||||
const configuredVisibility = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility;
|
||||
const localOnlySetting = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
|
||||
|
||||
let noteVisibility = visibility === 'local' || visibility === 'specified' ? smallerVisibility(appearNote.value.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility);
|
||||
if (appearNote.value.channel?.isSensitive) {
|
||||
noteVisibility = smallerVisibility(visibility === 'local' || visibility === 'specified' ? appearNote.value.visibility : visibility, 'home');
|
||||
}
|
||||
|
||||
if (!props.mock) {
|
||||
misskeyApi('notes/create', {
|
||||
localOnly: visibility === 'local' ? true : localOnlySetting,
|
||||
visibility: noteVisibility,
|
||||
localOnly: localOnly,
|
||||
visibility: visibility,
|
||||
renoteId: appearNote.value.id,
|
||||
}).then(() => {
|
||||
os.toast(i18n.ts.renoted);
|
||||
|
|
|
|||
|
|
@ -265,6 +265,7 @@ import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
|||
import MkPagination, { type Paging } from '@/components/MkPagination.vue';
|
||||
import MkReactionIcon from '@/components/MkReactionIcon.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { boostMenuItems, type Visibility } from '@/scripts/boost-quote.js';
|
||||
|
||||
const props = defineProps<{
|
||||
note: Misskey.entities.Note;
|
||||
|
|
@ -438,57 +439,15 @@ useTooltip(quoteButton, async (showing) => {
|
|||
}, {}, 'closed');
|
||||
});
|
||||
|
||||
type Visibility = 'public' | 'home' | 'followers' | 'specified';
|
||||
|
||||
function smallerVisibility(a: Visibility | string, b: Visibility | string): Visibility {
|
||||
if (a === 'specified' || b === 'specified') return 'specified';
|
||||
if (a === 'followers' || b === 'followers') return 'followers';
|
||||
if (a === 'home' || b === 'home') return 'home';
|
||||
// if (a === 'public' || b === 'public')
|
||||
return 'public';
|
||||
}
|
||||
|
||||
function boostVisibility() {
|
||||
if (!defaultStore.state.showVisibilitySelectorOnBoost) {
|
||||
renote(defaultStore.state.visibilityOnBoost);
|
||||
} else {
|
||||
os.popupMenu([
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['public'],
|
||||
action: () => {
|
||||
renote('public');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-house ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['home'],
|
||||
action: () => {
|
||||
renote('home');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-lock ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['followers'],
|
||||
action: () => {
|
||||
renote('followers');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-planet ph-bold ph-lg',
|
||||
text: i18n.ts._timelines.local,
|
||||
action: () => {
|
||||
renote('local');
|
||||
},
|
||||
}], renoteButton.value);
|
||||
os.popupMenu(boostMenuItems(appearNote, renote), renoteButton.value);
|
||||
}
|
||||
}
|
||||
|
||||
function renote(visibility: Visibility | 'local') {
|
||||
function renote(visibility: Visibility, localOnly: boolean = false) {
|
||||
pleaseLogin();
|
||||
showMovedDialog();
|
||||
|
||||
|
|
@ -517,17 +476,9 @@ function renote(visibility: Visibility | 'local') {
|
|||
os.popup(MkRippleEffect, { x, y }, {}, 'end');
|
||||
}
|
||||
|
||||
const configuredVisibility = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility;
|
||||
const localOnlySetting = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
|
||||
|
||||
let noteVisibility = visibility === 'local' || visibility === 'specified' ? smallerVisibility(appearNote.value.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility);
|
||||
if (appearNote.value.channel?.isSensitive) {
|
||||
noteVisibility = smallerVisibility(visibility === 'local' || visibility === 'specified' ? appearNote.value.visibility : visibility, 'home');
|
||||
}
|
||||
|
||||
misskeyApi('notes/create', {
|
||||
localOnly: visibility === 'local' ? true : localOnlySetting,
|
||||
visibility: noteVisibility,
|
||||
localOnly: localOnly,
|
||||
visibility: visibility,
|
||||
renoteId: appearNote.value.id,
|
||||
}).then(() => {
|
||||
os.toast(i18n.ts.renoted);
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ import { reactionPicker } from '@/scripts/reaction-picker.js';
|
|||
import { claimAchievement } from '@/scripts/achievements.js';
|
||||
import { getNoteMenu } from '@/scripts/get-note-menu.js';
|
||||
import { useNoteCapture } from '@/scripts/use-note-capture.js';
|
||||
import { boostMenuItems, type Visibility } from '@/scripts/boost-quote.js';
|
||||
|
||||
const canRenote = computed(() => ['public', 'home'].includes(props.note.visibility) || props.note.userId === $i.id);
|
||||
const hideLine = computed(() => { return props.detail ? true : false; });
|
||||
|
|
@ -290,43 +291,11 @@ function boostVisibility() {
|
|||
if (!defaultStore.state.showVisibilitySelectorOnBoost) {
|
||||
renote(defaultStore.state.visibilityOnBoost);
|
||||
} else {
|
||||
os.popupMenu([
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['public'],
|
||||
action: () => {
|
||||
renote('public');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-house ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['home'],
|
||||
action: () => {
|
||||
renote('home');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-lock ph-bold ph-lg',
|
||||
text: i18n.ts._visibility['followers'],
|
||||
action: () => {
|
||||
renote('followers');
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
icon: 'ph-planet ph-bold ph-lg',
|
||||
text: i18n.ts._timelines.local,
|
||||
action: () => {
|
||||
renote('local');
|
||||
},
|
||||
}], renoteButton.value);
|
||||
os.popupMenu(boostMenuItems(appearNote, renote), renoteButton.value);
|
||||
}
|
||||
}
|
||||
|
||||
function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'local') {
|
||||
function renote(visibility: Visibility, localOnly: boolean = false) {
|
||||
pleaseLogin();
|
||||
showMovedDialog();
|
||||
|
||||
|
|
@ -340,8 +309,8 @@ function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'loc
|
|||
}
|
||||
|
||||
misskeyApi('notes/create', {
|
||||
renoteId: props.note.id,
|
||||
channelId: props.note.channelId,
|
||||
renoteId: appearNote.value.id,
|
||||
channelId: appearNote.value.channelId,
|
||||
}).then(() => {
|
||||
os.toast(i18n.ts.renoted);
|
||||
renoted.value = true;
|
||||
|
|
@ -356,9 +325,9 @@ function renote(visibility: 'public' | 'home' | 'followers' | 'specified' | 'loc
|
|||
}
|
||||
|
||||
misskeyApi('notes/create', {
|
||||
renoteId: props.note.id,
|
||||
localOnly: visibility === 'local' ? true : false,
|
||||
visibility: visibility === 'local' || visibility === 'specified' ? props.note.visibility : visibility,
|
||||
renoteId: appearNote.value.id,
|
||||
localOnly: localOnly,
|
||||
visibility: visibility,
|
||||
}).then(() => {
|
||||
os.toast(i18n.ts.renoted);
|
||||
renoted.value = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue