diff options
| -rw-r--r-- | mastoapi.c | 8 |
1 files changed, 5 insertions, 3 deletions
| @@ -1445,16 +1445,18 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1445 | if (strcmp(cmd, "/v1/instance") == 0) { /** **/ | 1445 | if (strcmp(cmd, "/v1/instance") == 0) { /** **/ |
| 1446 | /* returns an instance object */ | 1446 | /* returns an instance object */ |
| 1447 | xs *ins = xs_dict_new(); | 1447 | xs *ins = xs_dict_new(); |
| 1448 | const char *host = xs_dict_get(srv_config, "host"); | 1448 | const char *host = xs_dict_get(srv_config, "host"); |
| 1449 | const char *title = xs_dict_get(srv_config, "title"); | ||
| 1450 | const char *sdesc = xs_dict_get(srv_config, "short_description"); | ||
| 1449 | 1451 | ||
| 1450 | ins = xs_dict_append(ins, "uri", host); | 1452 | ins = xs_dict_append(ins, "uri", host); |
| 1451 | ins = xs_dict_append(ins, "domain", host); | 1453 | ins = xs_dict_append(ins, "domain", host); |
| 1452 | ins = xs_dict_append(ins, "title", host); | 1454 | ins = xs_dict_append(ins, "title", title && *title ? title : host); |
| 1453 | ins = xs_dict_append(ins, "version", "4.0.0 (not true; really " USER_AGENT ")"); | 1455 | ins = xs_dict_append(ins, "version", "4.0.0 (not true; really " USER_AGENT ")"); |
| 1454 | ins = xs_dict_append(ins, "source_url", WHAT_IS_SNAC_URL); | 1456 | ins = xs_dict_append(ins, "source_url", WHAT_IS_SNAC_URL); |
| 1455 | ins = xs_dict_append(ins, "description", host); | 1457 | ins = xs_dict_append(ins, "description", host); |
| 1456 | 1458 | ||
| 1457 | ins = xs_dict_append(ins, "short_description", host); | 1459 | ins = xs_dict_append(ins, "short_description", sdesc && *sdesc ? sdesc : host); |
| 1458 | 1460 | ||
| 1459 | xs *susie = xs_fmt("%s/susie.png", srv_baseurl); | 1461 | xs *susie = xs_fmt("%s/susie.png", srv_baseurl); |
| 1460 | ins = xs_dict_append(ins, "thumbnail", susie); | 1462 | ins = xs_dict_append(ins, "thumbnail", susie); |