diff options
| -rw-r--r-- | mastoapi.c | 48 |
1 files changed, 24 insertions, 24 deletions
| @@ -981,30 +981,6 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 981 | 981 | ||
| 982 | xs_set_init(&seen); | 982 | xs_set_init(&seen); |
| 983 | 983 | ||
| 984 | /* local users */ | ||
| 985 | p = ulst; | ||
| 986 | while (xs_list_iter(&p, &v)) { | ||
| 987 | snac user; | ||
| 988 | |||
| 989 | if (strcmp(v, xs_dict_get(snac1.config, "uid")) == 0) | ||
| 990 | continue; | ||
| 991 | |||
| 992 | if (user_open(&user, v)) { | ||
| 993 | xs *v2 = xs_tolower_i(xs_dup(v)); | ||
| 994 | |||
| 995 | if (xs_startswith(v2, q)) { | ||
| 996 | xs *actor = msg_actor(&user); | ||
| 997 | xs *acct = mastoapi_account(actor); | ||
| 998 | |||
| 999 | out = xs_list_append(out, acct); | ||
| 1000 | } | ||
| 1001 | |||
| 1002 | xs_set_add(&seen, user.actor); | ||
| 1003 | |||
| 1004 | user_free(&user); | ||
| 1005 | } | ||
| 1006 | } | ||
| 1007 | |||
| 1008 | /* user relations */ | 984 | /* user relations */ |
| 1009 | xs_list *lsts[] = { wing, wers, NULL }; | 985 | xs_list *lsts[] = { wing, wers, NULL }; |
| 1010 | int n; | 986 | int n; |
| @@ -1033,6 +1009,30 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1033 | } | 1009 | } |
| 1034 | } | 1010 | } |
| 1035 | 1011 | ||
| 1012 | /* local users */ | ||
| 1013 | p = ulst; | ||
| 1014 | while (xs_list_iter(&p, &v)) { | ||
| 1015 | snac user; | ||
| 1016 | |||
| 1017 | if (strcmp(v, xs_dict_get(snac1.config, "uid")) == 0) | ||
| 1018 | continue; | ||
| 1019 | |||
| 1020 | if (user_open(&user, v)) { | ||
| 1021 | xs *v2 = xs_tolower_i(xs_dup(v)); | ||
| 1022 | |||
| 1023 | if (xs_startswith(v2, q)) { | ||
| 1024 | xs *actor = msg_actor(&user); | ||
| 1025 | xs *acct = mastoapi_account(actor); | ||
| 1026 | |||
| 1027 | out = xs_list_append(out, acct); | ||
| 1028 | } | ||
| 1029 | |||
| 1030 | xs_set_add(&seen, user.actor); | ||
| 1031 | |||
| 1032 | user_free(&user); | ||
| 1033 | } | ||
| 1034 | } | ||
| 1035 | |||
| 1036 | xs_set_free(&seen); | 1036 | xs_set_free(&seen); |
| 1037 | } | 1037 | } |
| 1038 | } | 1038 | } |