diff options
| author | 2022-12-02 21:36:12 +0100 | |
|---|---|---|
| committer | 2022-12-02 21:36:12 +0100 | |
| commit | 2614a8b3cbf55ab2a38ae2c81fe0081579495190 (patch) | |
| tree | ad65e4dfea2f8b048b1f0bcea8835d9e61e0a1a9 /html.c | |
| parent | Use xs_set_result() in timeline_top_level(). (diff) | |
| download | snac2-2614a8b3cbf55ab2a38ae2c81fe0081579495190.tar.gz snac2-2614a8b3cbf55ab2a38ae2c81fe0081579495190.tar.xz snac2-2614a8b3cbf55ab2a38ae2c81fe0081579495190.zip | |
Show stray parents in the origin.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 34 |
1 files changed, 12 insertions, 22 deletions
| @@ -591,31 +591,21 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, int local, int level, int | |||
| 591 | } | 591 | } |
| 592 | } | 592 | } |
| 593 | } | 593 | } |
| 594 | |||
| 595 | #if 0 | ||
| 596 | if (!xs_is_null((p = xs_dict_get(meta, "parent"))) && *p) { | ||
| 597 | /* this may happen if any of the autor or the parent aren't here */ | ||
| 598 | xs *s1 = xs_fmt( | ||
| 599 | "<div class=\"snac-origin\">%s " | ||
| 600 | "<a href=\"%s\">»</a></div>\n", | ||
| 601 | L("in reply to"), p | ||
| 602 | ); | ||
| 603 | |||
| 604 | s = xs_str_cat(s, s1); | ||
| 605 | } | ||
| 606 | else | 594 | else |
| 607 | if (!xs_is_null((p = xs_dict_get(meta, "liked_by"))) && | 595 | if (strcmp(type, "Note") == 0) { |
| 608 | xs_list_in(p, snac->actor) != -1) { | 596 | /* is the parent not here? */ |
| 609 | /* we liked this */ | 597 | char *parent = xs_dict_get(msg, "inReplyTo"); |
| 610 | xs *s1 = xs_fmt( | ||
| 611 | "<div class=\"snac-origin\">" | ||
| 612 | "<a href=\"%s\">%s</a> %s</a></div>", | ||
| 613 | snac->actor, xs_dict_get(snac->config, "name"), L("liked") | ||
| 614 | ); | ||
| 615 | 598 | ||
| 616 | s = xs_str_cat(s, s1); | 599 | if (!xs_is_null(parent) && !object_here(parent)) { |
| 600 | xs *s1 = xs_fmt( | ||
| 601 | "<div class=\"snac-origin\">%s " | ||
| 602 | "<a href=\"%s\">»</a></div>\n", | ||
| 603 | L("in reply to"), parent | ||
| 604 | ); | ||
| 605 | |||
| 606 | s = xs_str_cat(s, s1); | ||
| 607 | } | ||
| 617 | } | 608 | } |
| 618 | #endif | ||
| 619 | } | 609 | } |
| 620 | else | 610 | else |
| 621 | s = xs_str_cat(s, "<div class=\"snac-child\">\n"); | 611 | s = xs_str_cat(s, "<div class=\"snac-child\">\n"); |