From 4971e54e56cf577b66c191161812c742ede5791a Mon Sep 17 00:00:00 2001 From: default Date: Tue, 12 Nov 2024 06:11:10 +0100 Subject: mastoapi: added some proxy code. --- mastoapi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'mastoapi.c') diff --git a/mastoapi.c b/mastoapi.c index def5598..b24f2a1 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -866,11 +866,12 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg) while (xs_list_iter(&p, &v)) { const char *type = xs_dict_get(v, "type"); - const char *href = xs_dict_get(v, "href"); + const char *o_href = xs_dict_get(v, "href"); const char *name = xs_dict_get(v, "name"); if (xs_match(type, "image/*|video/*|Image|Video")) { /* */ xs *matteid = xs_fmt("%s_%d", id, xs_list_len(matt)); + xs *href = make_url(o_href, snac->actor, 1); xs *d = xs_dict_new(); @@ -957,9 +958,10 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg) const xs_dict *icon = xs_dict_get(v, "icon"); if (!xs_is_null(name) && !xs_is_null(icon)) { - const char *url = xs_dict_get(icon, "url"); + const char *o_url = xs_dict_get(icon, "url"); - if (!xs_is_null(url)) { + if (!xs_is_null(o_url)) { + xs *url = make_url(o_url, snac->actor, 1); xs *nm = xs_strip_chars_i(xs_dup(name), ":"); d1 = xs_dict_append(d1, "shortcode", nm); -- cgit v1.2.3