gabboman / wafrn

Wafrn is a federated social media inspired by tumblr. Join us and have fun
https://app.wafrn.net/dashboard/exploreLocal
GNU Affero General Public License v3.0
126 stars 38 forks source link

[BACKEND] [Feature Request] Allow storing a dynamic set of options in the user profile #141

Closed juandjara closed 2 weeks ago

juandjara commented 2 weeks ago

I hereby request thy feature, that any consumer of the API might save any wafrn.option.... when using the editProfile endpoint. This will allow for endless customization of the different API clients without the need to hardcode every option that one desires to keep persisted.

For doing so, many things might be changed so both the web frontend and the backend can support this. Right now, in the frontend, options management is spread across many services, so this is the main difficulty.

I have done an initial research of the handling of options, and have come to something like this, tracing the usage of option keys:

options defined in profile-edit and passed to backend when editing

avatar name disableNSFWFilter disableGifsByDefault defaultPostEditorPrivacy asksLevel description federateWithThreads disableForceAltText forceClassicLogo manuallyAcceptsFollows forceOldEditor mutedWords

13 fields

options used in profile-edit ngOnInit

disableNSFWFilter defaultPostEditorPrivacy forceClassicLogo federateWithThreads disableForceAltText forceOldEditor asksLevel mutedWords ...others from form

8 fields explicit from different sources, the rest implicit from the form

options read in backend

disableForceAltText federateWithThreads asksLevel forceClassicLogo defaultPostEditorPrivacy mutedWords

6 fields as "options"

manuallyAcceptsFollows name description avatar

4 fields saved directly into user model