summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-09-30 17:56:27 +0200
committerdefault <nobody@localhost>2022-09-30 17:56:27 +0200
commit191c2e032b0d418c6f8beb6675a356e4b37644bb (patch)
treeabc89bb077d01eed21fb7c1dd038adab2a02f9a3 /html.c
parentbb9992a1a97a12581b3df25a306aece0ed08030f (diff)
Also show Follow messages in the timeline.
Diffstat (limited to 'html.c')
-rw-r--r--html.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/html.c b/html.c
index fd6fbdf..31af896 100644
--- a/html.c
+++ b/html.c
@@ -484,8 +484,22 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
if (xs_set_add(seen, id) == 0)
return os;
- if (strcmp(type, "Follow") == 0)
- return os;
+ xs *s = xs_str_new(NULL);
+
+ if (strcmp(type, "Follow") == 0) {
+ actor = xs_dict_get(msg, "actor");
+
+ s = xs_str_cat(s, "<div class=\"snac-post\">\n");
+
+ xs *s1 = xs_fmt("<div class=\"snac-origin\">%s</div>\n", L("follows you"));
+ s = xs_str_cat(s, s1);
+
+ s = html_msg_icon(snac, s, msg);
+
+ s = xs_str_cat(s, "</div>\n");
+
+ return xs_str_cat(os, s);
+ }
/* bring the main actor */
if ((actor = xs_dict_get(msg, "attributedTo")) == NULL)
@@ -494,8 +508,6 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
if (!valid_status(actor_get(snac, actor, &actor_o)))
return os;
- xs *s = xs_str_new(NULL);
-
/* if this is our post, add the score */
if (xs_startswith(id, snac->actor)) {
int likes = xs_list_len(xs_dict_get(meta, "liked_by"));