diff --git a/src/local_config_set.c b/src/local_config_set.c index 7d63507..5f193bc 100644 --- a/src/local_config_set.c +++ b/src/local_config_set.c @@ -65,19 +65,21 @@ int set_config_int(struct session* ssn, void load_config(struct session* ssn, mastodont_t* api) { - // TODO update - /* if (ssn->post.theme) */ - /* { */ - /* struct mstdnt_attachment* attachments = NULL; */ - /* struct mstdnt_storage* storage = NULL; */ - /* if (try_upload_media(&storage, ssn, api, &attachments, NULL) == 0) */ - /* { */ - /* set_config_str(&(ssn->config.background_url), "background_url", attachments[0].url); */ - /* } */ + if (ssn->post.set.is_set) + { + struct mstdnt_attachment* attachments = NULL; + struct mstdnt_storage* storage = NULL; + if (try_upload_media(&storage, ssn, api, &attachments, NULL) == 0) + { + struct key atm = { .type.s = attachments[0].url, .is_set = 1 }; + set_config_str(ssn, &(ssn->config.background_url), "background_url", &(atm), &(ssn->cookies.background_url)); + } - /* if (storage) */ - /* cleanup_media_storages(ssn, storage); */ - /* } */ + if (storage) + cleanup_media_storages(ssn, storage); + } + if (!ssn->post.set.is_set) + ssn->config.background_url = keystr(ssn->cookies.background_url); set_config_str(LOAD_CFG_SIM("theme", theme)); set_config_int(LOAD_CFG_SIM("themeclr", themeclr)); set_config_int(LOAD_CFG_SIM("jsactions", jsactions)); diff --git a/static/attachment_audio.html b/static/attachment_audio.html index 013fecd..dd946a7 100644 --- a/static/attachment_audio.html +++ b/static/attachment_audio.html @@ -1,7 +1,7 @@
diff --git a/static/config_general.html b/static/config_general.html index f470748..252ea41 100644 --- a/static/config_general.html +++ b/static/config_general.html @@ -10,54 +10,54 @@ -