mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
Show a link in the snac-origin in level 0 entries.
This commit is contained in:
parent
37925a020e
commit
bd0bc09912
1 changed files with 13 additions and 1 deletions
14
html.c
14
html.c
|
@ -526,11 +526,12 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
|
||||||
|
|
||||||
if (level == 0) {
|
if (level == 0) {
|
||||||
char *referrer;
|
char *referrer;
|
||||||
|
char *parent;
|
||||||
|
|
||||||
s = xs_str_cat(s, "<div class=\"snac-post\">\n");
|
s = xs_str_cat(s, "<div class=\"snac-post\">\n");
|
||||||
|
|
||||||
/* print the origin of the post, if any */
|
/* print the origin of the post, if any */
|
||||||
if ((referrer = xs_dict_get(meta, "referrer")) != NULL) {
|
if (!xs_is_null(referrer = xs_dict_get(meta, "referrer"))) {
|
||||||
xs *actor_r = NULL;
|
xs *actor_r = NULL;
|
||||||
|
|
||||||
if (valid_status(actor_get(snac, referrer, &actor_r))) {
|
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
|
||||||
s = xs_str_cat(s, s1);
|
s = xs_str_cat(s, s1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if (!xs_is_null((parent = xs_dict_get(meta, "parent")))) {
|
||||||
|
/* this may happen if any of the autor or the parent aren't here */
|
||||||
|
xs *s1 = xs_fmt(
|
||||||
|
"<div class=\"snac-origin\">%s "
|
||||||
|
"<a href=\"%s\">»</a></div>\n",
|
||||||
|
L("in reply to"), parent
|
||||||
|
);
|
||||||
|
|
||||||
|
s = xs_str_cat(s, s1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
s = xs_str_cat(s, "<div class=\"snac-child\">\n");
|
s = xs_str_cat(s, "<div class=\"snac-child\">\n");
|
||||||
|
|
Loading…
Reference in a new issue