mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-26 01:03:37 +00:00
Better poll close checks.
This commit is contained in:
parent
27218d06d8
commit
6e6fa934b5
1 changed files with 4 additions and 4 deletions
8
html.c
8
html.c
|
@ -899,10 +899,10 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
|
||||||
int closed = 0;
|
int closed = 0;
|
||||||
|
|
||||||
if (xs_dict_get(msg, "closed"))
|
if (xs_dict_get(msg, "closed"))
|
||||||
closed = 1;
|
closed = 2;
|
||||||
else
|
else
|
||||||
if (xs_startswith(id, snac->actor))
|
if (xs_startswith(id, snac->actor))
|
||||||
closed = 1; /* we questioned? closed for us */
|
closed = 1; /* we questioned; closed for us */
|
||||||
else {
|
else {
|
||||||
/* not yet closed? check if we already voted for this */
|
/* not yet closed? check if we already voted for this */
|
||||||
xs *children = object_children(id);
|
xs *children = object_children(id);
|
||||||
|
@ -914,7 +914,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
|
||||||
const char *atto = xs_dict_get(msg, "attributedTo");
|
const char *atto = xs_dict_get(msg, "attributedTo");
|
||||||
|
|
||||||
if (atto && strcmp(atto, snac->actor) == 0)
|
if (atto && strcmp(atto, snac->actor) == 0)
|
||||||
closed = 1; /* closed for us */
|
closed = 1; /* we already voted; closed for us */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -941,7 +941,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
|
||||||
c = xs_str_cat(c, "</table>\n");
|
c = xs_str_cat(c, "</table>\n");
|
||||||
|
|
||||||
/* if it's *really* closed, say it */
|
/* if it's *really* closed, say it */
|
||||||
if (!xs_is_null(xs_dict_get(msg, "closed"))) {
|
if (closed == 2) {
|
||||||
xs *s1 = xs_fmt("<p>%s</p>\n", L("Closed"));
|
xs *s1 = xs_fmt("<p>%s</p>\n", L("Closed"));
|
||||||
c = xs_str_cat(c, s1);
|
c = xs_str_cat(c, s1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue