Răsfoiți Sursa

Show a ballot box emoji in the score if the enttry it's a poll.

default 3 ani în urmă
părinte
comite
4f0ab18f1c
1 a modificat fișierele cu 11 adăugiri și 3 ștergeri
  1. 11 3
      html.c

+ 11 - 3
html.c

@@ -745,6 +745,14 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
     if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL)))
     if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL)))
         return os;
         return os;
 
 
+    s = xs_str_cat(s, "<div class=\"snac-score\">");
+
+    if (strcmp(type, "Question") == 0) {
+        /* add the ballot box emoji */
+        xs *f = xs_fmt("<span title=\"%s\"> &#128499; </span>", L("Poll"));
+        s = xs_str_cat(s, f);
+    }
+
     /* if this is our post, add the score */
     /* if this is our post, add the score */
     if (xs_startswith(id, snac->actor)) {
     if (xs_startswith(id, snac->actor)) {
         int n_likes  = object_likes_len(id);
         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,
 
 
         /* alternate emojis: %d &#128077; %d &#128257; */
         /* alternate emojis: %d &#128077; %d &#128257; */
 
 
-        xs *s1 = xs_fmt(
-            "<div class=\"snac-score\">%d &#9733; %d &#8634;</div>\n",
-            n_likes, n_boosts);
+        xs *s1 = xs_fmt("%d &#9733; %d &#8634;\n", n_likes, n_boosts);
 
 
         s = xs_str_cat(s, s1);
         s = xs_str_cat(s, s1);
     }
     }
 
 
+    s = xs_str_cat(s, "</div>\n");
+
     if (level == 0)
     if (level == 0)
         s = xs_str_cat(s, "<div class=\"snac-post\">\n");
         s = xs_str_cat(s, "<div class=\"snac-post\">\n");
     else
     else