diff options
| author | 2024-06-18 06:07:58 +0200 | |
|---|---|---|
| committer | 2024-06-18 06:07:58 +0200 | |
| commit | 9be801630a0dd71936cf19d303e5c80c385c44a0 (patch) | |
| tree | 6c03e9b96d48863d5d62e7cf0e4be21edf388f45 /html.c | |
| parent | Also send Updates to collected inboxes. (diff) | |
| download | penes-snac2-9be801630a0dd71936cf19d303e5c80c385c44a0.tar.gz penes-snac2-9be801630a0dd71936cf19d303e5c80c385c44a0.tar.xz penes-snac2-9be801630a0dd71936cf19d303e5c80c385c44a0.zip | |
Don't show the instance announcement in public pages.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 34 |
1 files changed, 18 insertions, 16 deletions
| @@ -788,22 +788,24 @@ static xs_html *html_user_body(snac *user, int read_only) | |||
| 788 | 788 | ||
| 789 | /** instance announcement **/ | 789 | /** instance announcement **/ |
| 790 | 790 | ||
| 791 | double la = 0.0; | 791 | if (!read_only) { |
| 792 | xs *user_la = xs_dup(xs_dict_get(user->config, "last_announcement")); | 792 | double la = 0.0; |
| 793 | if (user_la != NULL) | 793 | xs *user_la = xs_dup(xs_dict_get(user->config, "last_announcement")); |
| 794 | la = xs_number_get(user_la); | 794 | if (user_la != NULL) |
| 795 | 795 | la = xs_number_get(user_la); | |
| 796 | const t_announcement *an = announcement(la); | 796 | |
| 797 | if (an != NULL && (an->text != NULL)) { | 797 | const t_announcement *an = announcement(la); |
| 798 | xs *s = xs_fmt("?da=%.0f", an->timestamp); | 798 | if (an != NULL && (an->text != NULL)) { |
| 799 | 799 | xs *s = xs_fmt("?da=%.0f", an->timestamp); | |
| 800 | xs_html_add(top_user, xs_html_tag("div", | 800 | |
| 801 | xs_html_attr("class", "snac-announcement"), | 801 | xs_html_add(top_user, xs_html_tag("div", |
| 802 | xs_html_text(an->text), | 802 | xs_html_attr("class", "snac-announcement"), |
| 803 | xs_html_text(" "), | 803 | xs_html_text(an->text), |
| 804 | xs_html_tag("a", | 804 | xs_html_text(" "), |
| 805 | xs_html_attr("href", s), | 805 | xs_html_tag("a", |
| 806 | xs_html_text("Dismiss")))); | 806 | xs_html_attr("href", s), |
| 807 | xs_html_text("Dismiss")))); | ||
| 808 | } | ||
| 807 | } | 809 | } |
| 808 | 810 | ||
| 809 | if (read_only) { | 811 | if (read_only) { |