commit 2fd7e20

default  ·  2022-12-10 10:26:51 +0000 UTC
parent 83a68d6
Use object_likes_len() and object_announces_len() in the post score.
1 files changed,  +3, -3
M html.c
M html.c
+3, -3
 1@@ -551,14 +551,14 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, int local, int level, cons
 2 
 3     /* if this is our post, add the score */
 4     if (xs_startswith(id, snac->actor)) {
 5-        likes  = object_likes(id);
 6-        boosts = object_announces(id);
 7+        int n_likes  = object_likes_len(id);
 8+        int n_boosts = object_announces_len(id);
 9 
10         /* alternate emojis: %d 👍 %d 🔁 */
11 
12         xs *s1 = xs_fmt(
13             "<div class=\"snac-score\">%d &#9733; %d &#8634;</div>\n",
14-            xs_list_len(likes), xs_list_len(boosts));
15+            n_likes, n_boosts);
16 
17         s = xs_str_cat(s, s1);
18     }