diff options
| author | default <nobody@localhost> | 2025-01-12 11:57:30 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2025-01-12 11:57:30 +0100 |
| commit | 6154ce75826ccb4ade18a45b838d159cd26d81f8 (patch) | |
| tree | fe97407446749212a308d081cc85d3f54cffd425 | |
| parent | f88a32dbe0805fceb3fb75b01de61616d7953f5e (diff) | |
If an Event has an URL, use it.
| -rw-r--r-- | html.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -2239,8 +2239,19 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, label_list = xs_list_append(label_list, address); if (xs_list_len(label_list)) { + const char *url = xs_dict_get(location, "url"); xs *label = xs_join(label_list, ", "); + if (xs_type(url) == XSTYPE_STRING) { + xs_html_add(snac_content_wrap, + xs_html_tag("p", + xs_html_text(L("Location: ")), + xs_html_tag("a", + xs_html_attr("href", url), + xs_html_attr("target", "_blank"), + xs_html_text(label)))); + } + else if (!xs_is_null(latitude) && !xs_is_null(longitude)) { xs *url = xs_fmt("https://openstreetmap.org/search/?query=%s,%s", xs_number_str(latitude), xs_number_str(longitude)); |