commit 6e6fa93
default
·
2023-05-30 04:37:09 +0000 UTC
parent 27218d0
Better poll close checks.
1 files changed,
+4,
-4
M
html.c
M
html.c
+4,
-4
1@@ -899,10 +899,10 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
2 int closed = 0;
3
4 if (xs_dict_get(msg, "closed"))
5- closed = 1;
6+ closed = 2;
7 else
8 if (xs_startswith(id, snac->actor))
9- closed = 1; /* we questioned? closed for us */
10+ closed = 1; /* we questioned; closed for us */
11 else {
12 /* not yet closed? check if we already voted for this */
13 xs *children = object_children(id);
14@@ -914,7 +914,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
15 const char *atto = xs_dict_get(msg, "attributedTo");
16
17 if (atto && strcmp(atto, snac->actor) == 0)
18- closed = 1; /* closed for us */
19+ closed = 1; /* we already voted; closed for us */
20 }
21 }
22 }
23@@ -941,7 +941,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
24 c = xs_str_cat(c, "</table>\n");
25
26 /* if it's *really* closed, say it */
27- if (!xs_is_null(xs_dict_get(msg, "closed"))) {
28+ if (closed == 2) {
29 xs *s1 = xs_fmt("<p>%s</p>\n", L("Closed"));
30 c = xs_str_cat(c, s1);
31 }