snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 6154ce75826ccb4ade18a45b838d159cd26d81f8
parent f88a32dbe0805fceb3fb75b01de61616d7953f5e
Author: default <nobody@localhost>
Date:   Sun, 12 Jan 2025 11:57:30 +0100

If an Event has an URL, use it.

Diffstat:
Mhtml.c | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/html.c b/html.c @@ -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));