Conversation
|
The settings are not saving after the application restarts, and I don't know yet where to save them properly. |
|
Not sure how to approach this... As mentioned in #1407 we save and load it from the server so it syncs across clients but I was under the assumption that snac2 would return null or an empty string since it doesn't support it but it seems that it always returns 'en': {
"id": "2d49d7e26c495b8ceea54d6011b5d44c",
"username": "awoo",
"acct": "awoo",
"display_name": "awoo",
"created_at": "2025-05-16T07:34:22Z",
"last_status_at": "2025-05-16T07:34:22Z",
"note": "",
"url": "https://127.0.0.1/awoo",
"locked": false,
"bot": false,
"emojis": [
],
"avatar": "https://127.0.0.1/susie.png",
"avatar_static": "https://127.0.0.1/susie.png",
"header": "",
"header_static": "",
"source": {
"privacy": "public",
"language": "en", // <---
"follow_requests_count": 0,
"sensitive": false,
"fields": [
],
"note": "",
"bot": false
},
"followers_count": 0,
"following_count": 0,
"statuses_count": 0
}so there's no real way of having a fallback if every time we sync we get a valid language value :/ |
|
Yes I saw your Issue https://codeberg.org/grunfink/snac2/issues/388
Can we keep the settings somewhere like: settings.bind ("collapse-long-posts", collapse_long_posts, "active", SettingsBindFlags.DEFAULT); |
The problem here is not exactly just the saving part. When you 'activate' an account, we set the default language from the server. snac2 returns 'en' regardless, so the only solution here is removing the sync mechanisms which I won't do. snac2 is the one who needs to supports this and not us removing it :/ For your questions, both are yes. Settings in code live here https://github.com/GeopJr/Tuba/blob/main/src/Services/Settings.vala But it's a bit more complex than usual. There are both global settings and per-account settings, all saved in gsettings. Depending on what you want to do, you might need to use either the global ones or the per-account ones. Here's an example commit of adding a new setting 86b0075 (notice that it has to be added to the gschema file, it requires a vala property and it needs to be added to the array with the other strings to initialize and bind it) |
Solution for #1407