Fix background image upload

FossilOrigin-Name: d49f0fd8eaa657908148bd3194ccdb2a8bc9a26945fa807f61f7c43d27e7477b
This commit is contained in:
nekobit 2022-05-24 06:40:14 +00:00
parent 385efb634d
commit bb9643fa12
4 changed files with 48 additions and 45 deletions

View file

@ -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));

View file

@ -1,7 +1,7 @@
<div class="attachment-container attachment-audio">
<!-- Here even if not sensitive -->
<div class="sensitive-placeholder %s"></div>
<audiowidth="256" controls preload="metadata">
<audio width="256" controls preload="metadata">
<source src="%s">
</video>
</div>

View file

@ -10,54 +10,54 @@
<input type="checkbox" id="cfgjs" name="js" value="1" %s>
<label for="cfgjs">Enable JavaScript - If disabled, overrides options below</label>
</li>
<li>
<input type="checkbox" id="cfgjsactions" name="jsactions" value="1" %s>
<label for="cfgjsactions">Quick actions - Likes, Boosts, etc done in background</label>
</li>
<li>
<input type="checkbox" id="cfgjsreply" name="jsreply" value="1" %s>
<label for="cfgjsreply">Quick reply - Replies don't require redirects</label>
</li>
<li>
<input type="checkbox" id="cfgjslive" name="jslive" value="1" %s>
<label for="cfgjslive">Live update - Statuses, chats, and reactions fetch on the fly</label>
</li>
<!-- <li> -->
<!-- <input type="checkbox" id="cfgjsactions" name="jsactions" value="1" %s> -->
<!-- <label for="cfgjsactions">Quick actions - Likes, Boosts, etc done in background</label> -->
<!-- </li> -->
<!-- <li> -->
<!-- <input type="checkbox" id="cfgjsreply" name="jsreply" value="1" %s> -->
<!-- <label for="cfgjsreply">Quick reply - Replies don't require redirects</label> -->
<!-- </li> -->
<!-- <li> -->
<!-- <input type="checkbox" id="cfgjslive" name="jslive" value="1" %s> -->
<!-- <label for="cfgjslive">Live update - Statuses, chats, and reactions fetch on the fly</label> -->
<!-- </li> -->
</ul>
<h3>Statuses</h3>
<ul>
<li>
<input type="checkbox" id="cfgstatattachments" name="statattachments" value="1" %s>
<label for="cfgstatattachments">Show attachments - If disabled, attachments are links instead</label>
</li>
<!-- <li> -->
<!-- <input type="checkbox" id="cfgstatattachments" name="statattachments" value="1" %s> -->
<!-- <label for="cfgstatattachments">Show attachments - If disabled, attachments are links instead</label> -->
<!-- </li> -->
<li>
<input type="checkbox" id="cfgstatgreentexts" name="statgreentexts" value="1" %s>
<label for="cfgstatgreentexts">Show greentexts</label>
</li>
<li>
<input type="checkbox" id="cfgstatdope" name="statdope" value="1" %s>
<label for="cfgstatdope">Show dopameme numbers - Likes, comments, and boost counts</label>
</li>
<!-- <li> -->
<!-- <input type="checkbox" id="cfgstatdope" name="statdope" value="1" %s> -->
<!-- <label for="cfgstatdope">Show dopameme numbers - Likes, comments, and boost counts</label> -->
<!-- </li> -->
<li>
<input type="checkbox" id="cfgstatoneclicksoftware" name="statoneclicksoftware" value="1" %s>
<label for="cfgstatoneclicksoftware">Show Like-Boost button - Show a button in the status which likes and boosts a post</label>
</li>
<li>
<input type="checkbox" id="cfgstatemojolikes" name="statemojolikes" value="1" %s>
<label for="cfgstatemojolikes">Convert Emoji reacts to likes - Also disables the emoji reaction button</label>
</li>
<li>
<input type="checkbox" id="cfgstathidemuted" name="stathidemuted" value="1" %s>
<label for="cfgstathidemuted">Hide statuses from muted users and threads - If disabled, statuses will appear collapsed</label>
</li>
<!-- <li> -->
<!-- <input type="checkbox" id="cfgstatemojolikes" name="statemojolikes" value="1" %s> -->
<!-- <label for="cfgstatemojolikes">Convert Emoji reacts to likes - Also disables the emoji reaction button</label> -->
<!-- </li> -->
<!-- <li> -->
<!-- <input type="checkbox" id="cfgstathidemuted" name="stathidemuted" value="1" %s> -->
<!-- <label for="cfgstathidemuted">Hide statuses from muted users and threads - If disabled, statuses will appear collapsed</label> -->
<!-- </li> -->
</ul>
<h3>Instance</h3>
<ul>
<li>
<input type="checkbox" id="cfginstanceshowshoutbox" name="instanceshowshoutbox" value="1" %s>
<label for="cfginstanceshowshoutbox">Show instance shoutbox (JS required)</label>
</li>
<!-- <li> -->
<!-- <input type="checkbox" id="cfginstanceshowshoutbox" name="instanceshowshoutbox" value="1" %s> -->
<!-- <label for="cfginstanceshowshoutbox">Show instance shoutbox (JS required)</label> -->
<!-- </li> -->
<li>
<input type="checkbox" id="cfginstancepanel" name="instancepanel" value="1" %s>
<label for="cfginstancepanel">Show instance panel - <em>Admins should <strong>not</strong> use the instance panel for major announcements</em></label>

1
static/instance.html Normal file
View file

@ -0,0 +1 @@
Instance information