Return actual user preferences instead of hardcoded values#426
Open
vigneshakaviki wants to merge 1 commit intofedify-dev:mainfrom
Open
Return actual user preferences instead of hardcoded values#426vigneshakaviki wants to merge 1 commit intofedify-dev:mainfrom
vigneshakaviki wants to merge 1 commit intofedify-dev:mainfrom
Conversation
Read posting:default:visibility, posting:default:sensitive, and posting:default:language from the authenticated user's account settings instead of returning hardcoded defaults from the GET /api/v1/preferences endpoint. Fixes fedify-dev#425
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
GET /api/v1/preferencesendpoint was returning hardcoded default values for all Mastodon preferences, ignoring the user's actual settings stored in the database.This change reads
posting:default:visibility,posting:default:sensitive, andposting:default:languagefrom the authenticated user's account owner and account records instead of returning static defaults.Fixes #425
What changed
accountOwnerfrom the request tokenowner.visibilityforposting:default:visibilityowner.account.sensitiveforposting:default:sensitiveowner.languageforposting:default:languagereading:expand:mediaandreading:expand:spoilersremain as defaults since there are no corresponding database columns yetTest plan
tsc)biome check)GET /api/v1/preferencesreturns actual user settings with a Mastodon client