summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 19aa610..ca44751 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -1134,6 +1134,9 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
1134 bst = xs_dict_set(bst, "content", ""); 1134 bst = xs_dict_set(bst, "content", "");
1135 bst = xs_dict_set(bst, "reblog", st); 1135 bst = xs_dict_set(bst, "reblog", st);
1136 1136
1137 xs *b_id = xs_toupper_i(xs_dup(xs_dict_get(st, "id")));
1138 bst = xs_dict_set(bst, "id", b_id);
1139
1137 xs_free(st); 1140 xs_free(st);
1138 st = bst; 1141 st = bst;
1139 } 1142 }
@@ -2338,15 +2341,17 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
2338 /* information about a status */ 2341 /* information about a status */
2339 if (logged_in) { 2342 if (logged_in) {
2340 xs *l = xs_split(cmd, "/"); 2343 xs *l = xs_split(cmd, "/");
2341 const char *id = xs_list_get(l, 3); 2344 const char *oid = xs_list_get(l, 3);
2342 const char *op = xs_list_get(l, 4); 2345 const char *op = xs_list_get(l, 4);
2343 2346
2344 if (!xs_is_null(id)) { 2347 if (!xs_is_null(oid)) {
2345 xs *msg = NULL; 2348 xs *msg = NULL;
2346 xs *out = NULL; 2349 xs *out = NULL;
2347 2350
2348 /* skip the 'fake' part of the id */ 2351 /* skip the 'fake' part of the id */
2349 id = MID_TO_MD5(id); 2352 oid = MID_TO_MD5(oid);
2353
2354 xs *id = xs_tolower_i(xs_dup(oid));
2350 2355
2351 if (valid_status(object_get_by_md5(id, &msg))) { 2356 if (valid_status(object_get_by_md5(id, &msg))) {
2352 if (op == NULL) { 2357 if (op == NULL) {