mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Don't show the instance announcement in public pages.
This commit is contained in:
parent
534cf2cdc1
commit
9be801630a
1 changed files with 16 additions and 14 deletions
30
html.c
30
html.c
|
@ -788,22 +788,24 @@ static xs_html *html_user_body(snac *user, int read_only)
|
||||||
|
|
||||||
/** instance announcement **/
|
/** instance announcement **/
|
||||||
|
|
||||||
double la = 0.0;
|
if (!read_only) {
|
||||||
xs *user_la = xs_dup(xs_dict_get(user->config, "last_announcement"));
|
double la = 0.0;
|
||||||
if (user_la != NULL)
|
xs *user_la = xs_dup(xs_dict_get(user->config, "last_announcement"));
|
||||||
la = xs_number_get(user_la);
|
if (user_la != NULL)
|
||||||
|
la = xs_number_get(user_la);
|
||||||
|
|
||||||
const t_announcement *an = announcement(la);
|
const t_announcement *an = announcement(la);
|
||||||
if (an != NULL && (an->text != NULL)) {
|
if (an != NULL && (an->text != NULL)) {
|
||||||
xs *s = xs_fmt("?da=%.0f", an->timestamp);
|
xs *s = xs_fmt("?da=%.0f", an->timestamp);
|
||||||
|
|
||||||
xs_html_add(top_user, xs_html_tag("div",
|
xs_html_add(top_user, xs_html_tag("div",
|
||||||
xs_html_attr("class", "snac-announcement"),
|
xs_html_attr("class", "snac-announcement"),
|
||||||
xs_html_text(an->text),
|
xs_html_text(an->text),
|
||||||
xs_html_text(" "),
|
xs_html_text(" "),
|
||||||
xs_html_tag("a",
|
xs_html_tag("a",
|
||||||
xs_html_attr("href", s),
|
xs_html_attr("href", s),
|
||||||
xs_html_text("Dismiss"))));
|
xs_html_text("Dismiss"))));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (read_only) {
|
if (read_only) {
|
||||||
|
|
Loading…
Reference in a new issue