aboutsummaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authorgreen <dandelions@disroot.org>2025-04-24 16:19:34 +0200
committergreen <dandelions@disroot.org>2025-04-26 02:37:13 +0200
commitc1502ca381afa7490f081530c88a01061aad6701 (patch)
treefa880d2e26ddf455a91ef302b0754c284dfb499a /mastoapi.c
parentec21e1596ab285813d5774224dfed77cbb30d23e (diff)
mastoapi: fix md5 issues
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mastoapi.c b/mastoapi.c
index bea835c..705a902 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -1504,9 +1504,16 @@ xs_list *mastoapi_account_lists(snac *user, const char *uid)
/* returns the list of list an user is in */
{
xs_list *out = xs_list_new();
- xs *actor_md5 = uid ? xs_md5_hex(uid, strlen(uid)) : NULL;
+ xs *actor_md5 = NULL;
xs *lol = list_maint(user, NULL, 0);
+ if (uid) {
+ if (!xs_is_hex(uid))
+ actor_md5 = xs_md5_hex(uid, strlen(uid));
+ else
+ actor_md5 = xs_dup(uid);
+ }
+
const xs_list *li;
xs_list_foreach(lol, li) {
const char *list_id = xs_list_get(li, 0);