summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar default2023-07-19 12:42:32 +0200
committerGravatar default2023-07-19 12:42:32 +0200
commit4823f2008526a1545e6a9abdccff1a54a5268b93 (patch)
tree376d7d2d5601762a9011ff346748a5f8d02f56de /html.c
parentMerge branch 'master' of grunfink-codeberg:grunfink/snac2 (diff)
downloadsnac2-4823f2008526a1545e6a9abdccff1a54a5268b93.tar.gz
snac2-4823f2008526a1545e6a9abdccff1a54a5268b93.tar.xz
snac2-4823f2008526a1545e6a9abdccff1a54a5268b93.zip
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.
Diffstat (limited to 'html.c')
-rw-r--r--html.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/html.c b/html.c
index 4a2e119..ab23032 100644
--- a/html.c
+++ b/html.c
@@ -1269,6 +1269,15 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
1269 s = xs_str_cat(s, "</p>\n"); 1269 s = xs_str_cat(s, "</p>\n");
1270 } 1270 }
1271 1271
1272 /* has this message an audience (i.e., comes from a channel or community)? */
1273 const char *audience = xs_dict_get(msg, "audience");
1274 if (strcmp(type, "Page") == 0 && !xs_is_null(audience)) {
1275 xs *es1 = encode_html(audience);
1276 xs *s1 = xs_fmt("<p>(<a href=\"%s\" title=\"%s\">%s</a>)</p>\n",
1277 audience, L("Source channel or community"), es1);
1278 s = xs_str_cat(s, s1);
1279 }
1280
1272 if (sensitive) 1281 if (sensitive)
1273 s = xs_str_cat(s, "</details><p>\n"); 1282 s = xs_str_cat(s, "</details><p>\n");
1274 1283