summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2024-06-18 06:07:58 +0200
committerGravatar default2024-06-18 06:07:58 +0200
commit9be801630a0dd71936cf19d303e5c80c385c44a0 (patch)
tree6c03e9b96d48863d5d62e7cf0e4be21edf388f45
parentAlso send Updates to collected inboxes. (diff)
downloadsnac2-9be801630a0dd71936cf19d303e5c80c385c44a0.tar.gz
snac2-9be801630a0dd71936cf19d303e5c80c385c44a0.tar.xz
snac2-9be801630a0dd71936cf19d303e5c80c385c44a0.zip
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)
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) {