diff --git a/locales/en-US.yml b/locales/en-US.yml
index 76e0c8edc4..137688b66c 100644
--- a/locales/en-US.yml
+++ b/locales/en-US.yml
@@ -1238,6 +1238,7 @@ noAltTextWarning: "Some attached file(s) have no description. Did you forget to
showNoAltTextWarning: "Show a warning if you attempt to post files without a description"
showAddFileDescriptionAtFirstPost: "Automatically open a form to write a description
when you attempt to post files without a description"
+addAlt4MeTag: "Automatically append #Alt4Me hashtag to your post if attached file has no description"
_emojiModPerm:
unauthorized: "None"
diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts
index 1d38b2798f..c4830f1210 100644
--- a/packages/client/src/account.ts
+++ b/packages/client/src/account.ts
@@ -7,7 +7,7 @@ import { alert, api, popup, popupMenu, waiting } from "@/os";
import icon from "@/scripts/icon";
import { del, get, set } from "@/scripts/idb-proxy";
import { reloadChannel, unisonReload } from "@/scripts/unison-reload";
-import type { MenuButton, MenuUser } from "./types/menu";
+import type { MenuUser } from "./types/menu";
// TODO: 他のタブと永続化されたstateを同期
diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue
index 85da6ac55a..ce1119ed82 100644
--- a/packages/client/src/components/MkPostForm.vue
+++ b/packages/client/src/components/MkPostForm.vue
@@ -1195,6 +1195,13 @@ async function post() {
}
}
+ if (
+ defaultStore.state.addAlt4MeTag &&
+ files.value.some((f) => f.comment == null || f.comment.length === 0)
+ ) {
+ text.value = `${text.value.trimEnd()}\n#Alt4Me`;
+ }
+
const processedText = preprocess(text.value);
let postData: ApiTypes.NoteSubmitReq = {
diff --git a/packages/client/src/pages/settings/general.vue b/packages/client/src/pages/settings/general.vue
index 5f9d252253..54b9f4aa62 100644
--- a/packages/client/src/pages/settings/general.vue
+++ b/packages/client/src/pages/settings/general.vue
@@ -127,12 +127,6 @@
{{
i18n.ts.openServerInfo
}}
- {{
- i18n.ts.showNoAltTextWarning
- }}
- {{
- i18n.ts.showAddFileDescriptionAtFirstPost
- }}
{{
i18n.ts.autocorrectNoteLanguage
}}
@@ -191,6 +185,15 @@
{{ i18n.ts.accessibility }}
+ {{
+ i18n.ts.showNoAltTextWarning
+ }}
+ {{
+ i18n.ts.showAddFileDescriptionAtFirstPost
+ }}
+ {{
+ i18n.ts.addAlt4MeTag
+ }}
{{ i18n.ts.expandOnNoteClick
}}{{
@@ -568,6 +571,7 @@ const mergeThreadInTimeline = computed(
const mergeRenotesInTimeline = computed(
defaultStore.makeGetterSetter("mergeRenotesInTimeline"),
);
+const addAlt4MeTag = computed(defaultStore.makeGetterSetter("addAlt4MeTag"));
// This feature (along with injectPromo) is currently disabled
// function onChangeInjectFeaturedNote(v) {
diff --git a/packages/client/src/pages/settings/preferences-backups.vue b/packages/client/src/pages/settings/preferences-backups.vue
index d0361d39f9..e281e2fd67 100644
--- a/packages/client/src/pages/settings/preferences-backups.vue
+++ b/packages/client/src/pages/settings/preferences-backups.vue
@@ -127,6 +127,10 @@ const defaultStoreSaveKeys: (keyof (typeof defaultStore)["state"])[] = [
"showNoAltTextWarning",
"showAddFileDescriptionAtFirstPost",
"autocorrectNoteLanguage",
+ "addAlt4MeTag",
+ "addRe",
+ "mergeRenotesInTimeline",
+ "mergeThreadInTimeline",
];
const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [
"lightTheme",
diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts
index a25e52ef8f..c1b26136cb 100644
--- a/packages/client/src/store.ts
+++ b/packages/client/src/store.ts
@@ -449,6 +449,10 @@ export const defaultStore = markRaw(
where: "account",
default: false,
},
+ addAlt4MeTag: {
+ where: "account",
+ default: false,
+ },
autocorrectNoteLanguage: {
where: "account",
default: true,