diff options
author | default <nobody@localhost> | 2024-05-31 11:24:39 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2024-05-31 11:24:39 +0200 |
commit | affab3ab3c6120cb08cc3c649cc1f16698cea679 (patch) | |
tree | eff571d9370d41461fc0745a4176fe8ea7725265 /mastoapi.c | |
parent | f1712dbe5d73bb75df1c3d332ca57ebc430ceda3 (diff) |
Minor tweaks.
Diffstat (limited to 'mastoapi.c')
-rw-r--r-- | mastoapi.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2010,8 +2010,11 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, const t_announcement *annce = announcement(la); if (annce != NULL && annce->text != NULL) { xs *an = xs_dict_new(); - an = xs_dict_set(an, "id", xs_fmt("%d", annce->timestamp)); - an = xs_dict_set(an, "content", xs_fmt("<p>%s</p>", annce->text)); + xs *id = xs_fmt("%d", annce->timestamp); + xs *ct = xs_fmt("<p>%s</p>", annce->text); + + an = xs_dict_set(an, "id", id); + an = xs_dict_set(an, "content", ct); an = xs_dict_set(an, "starts_at", xs_stock(XSTYPE_NULL)); an = xs_dict_set(an, "ends_at", xs_stock(XSTYPE_NULL)); an = xs_dict_set(an, "all_day", xs_stock(XSTYPE_TRUE)); |