aboutsummaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authorgrunfink <grunfink@noreply.codeberg.org>2025-05-22 11:15:07 +0200
committergrunfink <grunfink@noreply.codeberg.org>2025-05-22 11:15:07 +0200
commit096bb217105202ce6ec5bad046fd70cc3e3508cd (patch)
treee739fef7755347dc2f80f31b782467461ae3bacd /mastoapi.c
parent8c60545e657bf7a95aeaee2fa474cf021588de8b (diff)
parent450e679f5197cfe3101d2b3f032f3fabeadfc848 (diff)
Merge pull request 'use utf-8 lowercase function for tags #396' (#400) from postscriptum/snac2:utf8-lower-tags into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/400
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mastoapi.c b/mastoapi.c
index a7d9c34..c46a971 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -15,6 +15,7 @@
#include "xs_url.h"
#include "xs_mime.h"
#include "xs_match.h"
+#include "xs_unicode.h"
#include "snac.h"
@@ -381,7 +382,7 @@ int oauth_post_handler(const xs_dict *req, const char *q_path,
}
}
- /* no code?
+ /* no code?
I'm not sure of the impacts of this right now, but Subway Tooter does not
provide a code so one must be generated */
if (xs_is_null(code)){
@@ -1637,7 +1638,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
const char *aq = xs_dict_get(args, "q");
if (!xs_is_null(aq)) {
- xs *q = xs_tolower_i(xs_dup(aq));
+ xs *q = xs_utf8_to_lower(xs_dup(aq));
out = xs_list_new();
xs *wing = following_list(&snac1);
xs *wers = follower_list(&snac1);
@@ -1780,7 +1781,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
}
else
if (strcmp(opt, "statuses") == 0) {
- /* we don't serve statuses of others; return the empty list */
+ /* we don't serve statuses of others; return the empty list */
out = xs_list_new();
}
else
@@ -1999,7 +2000,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
}
else
if (strcmp(cmd, "/v2/filters") == 0) { /** **/
- /* snac will never have filters
+ /* snac will never have filters
* but still, without a v2 endpoint a short delay is introduced
* in some apps */
*body = xs_dup("[]");
@@ -2459,7 +2460,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
if (logged_in) {
const xs_list *timeline = xs_dict_get(args, "timeline[]");
xs_str *json = NULL;
- if (!xs_is_null(timeline))
+ if (!xs_is_null(timeline))
json = xs_json_dumps(markers_get(&snac1, timeline), 4);
if (!xs_is_null(json))
@@ -3227,7 +3228,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
if (!xs_is_null(home))
home_marker = xs_dict_get(home, "last_read_id");
}
-
+
const xs_str *notify_marker = xs_dict_get(args, "notifications[last_read_id]");
if (xs_is_null(notify_marker)) {
const xs_dict *notify = xs_dict_get(args, "notifications");