diff options
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -494,18 +494,18 @@ xs_str *mastoapi_id(const xs_dict *msg) | |||
| 494 | xs_dict *mastoapi_account(const xs_dict *actor) | 494 | xs_dict *mastoapi_account(const xs_dict *actor) |
| 495 | /* converts an ActivityPub actor to a Mastodon account */ | 495 | /* converts an ActivityPub actor to a Mastodon account */ |
| 496 | { | 496 | { |
| 497 | const char *id = xs_dict_get(actor, "id"); | ||
| 498 | const char *pub = xs_dict_get(actor, "published"); | ||
| 499 | |||
| 500 | if (xs_type(id) != XSTYPE_STRING) | ||
| 501 | return NULL; | ||
| 502 | |||
| 497 | const char *prefu = xs_dict_get(actor, "preferredUsername"); | 503 | const char *prefu = xs_dict_get(actor, "preferredUsername"); |
| 498 | 504 | ||
| 499 | const char *display_name = xs_dict_get(actor, "name"); | 505 | const char *display_name = xs_dict_get(actor, "name"); |
| 500 | if (xs_is_null(display_name) || *display_name == '\0') | 506 | if (xs_is_null(display_name) || *display_name == '\0') |
| 501 | display_name = prefu; | 507 | display_name = prefu; |
| 502 | 508 | ||
| 503 | const char *id = xs_dict_get(actor, "id"); | ||
| 504 | const char *pub = xs_dict_get(actor, "published"); | ||
| 505 | |||
| 506 | if (xs_is_null(id)) | ||
| 507 | return NULL; | ||
| 508 | |||
| 509 | xs_dict *acct = xs_dict_new(); | 509 | xs_dict *acct = xs_dict_new(); |
| 510 | xs *acct_md5 = xs_md5_hex(id, strlen(id)); | 510 | xs *acct_md5 = xs_md5_hex(id, strlen(id)); |
| 511 | acct = xs_dict_append(acct, "id", acct_md5); | 511 | acct = xs_dict_append(acct, "id", acct_md5); |