diff --git a/data.c b/data.c index 4405b15..5edd84e 100644 --- a/data.c +++ b/data.c @@ -1366,7 +1366,7 @@ void static_put(snac *snac, const char *id, const char *data, int size) } -void status_put_meta(snac *snac, const char *id, const char *str) +void static_put_meta(snac *snac, const char *id, const char *str) /* puts metadata (i.e. a media description string) to id */ { xs *fn = _static_fn(snac, id); @@ -1380,7 +1380,7 @@ void status_put_meta(snac *snac, const char *id, const char *str) } -xs_str *status_get_meta(snac *snac, const char *id) +xs_str *static_get_meta(snac *snac, const char *id) /* gets metadata from a media */ { xs *fn = _static_fn(snac, id); diff --git a/mastoapi.c b/mastoapi.c index bf28fa4..b8362b2 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -1303,11 +1303,12 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, xs_str *v; while (xs_list_iter(&p, &v)) { - xs *l = xs_list_new(); - xs *url = xs_fmt("%s/s/%s", snac.actor, v); + xs *l = xs_list_new(); + xs *url = xs_fmt("%s/s/%s", snac.actor, v); + xs *desc = static_get_meta(&snac, v); l = xs_list_append(l, url); - l = xs_list_append(l, ""); + l = xs_list_append(l, desc); attach_list = xs_list_append(attach_list, l); } @@ -1498,6 +1499,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, /* store */ static_put(&snac, id, payload + fo, fs); + static_put_meta(&snac, id, desc); /* prepare a response */ xs *rsp = xs_dict_new(); diff --git a/snac.h b/snac.h index 6258d6c..090809a 100644 --- a/snac.h +++ b/snac.h @@ -130,8 +130,8 @@ int actor_get(snac *snac, const char *actor, d_char **data); int static_get(snac *snac, const char *id, d_char **data, int *size); void static_put(snac *snac, const char *id, const char *data, int size); -void status_put_meta(snac *snac, const char *id, const char *str); -xs_str *status_get_meta(snac *snac, const char *id); +void static_put_meta(snac *snac, const char *id, const char *str); +xs_str *static_get_meta(snac *snac, const char *id); double history_mtime(snac *snac, char *id); void history_add(snac *snac, char *id, char *content, int size);