diff options
| -rw-r--r-- | html.c | 4 | ||||
| -rw-r--r-- | mastoapi.c | 7 |
2 files changed, 8 insertions, 3 deletions
| @@ -795,12 +795,14 @@ static xs_html *html_user_body(snac *user, int read_only) | |||
| 795 | 795 | ||
| 796 | const t_announcement *an = announcement(la); | 796 | const t_announcement *an = announcement(la); |
| 797 | if (an != NULL && (an->text != NULL)) { | 797 | if (an != NULL && (an->text != NULL)) { |
| 798 | xs *s = xs_fmt("?da=%.0f", an->timestamp); | ||
| 799 | |||
| 798 | xs_html_add(top_user, xs_html_tag("div", | 800 | xs_html_add(top_user, xs_html_tag("div", |
| 799 | xs_html_attr("class", "snac-announcement"), | 801 | xs_html_attr("class", "snac-announcement"), |
| 800 | xs_html_text(an->text), | 802 | xs_html_text(an->text), |
| 801 | xs_html_text(" "), | 803 | xs_html_text(" "), |
| 802 | xs_html_sctag("a", | 804 | xs_html_sctag("a", |
| 803 | xs_html_attr("href", xs_dup(xs_fmt("?da=%.0f", an->timestamp)))), | 805 | xs_html_attr("href", s)), |
| 804 | xs_html_text("Dismiss"))); | 806 | xs_html_text("Dismiss"))); |
| 805 | } | 807 | } |
| 806 | 808 | ||
| @@ -2010,8 +2010,11 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 2010 | const t_announcement *annce = announcement(la); | 2010 | const t_announcement *annce = announcement(la); |
| 2011 | if (annce != NULL && annce->text != NULL) { | 2011 | if (annce != NULL && annce->text != NULL) { |
| 2012 | xs *an = xs_dict_new(); | 2012 | xs *an = xs_dict_new(); |
| 2013 | an = xs_dict_set(an, "id", xs_fmt("%d", annce->timestamp)); | 2013 | xs *id = xs_fmt("%d", annce->timestamp); |
| 2014 | an = xs_dict_set(an, "content", xs_fmt("<p>%s</p>", annce->text)); | 2014 | xs *ct = xs_fmt("<p>%s</p>", annce->text); |
| 2015 | |||
| 2016 | an = xs_dict_set(an, "id", id); | ||
| 2017 | an = xs_dict_set(an, "content", ct); | ||
| 2015 | an = xs_dict_set(an, "starts_at", xs_stock(XSTYPE_NULL)); | 2018 | an = xs_dict_set(an, "starts_at", xs_stock(XSTYPE_NULL)); |
| 2016 | an = xs_dict_set(an, "ends_at", xs_stock(XSTYPE_NULL)); | 2019 | an = xs_dict_set(an, "ends_at", xs_stock(XSTYPE_NULL)); |
| 2017 | an = xs_dict_set(an, "all_day", xs_stock(XSTYPE_TRUE)); | 2020 | an = xs_dict_set(an, "all_day", xs_stock(XSTYPE_TRUE)); |