diff options
| -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, | |||
| 2239 | label_list = xs_list_append(label_list, address); | 2239 | label_list = xs_list_append(label_list, address); |
| 2240 | 2240 | ||
| 2241 | if (xs_list_len(label_list)) { | 2241 | if (xs_list_len(label_list)) { |
| 2242 | const char *url = xs_dict_get(location, "url"); | ||
| 2242 | xs *label = xs_join(label_list, ", "); | 2243 | xs *label = xs_join(label_list, ", "); |
| 2243 | 2244 | ||
| 2245 | if (xs_type(url) == XSTYPE_STRING) { | ||
| 2246 | xs_html_add(snac_content_wrap, | ||
| 2247 | xs_html_tag("p", | ||
| 2248 | xs_html_text(L("Location: ")), | ||
| 2249 | xs_html_tag("a", | ||
| 2250 | xs_html_attr("href", url), | ||
| 2251 | xs_html_attr("target", "_blank"), | ||
| 2252 | xs_html_text(label)))); | ||
| 2253 | } | ||
| 2254 | else | ||
| 2244 | if (!xs_is_null(latitude) && !xs_is_null(longitude)) { | 2255 | if (!xs_is_null(latitude) && !xs_is_null(longitude)) { |
| 2245 | xs *url = xs_fmt("https://openstreetmap.org/search/?query=%s,%s", | 2256 | xs *url = xs_fmt("https://openstreetmap.org/search/?query=%s,%s", |
| 2246 | xs_number_str(latitude), xs_number_str(longitude)); | 2257 | xs_number_str(latitude), xs_number_str(longitude)); |