mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-28 23:53:36 +00:00
mastoapi: show the instance's title and short_description, if they exist.
This commit is contained in:
parent
86571f37bb
commit
3d2d75315e
1 changed files with 5 additions and 3 deletions
|
@ -1446,15 +1446,17 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
||||||
/* returns an instance object */
|
/* returns an instance object */
|
||||||
xs *ins = xs_dict_new();
|
xs *ins = xs_dict_new();
|
||||||
const char *host = xs_dict_get(srv_config, "host");
|
const char *host = xs_dict_get(srv_config, "host");
|
||||||
|
const char *title = xs_dict_get(srv_config, "title");
|
||||||
|
const char *sdesc = xs_dict_get(srv_config, "short_description");
|
||||||
|
|
||||||
ins = xs_dict_append(ins, "uri", host);
|
ins = xs_dict_append(ins, "uri", host);
|
||||||
ins = xs_dict_append(ins, "domain", host);
|
ins = xs_dict_append(ins, "domain", host);
|
||||||
ins = xs_dict_append(ins, "title", host);
|
ins = xs_dict_append(ins, "title", title && *title ? title : host);
|
||||||
ins = xs_dict_append(ins, "version", "4.0.0 (not true; really " USER_AGENT ")");
|
ins = xs_dict_append(ins, "version", "4.0.0 (not true; really " USER_AGENT ")");
|
||||||
ins = xs_dict_append(ins, "source_url", WHAT_IS_SNAC_URL);
|
ins = xs_dict_append(ins, "source_url", WHAT_IS_SNAC_URL);
|
||||||
ins = xs_dict_append(ins, "description", host);
|
ins = xs_dict_append(ins, "description", host);
|
||||||
|
|
||||||
ins = xs_dict_append(ins, "short_description", host);
|
ins = xs_dict_append(ins, "short_description", sdesc && *sdesc ? sdesc : host);
|
||||||
|
|
||||||
xs *susie = xs_fmt("%s/susie.png", srv_baseurl);
|
xs *susie = xs_fmt("%s/susie.png", srv_baseurl);
|
||||||
ins = xs_dict_append(ins, "thumbnail", susie);
|
ins = xs_dict_append(ins, "thumbnail", susie);
|
||||||
|
|
Loading…
Reference in a new issue