diff options
| author | 2023-12-05 19:37:27 +0100 | |
|---|---|---|
| committer | 2023-12-05 19:37:27 +0100 | |
| commit | 01c21d57ec6d09416474ea71f067ee7438005635 (patch) | |
| tree | dd133e02ef3cbb57ce4f91935b5b8d60dd7078bd /mastoapi.c | |
| parent | mastoapi: correctly print the auth key in the sepcial urn:ietf... case. (diff) | |
| download | snac2-01c21d57ec6d09416474ea71f067ee7438005635.tar.gz snac2-01c21d57ec6d09416474ea71f067ee7438005635.tar.xz snac2-01c21d57ec6d09416474ea71f067ee7438005635.zip | |
mastoapi: fixed crash processing kbin boosts.
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 8 |
1 files changed, 6 insertions, 2 deletions
| @@ -1424,12 +1424,16 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1424 | if (!xs_match(type, "Note|Question|Page|Article")) | 1424 | if (!xs_match(type, "Note|Question|Page|Article")) |
| 1425 | continue; | 1425 | continue; |
| 1426 | 1426 | ||
| 1427 | const char *from; | 1427 | const char *from = NULL; |
| 1428 | if (strcmp(type, "Page") == 0) | 1428 | if (strcmp(type, "Page") == 0) |
| 1429 | from = xs_dict_get(msg, "audience"); | 1429 | from = xs_dict_get(msg, "audience"); |
| 1430 | else | 1430 | |
| 1431 | if (from == NULL) | ||
| 1431 | from = xs_dict_get(msg, "attributedTo"); | 1432 | from = xs_dict_get(msg, "attributedTo"); |
| 1432 | 1433 | ||
| 1434 | if (from == NULL) | ||
| 1435 | continue; | ||
| 1436 | |||
| 1433 | /* is this message from a person we don't follow? */ | 1437 | /* is this message from a person we don't follow? */ |
| 1434 | if (strcmp(from, snac1.actor) && !following_check(&snac1, from)) { | 1438 | if (strcmp(from, snac1.actor) && !following_check(&snac1, from)) { |
| 1435 | /* discard if it was not boosted */ | 1439 | /* discard if it was not boosted */ |