diff options
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 13 |
1 files changed, 10 insertions, 3 deletions
| @@ -1077,10 +1077,17 @@ static xs_html *html_user_body(snac *user, int read_only) | |||
| 1077 | while (xs_dict_next(metadata, &k, &v, &c)) { | 1077 | while (xs_dict_next(metadata, &k, &v, &c)) { |
| 1078 | xs_html *value; | 1078 | xs_html *value; |
| 1079 | 1079 | ||
| 1080 | if (xs_startswith(v, "https:/") || xs_startswith(v, "http:/")) { | 1080 | if (xs_startswith(v, "https:/") || xs_startswith(v, "http:/") || *v == '@') { |
| 1081 | /* is this link validated? */ | 1081 | /* is this link validated? */ |
| 1082 | xs *verified_link = NULL; | 1082 | xs *verified_link = NULL; |
| 1083 | const xs_number *val_time = xs_dict_get(val_links, v); | 1083 | const xs_number *val_time = xs_dict_get(val_links, v); |
| 1084 | const char *url = NULL; | ||
| 1085 | |||
| 1086 | if (xs_is_string(val_time)) { | ||
| 1087 | /* resolve again, as it may be an account handle */ | ||
| 1088 | url = val_time; | ||
| 1089 | val_time = xs_dict_get(val_links, val_time); | ||
| 1090 | } | ||
| 1084 | 1091 | ||
| 1085 | if (xs_type(val_time) == XSTYPE_NUMBER) { | 1092 | if (xs_type(val_time) == XSTYPE_NUMBER) { |
| 1086 | time_t t = xs_number_get(val_time); | 1093 | time_t t = xs_number_get(val_time); |
| @@ -1098,13 +1105,13 @@ static xs_html *html_user_body(snac *user, int read_only) | |||
| 1098 | xs_html_tag("a", | 1105 | xs_html_tag("a", |
| 1099 | xs_html_attr("rel", "me"), | 1106 | xs_html_attr("rel", "me"), |
| 1100 | xs_html_attr("target", "_blank"), | 1107 | xs_html_attr("target", "_blank"), |
| 1101 | xs_html_attr("href", v), | 1108 | xs_html_attr("href", url ? url : v), |
| 1102 | xs_html_text(v))); | 1109 | xs_html_text(v))); |
| 1103 | } | 1110 | } |
| 1104 | else { | 1111 | else { |
| 1105 | value = xs_html_tag("a", | 1112 | value = xs_html_tag("a", |
| 1106 | xs_html_attr("rel", "me"), | 1113 | xs_html_attr("rel", "me"), |
| 1107 | xs_html_attr("href", v), | 1114 | xs_html_attr("href", url ? url : v), |
| 1108 | xs_html_text(v)); | 1115 | xs_html_text(v)); |
| 1109 | } | 1116 | } |
| 1110 | } | 1117 | } |