diff options
| author | 2024-01-10 19:23:34 +0100 | |
|---|---|---|
| committer | 2024-01-10 19:23:34 +0100 | |
| commit | cc535e9958bf8eb267f4f9f8e34cad40a5e6d589 (patch) | |
| tree | 72be72cb485d91935f667d0d1b55ba0961fc3ca7 /activitypub.c | |
| parent | Fixed minor collision in webfinger caching. (diff) | |
| download | snac2-cc535e9958bf8eb267f4f9f8e34cad40a5e6d589.tar.gz snac2-cc535e9958bf8eb267f4f9f8e34cad40a5e6d589.tar.xz snac2-cc535e9958bf8eb267f4f9f8e34cad40a5e6d589.zip | |
Added more webfinger checks, just to be sure.
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activitypub.c b/activitypub.c index be82fff..7c5a19e 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -616,7 +616,7 @@ xs_str *process_tags(snac *snac, const char *content, xs_list **tag) | |||
| 616 | 616 | ||
| 617 | status = webfinger_request(wuid, &actor, &uid); | 617 | status = webfinger_request(wuid, &actor, &uid); |
| 618 | 618 | ||
| 619 | if (valid_status(status)) { | 619 | if (valid_status(status) && actor && uid) { |
| 620 | xs *d = xs_dict_new(); | 620 | xs *d = xs_dict_new(); |
| 621 | xs *n = xs_fmt("@%s", uid); | 621 | xs *n = xs_fmt("@%s", uid); |
| 622 | 622 | ||
| @@ -1207,7 +1207,8 @@ xs_dict *msg_note(snac *snac, const xs_str *content, const xs_val *rcpts, | |||
| 1207 | xs *t_href = NULL; | 1207 | xs *t_href = NULL; |
| 1208 | xs *t_name = NULL; | 1208 | xs *t_name = NULL; |
| 1209 | 1209 | ||
| 1210 | if (!xs_is_null(a) && valid_status(webfinger_request(a, &t_href, &t_name))) { | 1210 | if (!xs_is_null(a) && valid_status(webfinger_request(a, &t_href, &t_name) |
| 1211 | && t_href && t_name)) { | ||
| 1211 | xs *t = xs_dict_new(); | 1212 | xs *t = xs_dict_new(); |
| 1212 | 1213 | ||
| 1213 | t = xs_dict_append(t, "type", "Mention"); | 1214 | t = xs_dict_append(t, "type", "Mention"); |