mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-01-03 21:42:27 +01:00
Merge branch 'develop' into enh-14794
This commit is contained in:
commit
4f5d58cea1
14 changed files with 110 additions and 71 deletions
|
@ -14,6 +14,7 @@
|
||||||
- Fix: 通知の範囲指定の設定項目が必要ない通知設定でも範囲指定の設定がでている問題を修正
|
- Fix: 通知の範囲指定の設定項目が必要ない通知設定でも範囲指定の設定がでている問題を修正
|
||||||
- Fix: Turnstileが失敗・期限切れした際にも成功扱いとなってしまう問題を修正
|
- Fix: Turnstileが失敗・期限切れした際にも成功扱いとなってしまう問題を修正
|
||||||
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/768)
|
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/768)
|
||||||
|
- Fix: デッキのタイムラインカラムで「センシティブなファイルを含むノートを表示」設定が使用できなかった問題を修正
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
-
|
-
|
||||||
|
|
|
@ -64,6 +64,22 @@ Thank you for your PR! Before creating a PR, please check the following:
|
||||||
|
|
||||||
Thanks for your cooperation 🤗
|
Thanks for your cooperation 🤗
|
||||||
|
|
||||||
|
### Additional things for ActivityPub payload changes
|
||||||
|
*This section is specific to misskey-dev implementation. Other fork or implementation may take different way. A significant difference is that non-"misskey-dev" extension is not described in the misskey-hub's document.*
|
||||||
|
|
||||||
|
If PR includes changes to ActivityPub payload, please reflect it in [misskey-hub's document](https://github.com/misskey-dev/misskey-hub-next/blob/master/content/ns.md) by sending PR.
|
||||||
|
|
||||||
|
The name of purporsed extension property (referred as "extended property" in later) to ActivityPub shall be prefixed by `_misskey_`. (i.e. `_misskey_quote`)
|
||||||
|
|
||||||
|
The extended property in `packages/backend/src/core/activitypub/type.ts` **must** be declared as optional because ActivityPub payloads that comes from older Misskey or other implementation may not contain it.
|
||||||
|
|
||||||
|
The extended property must be included in the context definition. Context is defined in `packages/backend/src/core/activitypub/misc/contexts.ts`.
|
||||||
|
The key shall be same as the name of extended property, and the value shall be same as "short IRI".
|
||||||
|
|
||||||
|
"Short IRI" is defined in misskey-hub's document, but usually takes form of `misskey:<name of extended property>`. (i.e. `misskey:_misskey_quote`)
|
||||||
|
|
||||||
|
One should not add property that has defined before by other implementation, or add custom variant value to "well-known" property.
|
||||||
|
|
||||||
## Reviewers guide
|
## Reviewers guide
|
||||||
Be willing to comment on the good points and not just the things you want fixed 💯
|
Be willing to comment on the good points and not just the things you want fixed 💯
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,12 @@
|
||||||
|
|
||||||
import { defineAsyncComponent, reactive, ref } from 'vue';
|
import { defineAsyncComponent, reactive, ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
|
import { apiUrl } from '@@/js/config.js';
|
||||||
|
import type { MenuItem, MenuButton } from '@/types/menu.js';
|
||||||
import { showSuspendedDialog } from '@/scripts/show-suspended-dialog.js';
|
import { showSuspendedDialog } from '@/scripts/show-suspended-dialog.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { miLocalStorage } from '@/local-storage.js';
|
import { miLocalStorage } from '@/local-storage.js';
|
||||||
import type { MenuItem, MenuButton } from '@/types/menu.js';
|
|
||||||
import { del, get, set } from '@/scripts/idb-proxy.js';
|
import { del, get, set } from '@/scripts/idb-proxy.js';
|
||||||
import { apiUrl } from '@@/js/config.js';
|
|
||||||
import { waiting, popup, popupMenu, success, alert } from '@/os.js';
|
import { waiting, popup, popupMenu, success, alert } from '@/os.js';
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { unisonReload, reloadChannel } from '@/scripts/unison-reload.js';
|
import { unisonReload, reloadChannel } from '@/scripts/unison-reload.js';
|
||||||
|
@ -165,7 +165,18 @@ function fetchAccount(token: string, id?: string, forceShowDialog?: boolean): Pr
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateAccount(accountData: Partial<Account>) {
|
export function updateAccount(accountData: Account) {
|
||||||
|
if (!$i) return;
|
||||||
|
for (const key of Object.keys($i)) {
|
||||||
|
delete $i[key];
|
||||||
|
}
|
||||||
|
for (const [key, value] of Object.entries(accountData)) {
|
||||||
|
$i[key] = value;
|
||||||
|
}
|
||||||
|
miLocalStorage.setItem('account', JSON.stringify($i));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateAccountPartial(accountData: Partial<Account>) {
|
||||||
if (!$i) return;
|
if (!$i) return;
|
||||||
for (const [key, value] of Object.entries(accountData)) {
|
for (const [key, value] of Object.entries(accountData)) {
|
||||||
$i[key] = value;
|
$i[key] = value;
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { createApp, defineAsyncComponent, markRaw } from 'vue';
|
import { createApp, defineAsyncComponent, markRaw } from 'vue';
|
||||||
|
import { ui } from '@@/js/config.js';
|
||||||
import { common } from './common.js';
|
import { common } from './common.js';
|
||||||
import type * as Misskey from 'misskey-js';
|
import type * as Misskey from 'misskey-js';
|
||||||
import { ui } from '@@/js/config.js';
|
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { alert, confirm, popup, post, toast } from '@/os.js';
|
import { alert, confirm, popup, post, toast } from '@/os.js';
|
||||||
import { useStream } from '@/stream.js';
|
import { useStream } from '@/stream.js';
|
||||||
import * as sound from '@/scripts/sound.js';
|
import * as sound from '@/scripts/sound.js';
|
||||||
import { $i, signout, updateAccount } from '@/account.js';
|
import { $i, signout, updateAccountPartial } from '@/account.js';
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from '@/instance.js';
|
||||||
import { ColdDeviceStorage, defaultStore } from '@/store.js';
|
import { ColdDeviceStorage, defaultStore } from '@/store.js';
|
||||||
import { reactionPicker } from '@/scripts/reaction-picker.js';
|
import { reactionPicker } from '@/scripts/reaction-picker.js';
|
||||||
|
@ -291,11 +291,11 @@ export async function mainBoot() {
|
||||||
|
|
||||||
// 自分の情報が更新されたとき
|
// 自分の情報が更新されたとき
|
||||||
main.on('meUpdated', i => {
|
main.on('meUpdated', i => {
|
||||||
updateAccount(i);
|
updateAccountPartial(i);
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllNotifications', () => {
|
main.on('readAllNotifications', () => {
|
||||||
updateAccount({
|
updateAccountPartial({
|
||||||
hasUnreadNotification: false,
|
hasUnreadNotification: false,
|
||||||
unreadNotificationsCount: 0,
|
unreadNotificationsCount: 0,
|
||||||
});
|
});
|
||||||
|
@ -303,39 +303,39 @@ export async function mainBoot() {
|
||||||
|
|
||||||
main.on('unreadNotification', () => {
|
main.on('unreadNotification', () => {
|
||||||
const unreadNotificationsCount = ($i?.unreadNotificationsCount ?? 0) + 1;
|
const unreadNotificationsCount = ($i?.unreadNotificationsCount ?? 0) + 1;
|
||||||
updateAccount({
|
updateAccountPartial({
|
||||||
hasUnreadNotification: true,
|
hasUnreadNotification: true,
|
||||||
unreadNotificationsCount,
|
unreadNotificationsCount,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('unreadMention', () => {
|
main.on('unreadMention', () => {
|
||||||
updateAccount({ hasUnreadMentions: true });
|
updateAccountPartial({ hasUnreadMentions: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllUnreadMentions', () => {
|
main.on('readAllUnreadMentions', () => {
|
||||||
updateAccount({ hasUnreadMentions: false });
|
updateAccountPartial({ hasUnreadMentions: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('unreadSpecifiedNote', () => {
|
main.on('unreadSpecifiedNote', () => {
|
||||||
updateAccount({ hasUnreadSpecifiedNotes: true });
|
updateAccountPartial({ hasUnreadSpecifiedNotes: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllUnreadSpecifiedNotes', () => {
|
main.on('readAllUnreadSpecifiedNotes', () => {
|
||||||
updateAccount({ hasUnreadSpecifiedNotes: false });
|
updateAccountPartial({ hasUnreadSpecifiedNotes: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllAntennas', () => {
|
main.on('readAllAntennas', () => {
|
||||||
updateAccount({ hasUnreadAntenna: false });
|
updateAccountPartial({ hasUnreadAntenna: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('unreadAntenna', () => {
|
main.on('unreadAntenna', () => {
|
||||||
updateAccount({ hasUnreadAntenna: true });
|
updateAccountPartial({ hasUnreadAntenna: true });
|
||||||
sound.playMisskeySfx('antenna');
|
sound.playMisskeySfx('antenna');
|
||||||
});
|
});
|
||||||
|
|
||||||
main.on('readAllAnnouncements', () => {
|
main.on('readAllAnnouncements', () => {
|
||||||
updateAccount({ hasUnreadAnnouncement: false });
|
updateAccountPartial({ hasUnreadAnnouncement: false });
|
||||||
});
|
});
|
||||||
|
|
||||||
// 個人宛てお知らせが発行されたとき
|
// 個人宛てお知らせが発行されたとき
|
||||||
|
|
|
@ -29,7 +29,7 @@ import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import MkModal from '@/components/MkModal.vue';
|
import MkModal from '@/components/MkModal.vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
import MkButton from '@/components/MkButton.vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { $i, updateAccount } from '@/account.js';
|
import { $i, updateAccountPartial } from '@/account.js';
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
announcement: Misskey.entities.Announcement;
|
announcement: Misskey.entities.Announcement;
|
||||||
|
@ -51,7 +51,7 @@ async function ok() {
|
||||||
|
|
||||||
modal.value?.close();
|
modal.value?.close();
|
||||||
misskeyApi('i/read-announcement', { announcementId: props.announcement.id });
|
misskeyApi('i/read-announcement', { announcementId: props.announcement.id });
|
||||||
updateAccount({
|
updateAccountPartial({
|
||||||
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== props.announcement.id),
|
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== props.announcement.id),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,6 +227,7 @@ const emit = defineEmits<{
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const inTimeline = inject<boolean>('inTimeline', false);
|
const inTimeline = inject<boolean>('inTimeline', false);
|
||||||
|
const tl_withSensitive = inject<Ref<boolean>>('tl_withSensitive', ref(false));
|
||||||
const inChannel = inject('inChannel', null);
|
const inChannel = inject('inChannel', null);
|
||||||
const currentClip = inject<Ref<Misskey.entities.Clip> | null>('currentClip', null);
|
const currentClip = inject<Ref<Misskey.entities.Clip> | null>('currentClip', null);
|
||||||
|
|
||||||
|
@ -299,7 +300,7 @@ function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string
|
||||||
|
|
||||||
if (checkOnly) return false;
|
if (checkOnly) return false;
|
||||||
|
|
||||||
if (inTimeline && !defaultStore.state.tl.filter.withSensitive && noteToCheck.files?.some((v) => v.isSensitive)) return 'sensitiveMute';
|
if (inTimeline && !tl_withSensitive.value && noteToCheck.files?.some((v) => v.isSensitive)) return 'sensitiveMute';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
@keydown.space.enter="show"
|
@keydown.space.enter="show"
|
||||||
>
|
>
|
||||||
<div ref="prefixEl" :class="$style.prefix"><slot name="prefix"></slot></div>
|
<div ref="prefixEl" :class="$style.prefix"><slot name="prefix"></slot></div>
|
||||||
<select
|
<div
|
||||||
ref="inputEl"
|
ref="inputEl"
|
||||||
v-model="v"
|
|
||||||
v-adaptive-border
|
v-adaptive-border
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
:class="$style.inputCore"
|
:class="$style.inputCore"
|
||||||
|
@ -26,27 +25,25 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
:required="required"
|
:required="required"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
@input="onInput"
|
|
||||||
@mousedown.prevent="() => {}"
|
@mousedown.prevent="() => {}"
|
||||||
@keydown.prevent="() => {}"
|
@keydown.prevent="() => {}"
|
||||||
>
|
>
|
||||||
<slot></slot>
|
<div style="pointer-events: none;">{{ currentValueText ?? '' }}</div>
|
||||||
</select>
|
<div style="display: none;">
|
||||||
|
<slot></slot>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div ref="suffixEl" :class="$style.suffix"><i class="ti ti-chevron-down" :class="[$style.chevron, { [$style.chevronOpening]: opening }]"></i></div>
|
<div ref="suffixEl" :class="$style.suffix"><i class="ti ti-chevron-down" :class="[$style.chevron, { [$style.chevronOpening]: opening }]"></i></div>
|
||||||
</div>
|
</div>
|
||||||
<div :class="$style.caption"><slot name="caption"></slot></div>
|
<div :class="$style.caption"><slot name="caption"></slot></div>
|
||||||
|
|
||||||
<MkButton v-if="manualSave && changed" primary :class="$style.save" @click="updated"><i class="ti ti-device-floppy"></i> {{ i18n.ts.save }}</MkButton>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, nextTick, ref, watch, computed, toRefs, VNode, useSlots, VNodeChild } from 'vue';
|
import { onMounted, nextTick, ref, watch, computed, toRefs, VNode, useSlots, VNodeChild } from 'vue';
|
||||||
import MkButton from '@/components/MkButton.vue';
|
|
||||||
import * as os from '@/os.js';
|
|
||||||
import { useInterval } from '@@/js/use-interval.js';
|
import { useInterval } from '@@/js/use-interval.js';
|
||||||
import { i18n } from '@/i18n.js';
|
|
||||||
import type { MenuItem } from '@/types/menu.js';
|
import type { MenuItem } from '@/types/menu.js';
|
||||||
|
import * as os from '@/os.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
modelValue: string | null;
|
modelValue: string | null;
|
||||||
|
@ -56,25 +53,20 @@ const props = defineProps<{
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
autofocus?: boolean;
|
autofocus?: boolean;
|
||||||
inline?: boolean;
|
inline?: boolean;
|
||||||
manualSave?: boolean;
|
|
||||||
small?: boolean;
|
small?: boolean;
|
||||||
large?: boolean;
|
large?: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'changeByUser', value: string | null): void;
|
(ev: 'update:modelValue', value: string | number | null): void;
|
||||||
(ev: 'update:modelValue', value: string | null): void;
|
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const slots = useSlots();
|
const slots = useSlots();
|
||||||
|
|
||||||
const { modelValue, autofocus } = toRefs(props);
|
const { modelValue, autofocus } = toRefs(props);
|
||||||
const v = ref(modelValue.value);
|
|
||||||
const focused = ref(false);
|
const focused = ref(false);
|
||||||
const opening = ref(false);
|
const opening = ref(false);
|
||||||
const changed = ref(false);
|
const currentValueText = ref<string | null>(null);
|
||||||
const invalid = ref(false);
|
|
||||||
const filled = computed(() => v.value !== '' && v.value != null);
|
|
||||||
const inputEl = ref<HTMLObjectElement | null>(null);
|
const inputEl = ref<HTMLObjectElement | null>(null);
|
||||||
const prefixEl = ref<HTMLElement | null>(null);
|
const prefixEl = ref<HTMLElement | null>(null);
|
||||||
const suffixEl = ref<HTMLElement | null>(null);
|
const suffixEl = ref<HTMLElement | null>(null);
|
||||||
|
@ -85,26 +77,6 @@ const height =
|
||||||
36;
|
36;
|
||||||
|
|
||||||
const focus = () => container.value?.focus();
|
const focus = () => container.value?.focus();
|
||||||
const onInput = (ev) => {
|
|
||||||
changed.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const updated = () => {
|
|
||||||
changed.value = false;
|
|
||||||
emit('update:modelValue', v.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(modelValue, newValue => {
|
|
||||||
v.value = newValue;
|
|
||||||
});
|
|
||||||
|
|
||||||
watch(v, () => {
|
|
||||||
if (!props.manualSave) {
|
|
||||||
updated();
|
|
||||||
}
|
|
||||||
|
|
||||||
invalid.value = inputEl.value?.validity.badInput ?? true;
|
|
||||||
});
|
|
||||||
|
|
||||||
// このコンポーネントが作成された時、非表示状態である場合がある
|
// このコンポーネントが作成された時、非表示状態である場合がある
|
||||||
// 非表示状態だと要素の幅などは0になってしまうので、定期的に計算する
|
// 非表示状態だと要素の幅などは0になってしまうので、定期的に計算する
|
||||||
|
@ -134,6 +106,31 @@ onMounted(() => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(modelValue, () => {
|
||||||
|
const scanOptions = (options: VNodeChild[]) => {
|
||||||
|
for (const vnode of options) {
|
||||||
|
if (typeof vnode !== 'object' || vnode === null || Array.isArray(vnode)) continue;
|
||||||
|
if (vnode.type === 'optgroup') {
|
||||||
|
const optgroup = vnode;
|
||||||
|
if (Array.isArray(optgroup.children)) scanOptions(optgroup.children);
|
||||||
|
} else if (Array.isArray(vnode.children)) { // 何故かフラグメントになってくることがある
|
||||||
|
const fragment = vnode;
|
||||||
|
if (Array.isArray(fragment.children)) scanOptions(fragment.children);
|
||||||
|
} else if (vnode.props == null) { // v-if で条件が false のときにこうなる
|
||||||
|
// nop?
|
||||||
|
} else {
|
||||||
|
const option = vnode;
|
||||||
|
if (option.props?.value === modelValue.value) {
|
||||||
|
currentValueText.value = option.children as string;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
scanOptions(slots.default!());
|
||||||
|
}, { immediate: true });
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
if (opening.value) return;
|
if (opening.value) return;
|
||||||
focus();
|
focus();
|
||||||
|
@ -146,11 +143,9 @@ function show() {
|
||||||
const pushOption = (option: VNode) => {
|
const pushOption = (option: VNode) => {
|
||||||
menu.push({
|
menu.push({
|
||||||
text: option.children as string,
|
text: option.children as string,
|
||||||
active: computed(() => v.value === option.props?.value),
|
active: computed(() => modelValue.value === option.props?.value),
|
||||||
action: () => {
|
action: () => {
|
||||||
v.value = option.props?.value;
|
emit('update:modelValue', option.props?.value);
|
||||||
changed.value = true;
|
|
||||||
emit('changeByUser', v.value);
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -248,7 +243,8 @@ function show() {
|
||||||
.inputCore {
|
.inputCore {
|
||||||
appearance: none;
|
appearance: none;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
display: block;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
height: v-bind("height + 'px'");
|
height: v-bind("height + 'px'");
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
@ -38,6 +38,7 @@ const props = withDefaults(defineProps<{
|
||||||
sound?: boolean;
|
sound?: boolean;
|
||||||
withRenotes?: boolean;
|
withRenotes?: boolean;
|
||||||
withReplies?: boolean;
|
withReplies?: boolean;
|
||||||
|
withSensitive?: boolean;
|
||||||
onlyFiles?: boolean;
|
onlyFiles?: boolean;
|
||||||
}>(), {
|
}>(), {
|
||||||
withRenotes: true,
|
withRenotes: true,
|
||||||
|
@ -51,6 +52,7 @@ const emit = defineEmits<{
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
provide('inTimeline', true);
|
provide('inTimeline', true);
|
||||||
|
provide('tl_withSensitive', computed(() => props.withSensitive));
|
||||||
provide('inChannel', computed(() => props.src === 'channel'));
|
provide('inChannel', computed(() => props.src === 'channel'));
|
||||||
|
|
||||||
type TimelineQueryType = {
|
type TimelineQueryType = {
|
||||||
|
@ -248,6 +250,9 @@ function refreshEndpointAndChannel() {
|
||||||
// IDが切り替わったら切り替え先のTLを表示させたい
|
// IDが切り替わったら切り替え先のTLを表示させたい
|
||||||
watch(() => [props.list, props.antenna, props.channel, props.role, props.withRenotes], refreshEndpointAndChannel);
|
watch(() => [props.list, props.antenna, props.channel, props.role, props.withRenotes], refreshEndpointAndChannel);
|
||||||
|
|
||||||
|
// withSensitiveはクライアントで完結する処理のため、単にリロードするだけでOK
|
||||||
|
watch(() => props.withSensitive, reloadTimeline);
|
||||||
|
|
||||||
// 初回表示用
|
// 初回表示用
|
||||||
refreshEndpointAndChannel();
|
refreshEndpointAndChannel();
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ import * as os from '@/os.js';
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
import { $i, updateAccount } from '@/account.js';
|
import { $i, updateAccountPartial } from '@/account.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -90,7 +90,7 @@ async function read(target: Misskey.entities.Announcement): Promise<void> {
|
||||||
target.isRead = true;
|
target.isRead = true;
|
||||||
await misskeyApi('i/read-announcement', { announcementId: target.id });
|
await misskeyApi('i/read-announcement', { announcementId: target.id });
|
||||||
if ($i) {
|
if ($i) {
|
||||||
updateAccount({
|
updateAccountPartial({
|
||||||
unreadAnnouncements: $i.unreadAnnouncements.filter((a: { id: string; }) => a.id !== target.id),
|
unreadAnnouncements: $i.unreadAnnouncements.filter((a: { id: string; }) => a.id !== target.id),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ import * as os from '@/os.js';
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
import { $i, updateAccount } from '@/account.js';
|
import { $i, updateAccountPartial } from '@/account.js';
|
||||||
|
|
||||||
const paginationCurrent = {
|
const paginationCurrent = {
|
||||||
endpoint: 'announcements' as const,
|
endpoint: 'announcements' as const,
|
||||||
|
@ -94,7 +94,7 @@ async function read(target) {
|
||||||
return a;
|
return a;
|
||||||
});
|
});
|
||||||
misskeyApi('i/read-announcement', { announcementId: target.id });
|
misskeyApi('i/read-announcement', { announcementId: target.id });
|
||||||
updateAccount({
|
updateAccountPartial({
|
||||||
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== target.id),
|
unreadAnnouncements: $i!.unreadAnnouncements.filter(a => a.id !== target.id),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ import FormSection from '@/components/form/section.vue';
|
||||||
import MkFolder from '@/components/MkFolder.vue';
|
import MkFolder from '@/components/MkFolder.vue';
|
||||||
import MkLink from '@/components/MkLink.vue';
|
import MkLink from '@/components/MkLink.vue';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { signinRequired, updateAccount } from '@/account.js';
|
import { signinRequired, updateAccountPartial } from '@/account.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
|
||||||
const $i = signinRequired();
|
const $i = signinRequired();
|
||||||
|
@ -123,7 +123,7 @@ async function unregisterTOTP(): Promise<void> {
|
||||||
password: auth.result.password,
|
password: auth.result.password,
|
||||||
token: auth.result.token,
|
token: auth.result.token,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
updateAccount({
|
updateAccountPartial({
|
||||||
twoFactorEnabled: false,
|
twoFactorEnabled: false,
|
||||||
});
|
});
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
|
|
@ -22,6 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
:list="src.split(':')[1]"
|
:list="src.split(':')[1]"
|
||||||
:withRenotes="withRenotes"
|
:withRenotes="withRenotes"
|
||||||
:withReplies="withReplies"
|
:withReplies="withReplies"
|
||||||
|
:withSensitive="withSensitive"
|
||||||
:onlyFiles="onlyFiles"
|
:onlyFiles="onlyFiles"
|
||||||
:sound="true"
|
:sound="true"
|
||||||
@queue="queueUpdated"
|
@queue="queueUpdated"
|
||||||
|
@ -121,11 +122,6 @@ watch(src, () => {
|
||||||
queue.value = 0;
|
queue.value = 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(withSensitive, () => {
|
|
||||||
// これだけはクライアント側で完結する処理なので手動でリロード
|
|
||||||
tlComponent.value?.reloadTimeline();
|
|
||||||
});
|
|
||||||
|
|
||||||
function queueUpdated(q: number): void {
|
function queueUpdated(q: number): void {
|
||||||
queue.value = q;
|
queue.value = q;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ export type Column = {
|
||||||
tl?: BasicTimelineType;
|
tl?: BasicTimelineType;
|
||||||
withRenotes?: boolean;
|
withRenotes?: boolean;
|
||||||
withReplies?: boolean;
|
withReplies?: boolean;
|
||||||
|
withSensitive?: boolean;
|
||||||
onlyFiles?: boolean;
|
onlyFiles?: boolean;
|
||||||
soundSetting: SoundStore;
|
soundSetting: SoundStore;
|
||||||
};
|
};
|
||||||
|
|
|
@ -24,6 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
:src="column.tl"
|
:src="column.tl"
|
||||||
:withRenotes="withRenotes"
|
:withRenotes="withRenotes"
|
||||||
:withReplies="withReplies"
|
:withReplies="withReplies"
|
||||||
|
:withSensitive="withSensitive"
|
||||||
:onlyFiles="onlyFiles"
|
:onlyFiles="onlyFiles"
|
||||||
@note="onNote"
|
@note="onNote"
|
||||||
/>
|
/>
|
||||||
|
@ -54,6 +55,7 @@ const timeline = shallowRef<InstanceType<typeof MkTimeline>>();
|
||||||
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
|
||||||
const withRenotes = ref(props.column.withRenotes ?? true);
|
const withRenotes = ref(props.column.withRenotes ?? true);
|
||||||
const withReplies = ref(props.column.withReplies ?? false);
|
const withReplies = ref(props.column.withReplies ?? false);
|
||||||
|
const withSensitive = ref(props.column.withSensitive ?? true);
|
||||||
const onlyFiles = ref(props.column.onlyFiles ?? false);
|
const onlyFiles = ref(props.column.onlyFiles ?? false);
|
||||||
|
|
||||||
watch(withRenotes, v => {
|
watch(withRenotes, v => {
|
||||||
|
@ -68,6 +70,12 @@ watch(withReplies, v => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(withSensitive, v => {
|
||||||
|
updateColumn(props.column.id, {
|
||||||
|
withSensitive: v,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
watch(onlyFiles, v => {
|
watch(onlyFiles, v => {
|
||||||
updateColumn(props.column.id, {
|
updateColumn(props.column.id, {
|
||||||
onlyFiles: v,
|
onlyFiles: v,
|
||||||
|
@ -144,6 +152,10 @@ const menu = computed<MenuItem[]>(() => {
|
||||||
text: i18n.ts.fileAttachedOnly,
|
text: i18n.ts.fileAttachedOnly,
|
||||||
ref: onlyFiles,
|
ref: onlyFiles,
|
||||||
disabled: hasWithReplies(props.column.tl) ? withReplies : false,
|
disabled: hasWithReplies(props.column.tl) ? withReplies : false,
|
||||||
|
}, {
|
||||||
|
type: 'switch',
|
||||||
|
text: i18n.ts.withSensitive,
|
||||||
|
ref: withSensitive,
|
||||||
});
|
});
|
||||||
|
|
||||||
return menuItems;
|
return menuItems;
|
||||||
|
|
Loading…
Reference in a new issue