Skip to content

Commit

Permalink
Merge branch 'develop' into fix_sensitive_reaction
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo authored Dec 26, 2023
2 parents 1ca8eff + 75034d9 commit f4de34a
Show file tree
Hide file tree
Showing 114 changed files with 384 additions and 346 deletions.
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/01_bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,9 @@ body:
render: markdown
validations:
required: false

- type: checkboxes
attributes:
label: Do you want to address this bug yourself?
options:
- label: Yes, I will patch the bug myself and send a pull request
7 changes: 6 additions & 1 deletion .github/ISSUE_TEMPLATE/02_feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@ body:
label: Purpose
description: Describe the specific problem or need you think this feature will solve, and who it will help.
validations:
required: true
required: true
- type: checkboxes
attributes:
label: Do you want to implement this feature yourself?
options:
- label: Yes, I will implement this by myself and send a pull request
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- Enhance: センシティブワードの設定がハッシュタグトレンドにも適用されるようになりました
- Fix: 1702718871541-ffVisibility.jsのdownが壊れている
- Fix:「非センシティブのみ(リモートはいいねのみ)」を設定していても、センシティブに設定されたカスタム絵文字をリアクションできる問題を修正
- Fix: ロールアサイン時の通知で,ロールアイコンが縮小されずに表示される問題を修正

## 2023.12.0

Expand Down
4 changes: 4 additions & 0 deletions packages/backend/src/server/api/endpoints/admin/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,10 @@ export const meta = {
type: 'string',
optional: false, nullable: true,
},
shortName: {
type: 'string',
optional: false, nullable: true,
},
objectStorageS3ForcePathStyle: {
type: 'boolean',
optional: false, nullable: false,
Expand Down
72 changes: 9 additions & 63 deletions packages/backend/src/server/api/endpoints/federation/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,10 @@ export const meta = {
optional: false,
nullable: false,
items: {
properties: {
id: { type: 'string' },
firstRetrievedAt: { type: 'string' },
host: { type: 'string' },
usersCount: { type: 'number' },
notesCount: { type: 'number' },
followingCount: { type: 'number' },
followersCount: { type: 'number' },
isNotResponding: { type: 'boolean' },
isSuspended: { type: 'boolean' },
isBlocked: { type: 'boolean' },
softwareName: { type: 'string' },
softwareVersion: { type: 'string' },
openRegistrations: { type: 'boolean' },
name: { type: 'string' },
description: { type: 'string' },
maintainerName: { type: 'string' },
maintainerEmail: { type: 'string' },
isSilenced: { type: 'boolean' },
iconUrl: { type: 'string' },
faviconUrl: { type: 'string' },
themeColor: { type: 'string' },
infoUpdatedAt: {
type: 'string',
nullable: true,
},
latestRequestReceivedAt: {
type: 'string',
nullable: true,
},
}
type: 'object',
optional: false,
nullable: false,
ref: 'FederationInstance',
},
},
otherFollowersCount: { type: 'number' },
Expand All @@ -68,42 +41,15 @@ export const meta = {
optional: false,
nullable: false,
items: {
properties: {
id: { type: 'string' },
firstRetrievedAt: { type: 'string' },
host: { type: 'string' },
usersCount: { type: 'number' },
notesCount: { type: 'number' },
followingCount: { type: 'number' },
followersCount: { type: 'number' },
isNotResponding: { type: 'boolean' },
isSuspended: { type: 'boolean' },
isBlocked: { type: 'boolean' },
softwareName: { type: 'string' },
softwareVersion: { type: 'string' },
openRegistrations: { type: 'boolean' },
name: { type: 'string' },
description: { type: 'string' },
maintainerName: { type: 'string' },
maintainerEmail: { type: 'string' },
isSilenced: { type: 'boolean' },
iconUrl: { type: 'string' },
faviconUrl: { type: 'string' },
themeColor: { type: 'string' },
infoUpdatedAt: {
type: 'string',
nullable: true,
},
latestRequestReceivedAt: {
type: 'string',
nullable: true,
},
}
type: 'object',
optional: false,
nullable: false,
ref: 'FederationInstance',
},
},
otherFollowingCount: { type: 'number' },
},
}
},
} as const;

export const paramDef = {
Expand Down
16 changes: 15 additions & 1 deletion packages/backend/src/server/api/endpoints/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,34 @@ export const meta = {
type: 'object',
optional: false, nullable: false,
properties: {
place: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
url: {
type: 'string',
optional: false, nullable: false,
format: 'url',
},
place: {
type: 'string',
optional: false, nullable: false,
},
ratio: {
type: 'number',
optional: false, nullable: false,
},
imageUrl: {
type: 'string',
optional: false, nullable: false,
format: 'url',
},
dayOfWeek: {
type: 'integer',
optional: false, nullable: false,
},
},
},
},
Expand Down
4 changes: 4 additions & 0 deletions packages/backend/src/server/api/endpoints/notes/translate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export const meta = {
res: {
type: 'object',
optional: false, nullable: false,
properties: {
sourceLang: { type: 'string' },
text: { type: 'string' },
},
},

errors: {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkAchievements.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const props = withDefaults(defineProps<{
withDescription: true,
});

const achievements = ref();
const achievements = ref<Misskey.entities.UsersAchievementsResponse | null>(null);
const lockedAchievements = computed(() => ACHIEVEMENT_TYPES.filter(x => !(achievements.value ?? []).some(a => a.name === x)));

function fetch() {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkCaptcha.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export type Captcha = {
getResponse(id: string): string;
};

type CaptchaProvider = 'hcaptcha' | 'recaptcha' | 'turnstile';
export type CaptchaProvider = 'hcaptcha' | 'recaptcha' | 'turnstile';

type CaptchaContainer = {
readonly [_ in CaptchaProvider]?: Captcha;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const self = props.url.startsWith(local);
const attr = self ? 'to' : 'href';
const target = self ? null : '_blank';

const el = ref();
const el = ref<HTMLElement>();

useTooltip(el, (showing) => {
os.popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkMarquee.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default {
},
},
setup(props) {
const contentEl = ref();
const contentEl = ref<HTMLElement>();

function calc() {
const eachLength = contentEl.value.offsetWidth / props.repeat;
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ const collapsed = ref(appearNote.value.cw == null && isLong);
const isDeleted = ref(false);
const muted = ref(checkMute(appearNote.value, $i?.mutedWords));
const hardMuted = ref(props.withHardMute && checkMute(appearNote.value, $i?.hardMutedWords));
const translation = ref<any>(null);
const translation = ref<Misskey.entities.NotesTranslateResponse | null>(null);
const translating = ref(false);
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.value.user.instance);
const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || (appearNote.value.visibility === 'followers' && appearNote.value.userId === $i.id));
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/MkNoteDetailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ const isMyRenote = $i && ($i.id === note.value.userId);
const showContent = ref(false);
const isDeleted = ref(false);
const muted = ref($i ? checkWordMute(appearNote.value, $i, $i.mutedWords) : false);
const translation = ref(null);
const translation = ref<Misskey.entities.NotesTranslateResponse | null>(null);
const translating = ref(false);
const parsed = appearNote.value.text ? mfm.parse(appearNote.value.text) : null;
const urls = parsed ? extractUrlFromMfm(parsed) : null;
Expand All @@ -299,7 +299,7 @@ provide('react', (reaction: string) => {
});

const tab = ref('replies');
const reactionTabType = ref(null);
const reactionTabType = ref<string | null>(null);

const renotesPagination = computed(() => ({
endpoint: 'notes/renotes',
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkNotification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<i v-else-if="notification.type === 'quote'" class="ti ti-quote"></i>
<i v-else-if="notification.type === 'pollEnded'" class="ti ti-chart-arrows"></i>
<i v-else-if="notification.type === 'achievementEarned'" class="ti ti-medal"></i>
<img v-else-if="notification.type === 'roleAssigned'" :src="notification.role.iconUrl" alt=""/>
<img v-else-if="notification.type === 'roleAssigned'" style="height: 1.3em; vertical-align: -22%;" :src="notification.role.iconUrl" alt=""/>
<!-- notification.reaction が null になることはまずないが、ここでoptional chaining使うと一部ブラウザで刺さるので念の為 -->
<MkReactionIcon
v-else-if="notification.type === 'reaction'"
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkPasswordDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const emit = defineEmits<{
const dialog = shallowRef<InstanceType<typeof MkModalWindow>>();
const passwordInput = shallowRef<InstanceType<typeof MkInput>>();
const password = ref('');
const token = ref(null);
const token = ref<string | null>(null);

function onClose() {
emit('cancelled');
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/components/MkPostForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ watch(showPreview, () => defaultStore.set('showPreview', showPreview.value));
const cw = ref<string | null>(props.initialCw ?? null);
const localOnly = ref<boolean>(props.initialLocalOnly ?? defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly);
const visibility = ref(props.initialVisibility ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility) as typeof Misskey.noteVisibilities[number]);
const visibleUsers = ref([]);
const visibleUsers = ref<Misskey.entities.UserDetailed[]>([]);
if (props.initialVisibleUsers) {
props.initialVisibleUsers.forEach(pushVisibleUser);
}
const reactionAcceptance = ref(defaultStore.state.reactionAcceptance);
const autocomplete = ref(null);
const draghover = ref(false);
const quoteId = ref(null);
const quoteId = ref<string | null>(null);
const hasNotSpecifiedMentions = ref(false);
const recentHashtags = ref(JSON.parse(miLocalStorage.getItem('hashtags') ?? '[]'));
const imeText = ref('');
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/src/components/MkRolePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ SPDX-License-Identifier: AGPL-3.0-only

<script lang="ts" setup>
import { } from 'vue';
import * as Misskey from 'misskey-js';
import { i18n } from '@/i18n.js';

const props = withDefaults(defineProps<{
role: any;
role: Misskey.entities.Role;
forModeration: boolean;
detailed: boolean;
}>(), {
Expand Down
8 changes: 4 additions & 4 deletions packages/frontend/src/components/MkSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ const opening = ref(false);
const changed = ref(false);
const invalid = ref(false);
const filled = computed(() => v.value !== '' && v.value != null);
const inputEl = ref(null);
const prefixEl = ref(null);
const suffixEl = ref(null);
const container = ref(null);
const inputEl = ref<HTMLObjectElement | null>(null);
const prefixEl = ref<HTMLElement | null>(null);
const suffixEl = ref<HTMLElement | null>(null);
const container = ref<HTMLElement | null>(null);
const height =
props.small ? 33 :
props.large ? 39 :
Expand Down
8 changes: 0 additions & 8 deletions packages/frontend/src/components/MkSignin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ const host = ref(toUnicode(configHost));
const totpLogin = ref(false);
const queryingKey = ref(false);
const credentialRequest = ref<CredentialRequestOptions | null>(null);
const hCaptchaResponse = ref(null);
const reCaptchaResponse = ref(null);

const emit = defineEmits<{
(ev: 'login', v: any): void;
Expand Down Expand Up @@ -126,8 +124,6 @@ async function queryKey(): Promise<void> {
username: username.value,
password: password.value,
credential: credential.toJSON(),
'hcaptcha-response': hCaptchaResponse.value,
'g-recaptcha-response': reCaptchaResponse.value,
});
}).then(res => {
emit('login', res);
Expand All @@ -149,8 +145,6 @@ function onSubmit(): void {
os.api('signin', {
username: username.value,
password: password.value,
'hcaptcha-response': hCaptchaResponse.value,
'g-recaptcha-response': reCaptchaResponse.value,
}).then(res => {
totpLogin.value = true;
signing.value = false;
Expand All @@ -168,8 +162,6 @@ function onSubmit(): void {
os.api('signin', {
username: username.value,
password: password.value,
'hcaptcha-response': hCaptchaResponse.value,
'g-recaptcha-response': reCaptchaResponse.value,
token: user.value?.twoFactorEnabled ? token.value : undefined,
}).then(res => {
emit('login', res);
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/src/components/MkSignupDialog.form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ const emailState = ref<null | 'wait' | 'ok' | 'unavailable:used' | 'unavailable:
const passwordStrength = ref<'' | 'low' | 'medium' | 'high'>('');
const passwordRetypeState = ref<null | 'match' | 'not-match'>(null);
const submitting = ref<boolean>(false);
const hCaptchaResponse = ref(null);
const reCaptchaResponse = ref(null);
const turnstileResponse = ref(null);
const hCaptchaResponse = ref<string | null>(null);
const reCaptchaResponse = ref<string | null>(null);
const turnstileResponse = ref<string | null>(null);
const usernameAbortController = ref<null | AbortController>(null);
const emailAbortController = ref<null | AbortController>(null);

Expand Down
9 changes: 8 additions & 1 deletion packages/frontend/src/components/MkSparkle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { onMounted, onUnmounted, ref, shallowRef } from 'vue';

const particles = ref([]);
const particles = ref<{
id: string,
x: number,
y: number,
size: number,
dur: number,
color: string
}[]>([]);
const el = shallowRef<HTMLElement>();
const width = ref(0);
const height = ref(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const props = defineProps<{
announcement?: any,
}>();

const dialog = ref(null);
const dialog = ref<InstanceType<typeof MkModalWindow> | null>(null);
const title = ref<string>(props.announcement ? props.announcement.title : '');
const text = ref<string>(props.announcement ? props.announcement.text : '');
const icon = ref<string>(props.announcement ? props.announcement.icon : 'info');
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkWidgets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const widgetRefs = {};
const configWidget = (id: string) => {
widgetRefs[id].configure();
};
const widgetAdderSelected = ref(null);
const widgetAdderSelected = ref<string | null>(null);
const addWidget = () => {
if (widgetAdderSelected.value == null) return;

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/form/suspense.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const props = defineProps<{
const pending = ref(true);
const resolved = ref(false);
const rejected = ref(false);
const result = ref(null);
const result = ref<any>(null);

const process = () => {
if (props.p == null) {
Expand Down
Loading

0 comments on commit f4de34a

Please sign in to comment.