diff options
| author | 2022-11-02 20:28:40 +0100 | |
|---|---|---|
| committer | 2022-11-02 20:28:40 +0100 | |
| commit | dbe60be4f3818336e7e91c6153fcf846303eed04 (patch) | |
| tree | 13f52fe3a0f8eecb9ee3ba984a76eabf829d8c17 /activitypub.c | |
| parent | Added the published (actor create) data to the 'people' page. (diff) | |
| download | snac2-dbe60be4f3818336e7e91c6153fcf846303eed04.tar.gz snac2-dbe60be4f3818336e7e91c6153fcf846303eed04.tar.xz snac2-dbe60be4f3818336e7e91c6153fcf846303eed04.zip | |
Fixed bug when following by @user@host.
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/activitypub.c b/activitypub.c index 164c6e6..be1cc5d 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -484,13 +484,22 @@ d_char *msg_delete(snac *snac, char *id) | |||
| 484 | } | 484 | } |
| 485 | 485 | ||
| 486 | 486 | ||
| 487 | d_char *msg_follow(snac *snac, char *actor) | 487 | d_char *msg_follow(snac *snac, char *url_or_uid) |
| 488 | /* creates a 'Follow' message */ | 488 | /* creates a 'Follow' message */ |
| 489 | { | 489 | { |
| 490 | d_char *actor_o = NULL; | 490 | xs *actor_o = NULL; |
| 491 | xs *actor = NULL; | ||
| 491 | d_char *msg = NULL; | 492 | d_char *msg = NULL; |
| 492 | int status; | 493 | int status; |
| 493 | 494 | ||
| 495 | if (xs_startswith(url_or_uid, "https:/")) | ||
| 496 | actor = xs_dup(url_or_uid); | ||
| 497 | else | ||
| 498 | if (!valid_status(webfinger_request(url_or_uid, &actor, NULL))) { | ||
| 499 | snac_log(snac, xs_fmt("cannot resolve user %s to follow", url_or_uid)); | ||
| 500 | return NULL; | ||
| 501 | } | ||
| 502 | |||
| 494 | /* request the actor */ | 503 | /* request the actor */ |
| 495 | status = actor_request(snac, actor, &actor_o); | 504 | status = actor_request(snac, actor, &actor_o); |
| 496 | 505 | ||