summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2022-10-01 18:58:50 +0200
committerGravatar default2022-10-01 18:58:50 +0200
commitbd0bc09912bd35e7ab7df19d93df9fd91df25957 (patch)
tree13508a1fc7aab653d78d49043d9224f0cd5839dc
parenttimeline_request() also triggers an actor_request(). (diff)
downloadsnac2-bd0bc09912bd35e7ab7df19d93df9fd91df25957.tar.gz
snac2-bd0bc09912bd35e7ab7df19d93df9fd91df25957.tar.xz
snac2-bd0bc09912bd35e7ab7df19d93df9fd91df25957.zip
Show a link in the snac-origin in level 0 entries.
-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");