diff options
| author | 2022-10-10 09:45:39 +0200 | |
|---|---|---|
| committer | 2022-10-10 09:45:39 +0200 | |
| commit | 7f0063d5e1ea082141da482b58aa9db11e389e92 (patch) | |
| tree | 6431c4566e1af67a10f26dffd4ca82174f98065a | |
| parent | Version 2.03 RELEASED. (diff) | |
| download | penes-snac2-7f0063d5e1ea082141da482b58aa9db11e389e92.tar.gz penes-snac2-7f0063d5e1ea082141da482b58aa9db11e389e92.tar.xz penes-snac2-7f0063d5e1ea082141da482b58aa9db11e389e92.zip | |
build_mentions() completes uids without host.
| -rw-r--r-- | html.c | 15 |
1 files changed, 7 insertions, 8 deletions
| @@ -298,17 +298,16 @@ d_char *build_mentions(snac *snac, char *msg) | |||
| 298 | href && strcmp(href, snac->actor) != 0 && name) { | 298 | href && strcmp(href, snac->actor) != 0 && name) { |
| 299 | xs *l = xs_split(name, "@"); | 299 | xs *l = xs_split(name, "@"); |
| 300 | 300 | ||
| 301 | /* if it's a name without host, query the webfinger */ | 301 | /* is it a name without a host? */ |
| 302 | if (xs_list_len(l) < 3) { | 302 | if (xs_list_len(l) < 3) { |
| 303 | #if 0 | 303 | /* split the href and pick the host name LIKE AN ANIMAL */ |
| 304 | xs *actor = NULL; | 304 | /* would be better to query the webfinger but *won't do that* here */ |
| 305 | xs *user = NULL; | 305 | xs *l2 = xs_split(href, "/"); |
| 306 | 306 | ||
| 307 | if (valid_status(webfinger_request(href, &actor, &user))) { | 307 | if (xs_list_len(l2) >= 3) { |
| 308 | s = xs_str_cat(s, user); | 308 | xs *s1 = xs_fmt("%s@%s ", name, xs_list_get(l2, 2)); |
| 309 | s = xs_str_cat(s, " "); | 309 | s = xs_str_cat(s, s1); |
| 310 | } | 310 | } |
| 311 | #endif | ||
| 312 | } | 311 | } |
| 313 | else { | 312 | else { |
| 314 | s = xs_str_cat(s, name); | 313 | s = xs_str_cat(s, name); |