diff options
| author | 2022-09-30 17:56:27 +0200 | |
|---|---|---|
| committer | 2022-09-30 17:56:27 +0200 | |
| commit | 191c2e032b0d418c6f8beb6675a356e4b37644bb (patch) | |
| tree | abc89bb077d01eed21fb7c1dd038adab2a02f9a3 /html.c | |
| parent | Backport from xs. (diff) | |
| download | snac2-191c2e032b0d418c6f8beb6675a356e4b37644bb.tar.gz snac2-191c2e032b0d418c6f8beb6675a356e4b37644bb.tar.xz snac2-191c2e032b0d418c6f8beb6675a356e4b37644bb.zip | |
Also show Follow messages in the timeline.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 20 |
1 files changed, 16 insertions, 4 deletions
| @@ -484,8 +484,22 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i | |||
| 484 | if (xs_set_add(seen, id) == 0) | 484 | if (xs_set_add(seen, id) == 0) |
| 485 | return os; | 485 | return os; |
| 486 | 486 | ||
| 487 | if (strcmp(type, "Follow") == 0) | 487 | xs *s = xs_str_new(NULL); |
| 488 | return os; | 488 | |
| 489 | if (strcmp(type, "Follow") == 0) { | ||
| 490 | actor = xs_dict_get(msg, "actor"); | ||
| 491 | |||
| 492 | s = xs_str_cat(s, "<div class=\"snac-post\">\n"); | ||
| 493 | |||
| 494 | xs *s1 = xs_fmt("<div class=\"snac-origin\">%s</div>\n", L("follows you")); | ||
| 495 | s = xs_str_cat(s, s1); | ||
| 496 | |||
| 497 | s = html_msg_icon(snac, s, msg); | ||
| 498 | |||
| 499 | s = xs_str_cat(s, "</div>\n"); | ||
| 500 | |||
| 501 | return xs_str_cat(os, s); | ||
| 502 | } | ||
| 489 | 503 | ||
| 490 | /* bring the main actor */ | 504 | /* bring the main actor */ |
| 491 | if ((actor = xs_dict_get(msg, "attributedTo")) == NULL) | 505 | 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 | |||
| 494 | if (!valid_status(actor_get(snac, actor, &actor_o))) | 508 | if (!valid_status(actor_get(snac, actor, &actor_o))) |
| 495 | return os; | 509 | return os; |
| 496 | 510 | ||
| 497 | xs *s = xs_str_new(NULL); | ||
| 498 | |||
| 499 | /* if this is our post, add the score */ | 511 | /* if this is our post, add the score */ |
| 500 | if (xs_startswith(id, snac->actor)) { | 512 | if (xs_startswith(id, snac->actor)) { |
| 501 | int likes = xs_list_len(xs_dict_get(meta, "liked_by")); | 513 | int likes = xs_list_len(xs_dict_get(meta, "liked_by")); |