diff options
| author | 2023-10-13 09:29:55 +0200 | |
|---|---|---|
| committer | 2023-10-13 09:29:55 +0200 | |
| commit | 3b88cfe9920524030584b83308fb8be98eecae34 (patch) | |
| tree | e5aa50f444f030f515c64886e1f1e4469b27b805 /mastoapi.c | |
| parent | Minor URI tweak. (diff) | |
| download | snac2-3b88cfe9920524030584b83308fb8be98eecae34.tar.gz snac2-3b88cfe9920524030584b83308fb8be98eecae34.tar.xz snac2-3b88cfe9920524030584b83308fb8be98eecae34.zip | |
Fixed bug that crashed Tusky.
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 13 |
1 files changed, 6 insertions, 7 deletions
| @@ -941,7 +941,7 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg) | |||
| 941 | /* is it a boost? */ | 941 | /* is it a boost? */ |
| 942 | if (!xs_is_null(boosted_by_md5)) { | 942 | if (!xs_is_null(boosted_by_md5)) { |
| 943 | /* create a new dummy status, using st as the 'reblog' field */ | 943 | /* create a new dummy status, using st as the 'reblog' field */ |
| 944 | xs_dict *bst = xs_dict_new(); | 944 | xs_dict *bst = xs_dup(st); |
| 945 | xs *b_actor = NULL; | 945 | xs *b_actor = NULL; |
| 946 | 946 | ||
| 947 | if (valid_status(object_get_by_md5(boosted_by_md5, &b_actor))) { | 947 | if (valid_status(object_get_by_md5(boosted_by_md5, &b_actor))) { |
| @@ -953,12 +953,11 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg) | |||
| 953 | else | 953 | else |
| 954 | fake_uri = xs_fmt("%s#%s", srv_baseurl, mid); | 954 | fake_uri = xs_fmt("%s#%s", srv_baseurl, mid); |
| 955 | 955 | ||
| 956 | bst = xs_dict_append(bst, "id", mid); | 956 | bst = xs_dict_set(bst, "uri", fake_uri); |
| 957 | bst = xs_dict_append(bst, "created_at", xs_dict_get(st, "created_at")); | 957 | bst = xs_dict_set(bst, "url", fake_uri); |
| 958 | bst = xs_dict_append(bst, "uri", fake_uri); | 958 | bst = xs_dict_set(bst, "account", b_acct); |
| 959 | bst = xs_dict_append(bst, "account", b_acct); | 959 | bst = xs_dict_set(bst, "content", ""); |
| 960 | bst = xs_dict_append(bst, "content", ""); | 960 | bst = xs_dict_set(bst, "reblog", st); |
| 961 | bst = xs_dict_append(bst, "reblog", st); | ||
| 962 | 961 | ||
| 963 | xs_free(st); | 962 | xs_free(st); |
| 964 | st = bst; | 963 | st = bst; |