diff options
| author | 2024-11-12 06:11:10 +0100 | |
|---|---|---|
| committer | 2024-11-12 06:11:10 +0100 | |
| commit | 4971e54e56cf577b66c191161812c742ede5791a (patch) | |
| tree | 83bb449ab879f16c5935244e99f3a206b75ca804 /mastoapi.c | |
| parent | make_url() now accepts generating proxied urls by token. (diff) | |
| download | penes-snac2-4971e54e56cf577b66c191161812c742ede5791a.tar.gz penes-snac2-4971e54e56cf577b66c191161812c742ede5791a.tar.xz penes-snac2-4971e54e56cf577b66c191161812c742ede5791a.zip | |
mastoapi: added some proxy code.
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 8 |
1 files changed, 5 insertions, 3 deletions
| @@ -866,11 +866,12 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg) | |||
| 866 | 866 | ||
| 867 | while (xs_list_iter(&p, &v)) { | 867 | while (xs_list_iter(&p, &v)) { |
| 868 | const char *type = xs_dict_get(v, "type"); | 868 | const char *type = xs_dict_get(v, "type"); |
| 869 | const char *href = xs_dict_get(v, "href"); | 869 | const char *o_href = xs_dict_get(v, "href"); |
| 870 | const char *name = xs_dict_get(v, "name"); | 870 | const char *name = xs_dict_get(v, "name"); |
| 871 | 871 | ||
| 872 | if (xs_match(type, "image/*|video/*|Image|Video")) { /* */ | 872 | if (xs_match(type, "image/*|video/*|Image|Video")) { /* */ |
| 873 | xs *matteid = xs_fmt("%s_%d", id, xs_list_len(matt)); | 873 | xs *matteid = xs_fmt("%s_%d", id, xs_list_len(matt)); |
| 874 | xs *href = make_url(o_href, snac->actor, 1); | ||
| 874 | 875 | ||
| 875 | xs *d = xs_dict_new(); | 876 | xs *d = xs_dict_new(); |
| 876 | 877 | ||
| @@ -957,9 +958,10 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg) | |||
| 957 | const xs_dict *icon = xs_dict_get(v, "icon"); | 958 | const xs_dict *icon = xs_dict_get(v, "icon"); |
| 958 | 959 | ||
| 959 | if (!xs_is_null(name) && !xs_is_null(icon)) { | 960 | if (!xs_is_null(name) && !xs_is_null(icon)) { |
| 960 | const char *url = xs_dict_get(icon, "url"); | 961 | const char *o_url = xs_dict_get(icon, "url"); |
| 961 | 962 | ||
| 962 | if (!xs_is_null(url)) { | 963 | if (!xs_is_null(o_url)) { |
| 964 | xs *url = make_url(o_url, snac->actor, 1); | ||
| 963 | xs *nm = xs_strip_chars_i(xs_dup(name), ":"); | 965 | xs *nm = xs_strip_chars_i(xs_dup(name), ":"); |
| 964 | 966 | ||
| 965 | d1 = xs_dict_append(d1, "shortcode", nm); | 967 | d1 = xs_dict_append(d1, "shortcode", nm); |