From e8fe0826c296d623c61f54bc65a4f58861376241 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 1 Apr 2025 20:32:26 -0500 Subject: [PATCH 1/2] Support Ditto client tag --- src/actions/statuses.ts | 8 +++++++ src/features/preferences/index.tsx | 6 ++++++ .../status/components/detailed-status.tsx | 21 ++++++++++++++++++- src/schemas/soapbox/settings.ts | 1 + 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/actions/statuses.ts b/src/actions/statuses.ts index ae704e4a3..94b86ac33 100644 --- a/src/actions/statuses.ts +++ b/src/actions/statuses.ts @@ -1,4 +1,5 @@ import { Status as StatusEntity } from 'soapbox/schemas/index.ts'; +import { settingsSchema } from 'soapbox/schemas/soapbox/settings.ts'; import { isLoggedIn } from 'soapbox/utils/auth.ts'; import { getFeatures } from 'soapbox/utils/features.ts'; import { shouldHaveCard } from 'soapbox/utils/status.ts'; @@ -9,6 +10,7 @@ import { setComposeToStatus } from './compose-status.ts'; import { fetchGroupRelationships } from './groups.ts'; import { importFetchedStatus, importFetchedStatuses } from './importer/index.ts'; import { openModal } from './modals.ts'; +import { getSettings } from './settings.ts'; import { deleteFromTimelines } from './timelines.ts'; import type { AppDispatch, RootState } from 'soapbox/store.ts'; @@ -58,6 +60,12 @@ const statusExists = (getState: () => RootState, statusId: string) => { const createStatus = (params: Record, idempotencyKey: string, statusId: string | null) => { return (dispatch: AppDispatch, getState: () => RootState) => { + const settings = settingsSchema.parse(getSettings(getState()).toJS()); + + if (settings.discloseClient) { + params.disclose_client = true; + } + dispatch({ type: STATUS_CREATE_REQUEST, params, idempotencyKey, editing: !!statusId }); const method = statusId === null ? 'POST' : 'PUT'; diff --git a/src/features/preferences/index.tsx b/src/features/preferences/index.tsx index e52921d40..44d58017d 100644 --- a/src/features/preferences/index.tsx +++ b/src/features/preferences/index.tsx @@ -166,6 +166,12 @@ const Preferences = () => { )} + {features.nostr && ( + }> + + + )} + {features.richText && ( }> = ({ {statusTypeIcon} + {actualStatus.application && ( + <> + {actualStatus.application.get('website') ? ( + + + {actualStatus.application.get('name')} + + + ) : ( + + {actualStatus.application.get('name')} + + )} + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} + {' · '} + + )} + @@ -189,7 +207,8 @@ const DetailedStatus: React.FC = ({ {actualStatus.edited_at && ( <> - {' · '} + {/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */} + {' · '}
Date: Tue, 1 Apr 2025 20:39:17 -0500 Subject: [PATCH 2/2] yarn i18n --- src/locales/en.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/locales/en.json b/src/locales/en.json index ffa32345c..0b5b650ed 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1316,6 +1316,7 @@ "preferences.fields.demetricator_label": "Use Demetricator", "preferences.fields.demo_hint": "Use the default Soapbox logo and color scheme. Useful for taking screenshots.", "preferences.fields.demo_label": "Demo mode", + "preferences.fields.disclose_client": "Disclose client", "preferences.fields.display_media.default": "Hide posts marked as sensitive", "preferences.fields.display_media.hide_all": "Always hide posts", "preferences.fields.display_media.show_all": "Always show posts",