mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 22:45:05 +00:00
mastoapi: fixed crash processing kbin boosts.
This commit is contained in:
parent
756b0c98ee
commit
01c21d57ec
1 changed files with 6 additions and 2 deletions
|
@ -1424,12 +1424,16 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
|
||||||
if (!xs_match(type, "Note|Question|Page|Article"))
|
if (!xs_match(type, "Note|Question|Page|Article"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const char *from;
|
const char *from = NULL;
|
||||||
if (strcmp(type, "Page") == 0)
|
if (strcmp(type, "Page") == 0)
|
||||||
from = xs_dict_get(msg, "audience");
|
from = xs_dict_get(msg, "audience");
|
||||||
else
|
|
||||||
|
if (from == NULL)
|
||||||
from = xs_dict_get(msg, "attributedTo");
|
from = xs_dict_get(msg, "attributedTo");
|
||||||
|
|
||||||
|
if (from == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* is this message from a person we don't follow? */
|
/* is this message from a person we don't follow? */
|
||||||
if (strcmp(from, snac1.actor) && !following_check(&snac1, from)) {
|
if (strcmp(from, snac1.actor) && !following_check(&snac1, from)) {
|
||||||
/* discard if it was not boosted */
|
/* discard if it was not boosted */
|
||||||
|
|
Loading…
Reference in a new issue