diff --git a/html.c b/html.c index 99da2f7..7d67039 100644 --- a/html.c +++ b/html.c @@ -729,7 +729,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, return xs_str_cat(os, s); } else - if (strcmp(type, "Note") != 0) { + if (strcmp(type, "Note") != 0 && strcmp(type, "Question") != 0) { /* skip oddities */ return os; } @@ -881,6 +881,37 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, } } + if (strcmp(type, "Question") == 0) { + xs_list *oo = xs_dict_get(msg, "oneOf"); + xs_list *ao = xs_dict_get(msg, "anyOf"); + xs_list *p; + xs_dict *v; + + p = oo != NULL ? oo : ao; + + if (!xs_is_null(xs_dict_get(msg, "closed"))) { + /* closed poll */ + c = xs_str_cat(c, "
%s: | %d |