mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 05:15:04 +00:00
If a message has an audience, its URL is shown after the content.
Messages coming from channels, communities (Lemmy) or magazines (kbin.social), have this field set with the "parent" url.
This commit is contained in:
parent
7950783d41
commit
4823f20085
1 changed files with 9 additions and 0 deletions
9
html.c
9
html.c
|
@ -1269,6 +1269,15 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
|
|||
s = xs_str_cat(s, "</p>\n");
|
||||
}
|
||||
|
||||
/* has this message an audience (i.e., comes from a channel or community)? */
|
||||
const char *audience = xs_dict_get(msg, "audience");
|
||||
if (strcmp(type, "Page") == 0 && !xs_is_null(audience)) {
|
||||
xs *es1 = encode_html(audience);
|
||||
xs *s1 = xs_fmt("<p>(<a href=\"%s\" title=\"%s\">%s</a>)</p>\n",
|
||||
audience, L("Source channel or community"), es1);
|
||||
s = xs_str_cat(s, s1);
|
||||
}
|
||||
|
||||
if (sensitive)
|
||||
s = xs_str_cat(s, "</details><p>\n");
|
||||
|
||||
|
|
Loading…
Reference in a new issue