diff options
| author | 2023-08-10 19:37:33 +0200 | |
|---|---|---|
| committer | 2023-08-10 19:37:33 +0200 | |
| commit | 574c0ca8af8c7cba9a5a3e3468ab7a477bfd496e (patch) | |
| tree | d95b3788203377b0882cb1e1de011d98eaee3bff /mastoapi.c | |
| parent | Added web UI for limit/unlimit actions. (diff) | |
| download | snac2-574c0ca8af8c7cba9a5a3e3468ab7a477bfd496e.tar.gz snac2-574c0ca8af8c7cba9a5a3e3468ab7a477bfd496e.tar.xz snac2-574c0ca8af8c7cba9a5a3e3468ab7a477bfd496e.zip | |
Fixed some mastoapi minor errors.
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 15 |
1 files changed, 11 insertions, 4 deletions
| @@ -1108,7 +1108,8 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1108 | xs_startswith(xs_dict_get(msg, "id"), snac2.actor)) { | 1108 | xs_startswith(xs_dict_get(msg, "id"), snac2.actor)) { |
| 1109 | xs *st = mastoapi_status(&snac2, msg); | 1109 | xs *st = mastoapi_status(&snac2, msg); |
| 1110 | 1110 | ||
| 1111 | out = xs_list_append(out, st); | 1111 | if (st) |
| 1112 | out = xs_list_append(out, st); | ||
| 1112 | } | 1113 | } |
| 1113 | } | 1114 | } |
| 1114 | } | 1115 | } |
| @@ -1354,7 +1355,9 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1354 | 1355 | ||
| 1355 | if (strcmp(type, "follow") != 0 && !xs_is_null(objid)) { | 1356 | if (strcmp(type, "follow") != 0 && !xs_is_null(objid)) { |
| 1356 | xs *st = mastoapi_status(&snac1, entry); | 1357 | xs *st = mastoapi_status(&snac1, entry); |
| 1357 | mn = xs_dict_append(mn, "status", st); | 1358 | |
| 1359 | if (st) | ||
| 1360 | mn = xs_dict_append(mn, "status", st); | ||
| 1358 | } | 1361 | } |
| 1359 | 1362 | ||
| 1360 | out = xs_list_append(out, mn); | 1363 | out = xs_list_append(out, mn); |
| @@ -1541,7 +1544,9 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1541 | 1544 | ||
| 1542 | if (valid_status(timeline_get_by_md5(&snac1, pid, &m2))) { | 1545 | if (valid_status(timeline_get_by_md5(&snac1, pid, &m2))) { |
| 1543 | xs *st = mastoapi_status(&snac1, m2); | 1546 | xs *st = mastoapi_status(&snac1, m2); |
| 1544 | anc = xs_list_insert(anc, 0, st); | 1547 | |
| 1548 | if (st) | ||
| 1549 | anc = xs_list_insert(anc, 0, st); | ||
| 1545 | } | 1550 | } |
| 1546 | else | 1551 | else |
| 1547 | break; | 1552 | break; |
| @@ -1557,7 +1562,9 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1557 | if (valid_status(timeline_get_by_md5(&snac1, v, &m2))) { | 1562 | if (valid_status(timeline_get_by_md5(&snac1, v, &m2))) { |
| 1558 | if (xs_is_null(xs_dict_get(m2, "name"))) { | 1563 | if (xs_is_null(xs_dict_get(m2, "name"))) { |
| 1559 | xs *st = mastoapi_status(&snac1, m2); | 1564 | xs *st = mastoapi_status(&snac1, m2); |
| 1560 | des = xs_list_append(des, st); | 1565 | |
| 1566 | if (st) | ||
| 1567 | des = xs_list_append(des, st); | ||
| 1561 | } | 1568 | } |
| 1562 | } | 1569 | } |
| 1563 | } | 1570 | } |