summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/html.c b/html.c
index 45e1963..0848b82 100644
--- a/html.c
+++ b/html.c
@@ -526,11 +526,12 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
526 526
527 if (level == 0) { 527 if (level == 0) {
528 char *referrer; 528 char *referrer;
529 char *parent;
529 530
530 s = xs_str_cat(s, "<div class=\"snac-post\">\n"); 531 s = xs_str_cat(s, "<div class=\"snac-post\">\n");
531 532
532 /* print the origin of the post, if any */ 533 /* print the origin of the post, if any */
533 if ((referrer = xs_dict_get(meta, "referrer")) != NULL) { 534 if (!xs_is_null(referrer = xs_dict_get(meta, "referrer"))) {
534 xs *actor_r = NULL; 535 xs *actor_r = NULL;
535 536
536 if (valid_status(actor_get(snac, referrer, &actor_r))) { 537 if (valid_status(actor_get(snac, referrer, &actor_r))) {
@@ -550,6 +551,17 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
550 s = xs_str_cat(s, s1); 551 s = xs_str_cat(s, s1);
551 } 552 }
552 } 553 }
554 else
555 if (!xs_is_null((parent = xs_dict_get(meta, "parent")))) {
556 /* this may happen if any of the autor or the parent aren't here */
557 xs *s1 = xs_fmt(
558 "<div class=\"snac-origin\">%s "
559 "<a href=\"%s\">ยป</a></div>\n",
560 L("in reply to"), parent
561 );
562
563 s = xs_str_cat(s, s1);
564 }
553 } 565 }
554 else 566 else
555 s = xs_str_cat(s, "<div class=\"snac-child\">\n"); 567 s = xs_str_cat(s, "<div class=\"snac-child\">\n");