commit 6154ce7
default
·
2025-01-12 10:57:30 +0000 UTC
parent f88a32d
If an Event has an URL, use it.
1 files changed,
+11,
-0
M
html.c
M
html.c
+11,
-0
1@@ -2239,8 +2239,19 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
2 label_list = xs_list_append(label_list, address);
3
4 if (xs_list_len(label_list)) {
5+ const char *url = xs_dict_get(location, "url");
6 xs *label = xs_join(label_list, ", ");
7
8+ if (xs_type(url) == XSTYPE_STRING) {
9+ xs_html_add(snac_content_wrap,
10+ xs_html_tag("p",
11+ xs_html_text(L("Location: ")),
12+ xs_html_tag("a",
13+ xs_html_attr("href", url),
14+ xs_html_attr("target", "_blank"),
15+ xs_html_text(label))));
16+ }
17+ else
18 if (!xs_is_null(latitude) && !xs_is_null(longitude)) {
19 xs *url = xs_fmt("https://openstreetmap.org/search/?query=%s,%s",
20 xs_number_str(latitude), xs_number_str(longitude));