summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar default2023-05-24 10:23:57 +0200
committerGravatar default2023-05-24 10:23:57 +0200
commit4f0ab18f1c7b2a8e31660b49904dc2fa2ba90eba (patch)
tree591d5ae43f158ceca5362fb860cae242cb7d3349 /html.c
parentFinished polls are shown. (diff)
downloadsnac2-4f0ab18f1c7b2a8e31660b49904dc2fa2ba90eba.tar.gz
snac2-4f0ab18f1c7b2a8e31660b49904dc2fa2ba90eba.tar.xz
snac2-4f0ab18f1c7b2a8e31660b49904dc2fa2ba90eba.zip
Show a ballot box emoji in the score if the enttry it's a poll.
Diffstat (limited to 'html.c')
-rw-r--r--html.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/html.c b/html.c
index 7d67039..8d4adfb 100644
--- a/html.c
+++ b/html.c
@@ -745,6 +745,14 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
745 if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL))) 745 if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL)))
746 return os; 746 return os;
747 747
748 s = xs_str_cat(s, "<div class=\"snac-score\">");
749
750 if (strcmp(type, "Question") == 0) {
751 /* add the ballot box emoji */
752 xs *f = xs_fmt("<span title=\"%s\"> &#128499; </span>", L("Poll"));
753 s = xs_str_cat(s, f);
754 }
755
748 /* if this is our post, add the score */ 756 /* if this is our post, add the score */
749 if (xs_startswith(id, snac->actor)) { 757 if (xs_startswith(id, snac->actor)) {
750 int n_likes = object_likes_len(id); 758 int n_likes = object_likes_len(id);
@@ -752,13 +760,13 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
752 760
753 /* alternate emojis: %d &#128077; %d &#128257; */ 761 /* alternate emojis: %d &#128077; %d &#128257; */
754 762
755 xs *s1 = xs_fmt( 763 xs *s1 = xs_fmt("%d &#9733; %d &#8634;\n", n_likes, n_boosts);
756 "<div class=\"snac-score\">%d &#9733; %d &#8634;</div>\n",
757 n_likes, n_boosts);
758 764
759 s = xs_str_cat(s, s1); 765 s = xs_str_cat(s, s1);
760 } 766 }
761 767
768 s = xs_str_cat(s, "</div>\n");
769
762 if (level == 0) 770 if (level == 0)
763 s = xs_str_cat(s, "<div class=\"snac-post\">\n"); 771 s = xs_str_cat(s, "<div class=\"snac-post\">\n");
764 else 772 else