Compare commits

...

7 Commits

Author SHA1 Message Date
MattyaDaihuku e8011c07df
Merge e9e2e3c6b3 into 763c708253 2024-11-20 05:20:04 +09:00
zawa-ch. 763c708253
Fix(backend): アカウント削除のモデレーションログが動作していないのを修正 (#14996) (#14997)
* アカウント削除のモデレーションログが動作していないのを修正

* update CHANGELOG
2024-11-19 21:12:40 +09:00
MattyaDaihuku e9e2e3c6b3 Merge branch 'develop' into instanceicon 2024-11-17 05:31:20 +00:00
MattyaDaihuku 1368f58b96 fix(frontend): MkAvatar内にMkInstanceIconの内容を含めるように 2024-11-17 05:21:58 +00:00
MattyaDaihuku 8c1dfab195 fix(frontend): MkSelectにinstanceIconの設定を含めるように 2024-11-03 06:11:04 +00:00
MattyaDaihuku 40ac246e5b
Merge branch 'misskey-dev:develop' into instanceicon 2024-10-29 12:24:51 +09:00
MattyaDaihuku 2dcd9118e9 feat(frontend): サーバーの表示をアイコンのみに切り替えられるように 2024-10-23 12:52:20 +00:00
10 changed files with 68 additions and 7 deletions

View File

@ -64,6 +64,7 @@
- Fix: FTT無効時にユーザーリストタイムラインが使用できない問題を修正 - Fix: FTT無効時にユーザーリストタイムラインが使用できない問題を修正
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/709) (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/709)
- Fix: User Webhookテスト機能のMock Payloadを修正 - Fix: User Webhookテスト機能のMock Payloadを修正
- Fix: アカウント削除のモデレーションログが動作していないのを修正 (#14996)
### Misskey.js ### Misskey.js
- Fix: Stream初期化時、別途WebSocketを指定する場合の型定義を修正 - Fix: Stream初期化時、別途WebSocketを指定する場合の型定義を修正

8
locales/index.d.ts vendored
View File

@ -7458,6 +7458,14 @@ export interface Locale extends ILocale {
* *
*/ */
"always": string; "always": string;
/**
* ()
*/
"remoteIcon": string;
/**
* ()
*/
"alwaysIcon": string;
}; };
"_serverDisconnectedBehavior": { "_serverDisconnectedBehavior": {
/** /**

View File

@ -1947,6 +1947,8 @@ _instanceTicker:
none: "表示しない" none: "表示しない"
remote: "リモートユーザーに表示" remote: "リモートユーザーに表示"
always: "常に表示" always: "常に表示"
remoteIcon: "リモートユーザーに表示(アイコンのみ)"
alwaysIcon: "常に表示(アイコンのみ)"
_serverDisconnectedBehavior: _serverDisconnectedBehavior:
reload: "自動でリロード" reload: "自動でリロード"

View File

@ -46,7 +46,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
throw new Error('cannot delete a root account'); throw new Error('cannot delete a root account');
} }
await this.deleteAccoountService.deleteAccount(user); await this.deleteAccoountService.deleteAccount(user, me);
}); });
} }
} }

View File

@ -33,13 +33,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private deleteAccountService: DeleteAccountService, private deleteAccountService: DeleteAccountService,
) { ) {
super(meta, paramDef, async (ps) => { super(meta, paramDef, async (ps, me) => {
const user = await this.usersRepository.findOneByOrFail({ id: ps.userId }); const user = await this.usersRepository.findOneByOrFail({ id: ps.userId });
if (user.isDeleted) { if (user.isDeleted) {
return; return;
} }
await this.deleteAccountService.deleteAccount(user); await this.deleteAccountService.deleteAccount(user, me);
}); });
} }
} }

View File

@ -47,7 +47,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div> </div>
<article v-else :class="$style.article" @contextmenu.stop="onContextmenu"> <article v-else :class="$style.article" @contextmenu.stop="onContextmenu">
<div v-if="appearNote.channel" :class="$style.colorBar" :style="{ background: appearNote.channel.color }"></div> <div v-if="appearNote.channel" :class="$style.colorBar" :style="{ background: appearNote.channel.color }"></div>
<MkAvatar :class="$style.avatar" :user="appearNote.user" :link="!mock" :preview="!mock"/> <MkAvatar :class="$style.avatar" :user="appearNote.user" :link="!mock" :preview="!mock" :showInstance="showInstanceIcon && !showTicker"/>
<div :class="$style.main"> <div :class="$style.main">
<MkNoteHeader :note="appearNote" :mini="true"/> <MkNoteHeader :note="appearNote" :mini="true"/>
<MkInstanceTicker v-if="showTicker" :instance="appearNote.user.instance"/> <MkInstanceTicker v-if="showTicker" :instance="appearNote.user.instance"/>
@ -275,6 +275,7 @@ const hardMuted = ref(props.withHardMute && checkMute(appearNote.value, $i?.hard
const translation = ref<Misskey.entities.NotesTranslateResponse | null>(null); const translation = ref<Misskey.entities.NotesTranslateResponse | null>(null);
const translating = ref(false); const translating = ref(false);
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.value.user.instance); const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.value.user.instance);
const showInstanceIcon = (defaultStore.state.instanceTicker === 'alwaysIcon') || (defaultStore.state.instanceTicker === 'remoteIcon' && appearNote.value.user.instance);
const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || (appearNote.value.visibility === 'followers' && appearNote.value.userId === $i?.id)); const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || (appearNote.value.visibility === 'followers' && appearNote.value.userId === $i?.id));
const renoteCollapsed = ref( const renoteCollapsed = ref(
defaultStore.state.collapseRenotes && isRenote && ( defaultStore.state.collapseRenotes && isRenote && (

View File

@ -70,7 +70,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<img v-for="(role, i) in appearNote.user.badgeRoles" :key="i" v-tooltip="role.name" :class="$style.noteHeaderBadgeRole" :src="role.iconUrl!"/> <img v-for="(role, i) in appearNote.user.badgeRoles" :key="i" v-tooltip="role.name" :class="$style.noteHeaderBadgeRole" :src="role.iconUrl!"/>
</div> </div>
</div> </div>
<MkInstanceTicker v-if="showTicker" :instance="appearNote.user.instance"/> <MkInstanceTicker v-if="showTicker || showInstanceIcon" :instance="appearNote.user.instance"/>
</div> </div>
</header> </header>
<div :class="$style.noteContent"> <div :class="$style.noteContent">
@ -302,6 +302,7 @@ const translating = ref(false);
const parsed = appearNote.value.text ? mfm.parse(appearNote.value.text) : null; const parsed = appearNote.value.text ? mfm.parse(appearNote.value.text) : null;
const urls = parsed ? extractUrlFromMfm(parsed).filter((url) => appearNote.value.renote?.url !== url && appearNote.value.renote?.uri !== url) : null; const urls = parsed ? extractUrlFromMfm(parsed).filter((url) => appearNote.value.renote?.url !== url && appearNote.value.renote?.uri !== url) : null;
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.value.user.instance); const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.value.user.instance);
const showInstanceIcon = (defaultStore.state.instanceTicker === 'alwaysIcon') || (defaultStore.state.instanceTicker === 'remoteIcon' && appearNote.value.user.instance);
const conversation = ref<Misskey.entities.Note[]>([]); const conversation = ref<Misskey.entities.Note[]>([]);
const replies = ref<Misskey.entities.Note[]>([]); const replies = ref<Misskey.entities.Note[]>([]);
const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || appearNote.value.userId === $i?.id); const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || appearNote.value.userId === $i?.id);

View File

@ -23,6 +23,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</div> </div>
</div> </div>
</div> </div>
<div v-if="showInstance">
<img v-if="faviconUrl" :class="$style.instanceIcon" :src="faviconUrl" :title="instance.name ?? undefined"/>
</div>
<template v-if="showDecoration"> <template v-if="showDecoration">
<img <img
v-for="decoration in decorations ?? user.avatarDecorations" v-for="decoration in decorations ?? user.avatarDecorations"
@ -42,10 +45,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup> <script lang="ts" setup>
import { watch, ref, computed } from 'vue'; import { watch, ref, computed } from 'vue';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import { instanceName } from '@@/js/config.js';
import { extractAvgColorFromBlurhash } from '@@/js/extract-avg-color-from-blurhash.js'; import { extractAvgColorFromBlurhash } from '@@/js/extract-avg-color-from-blurhash.js';
import MkImgWithBlurhash from '../MkImgWithBlurhash.vue'; import MkImgWithBlurhash from '../MkImgWithBlurhash.vue';
import MkA from './MkA.vue'; import MkA from './MkA.vue';
import { getStaticImageUrl } from '@/scripts/media-proxy.js'; import { instance as Instance } from '@/instance.js';
import { getStaticImageUrl, getProxiedImageUrlNullable } from '@/scripts/media-proxy.js';
import { acct, userPage } from '@/filters/user.js'; import { acct, userPage } from '@/filters/user.js';
import MkUserOnlineIndicator from '@/components/MkUserOnlineIndicator.vue'; import MkUserOnlineIndicator from '@/components/MkUserOnlineIndicator.vue';
import { defaultStore } from '@/store.js'; import { defaultStore } from '@/store.js';
@ -62,6 +67,11 @@ const props = withDefaults(defineProps<{
indicator?: boolean; indicator?: boolean;
decorations?: (Omit<Misskey.entities.UserDetailed['avatarDecorations'][number], 'id'> & { blink?: boolean; })[]; decorations?: (Omit<Misskey.entities.UserDetailed['avatarDecorations'][number], 'id'> & { blink?: boolean; })[];
forceShowDecoration?: boolean; forceShowDecoration?: boolean;
showInstance?: boolean;
instance?: {
faviconUrl?: string | null,
name?: string | null,
};
}>(), { }>(), {
target: null, target: null,
link: false, link: false,
@ -69,6 +79,8 @@ const props = withDefaults(defineProps<{
indicator: false, indicator: false,
decorations: undefined, decorations: undefined,
forceShowDecoration: false, forceShowDecoration: false,
showInstance: false,
instance: undefined,
}); });
const emit = defineEmits<{ const emit = defineEmits<{
@ -77,6 +89,12 @@ const emit = defineEmits<{
const showDecoration = props.forceShowDecoration || defaultStore.state.showAvatarDecorations; const showDecoration = props.forceShowDecoration || defaultStore.state.showAvatarDecorations;
const instance = props.instance ?? {
name: instanceName,
};
const faviconUrl = computed(() => props.instance ? getProxiedImageUrlNullable(props.instance.faviconUrl, 'preview') : getProxiedImageUrlNullable(Instance.iconUrl, 'preview') ?? '/favicon.ico');
const bound = computed(() => props.link const bound = computed(() => props.link
? { to: userPage(props.user), target: props.target } ? { to: userPage(props.user), target: props.target }
: {}); : {});
@ -343,4 +361,32 @@ watch(() => props.user.avatarBlurhash, () => {
filter: brightness(1); filter: brightness(1);
} }
} }
.instanceIcon {
width: 25px;
height: 25px;
border-radius: 50%;
opacity: 0.65;
z-index: 2;
position: absolute;
left: 0;
bottom: 0;
background: var(--MI_THEME-panel);
box-shadow: 0 0 0 2px var(--MI_THEME-panel);
@container (max-width: 580px) {
width: 21px;
height: 21px;
}
@container (max-width: 450px) {
width: 19px;
height: 19px;
}
@container (max-width: 300px) {
width: 17px;
height: 17px;
}
}
</style> </style>

View File

@ -69,6 +69,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="none">{{ i18n.ts._instanceTicker.none }}</option> <option value="none">{{ i18n.ts._instanceTicker.none }}</option>
<option value="remote">{{ i18n.ts._instanceTicker.remote }}</option> <option value="remote">{{ i18n.ts._instanceTicker.remote }}</option>
<option value="always">{{ i18n.ts._instanceTicker.always }}</option> <option value="always">{{ i18n.ts._instanceTicker.always }}</option>
<option value="remoteIcon">{{ i18n.ts._instanceTicker.remoteIcon }}</option>
<option value="alwaysIcon">{{ i18n.ts._instanceTicker.alwaysIcon }}</option>
</MkSelect> </MkSelect>
<MkSelect v-model="nsfw"> <MkSelect v-model="nsfw">

View File

@ -296,7 +296,7 @@ export const defaultStore = markRaw(new Storage('base', {
}, },
instanceTicker: { instanceTicker: {
where: 'device', where: 'device',
default: 'remote' as 'none' | 'remote' | 'always', default: 'remote' as 'none' | 'remote' | 'always' | 'remoteIcon' | 'alwaysIcon',
}, },
emojiPickerScale: { emojiPickerScale: {
where: 'device', where: 'device',