summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-06-18 06:07:58 +0200
committerdefault <nobody@localhost>2024-06-18 06:07:58 +0200
commit9be801630a0dd71936cf19d303e5c80c385c44a0 (patch)
tree6c03e9b96d48863d5d62e7cf0e4be21edf388f45
parent534cf2cdc1ef2baced71015583ff62d532d4dad3 (diff)
Don't show the instance announcement in public pages.
-rw-r--r--html.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/html.c b/html.c
index 44b5433..b4daf44 100644
--- a/html.c
+++ b/html.c
@@ -788,22 +788,24 @@ static xs_html *html_user_body(snac *user, int read_only)
/** instance announcement **/
- double la = 0.0;
- xs *user_la = xs_dup(xs_dict_get(user->config, "last_announcement"));
- if (user_la != NULL)
- la = xs_number_get(user_la);
-
- const t_announcement *an = announcement(la);
- if (an != NULL && (an->text != NULL)) {
- xs *s = xs_fmt("?da=%.0f", an->timestamp);
-
- xs_html_add(top_user, xs_html_tag("div",
- xs_html_attr("class", "snac-announcement"),
- xs_html_text(an->text),
- xs_html_text(" "),
- xs_html_tag("a",
- xs_html_attr("href", s),
- xs_html_text("Dismiss"))));
+ if (!read_only) {
+ double la = 0.0;
+ xs *user_la = xs_dup(xs_dict_get(user->config, "last_announcement"));
+ if (user_la != NULL)
+ la = xs_number_get(user_la);
+
+ const t_announcement *an = announcement(la);
+ if (an != NULL && (an->text != NULL)) {
+ xs *s = xs_fmt("?da=%.0f", an->timestamp);
+
+ xs_html_add(top_user, xs_html_tag("div",
+ xs_html_attr("class", "snac-announcement"),
+ xs_html_text(an->text),
+ xs_html_text(" "),
+ xs_html_tag("a",
+ xs_html_attr("href", s),
+ xs_html_text("Dismiss"))));
+ }
}
if (read_only) {