From 3a1cae73265aebdbe678d94fbdc16edf3ccc643f Mon Sep 17 00:00:00 2001 From: default Date: Sun, 5 Jan 2025 09:34:00 +0100 Subject: Moved post language setting to msg_note(), where it really belongs. On the way, posting from the Mastodon API sets the language accordingly. --- mastoapi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mastoapi.c') diff --git a/mastoapi.c b/mastoapi.c index 853d74b..62108ad 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -2600,6 +2600,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, const char *visibility = xs_dict_get(args, "visibility"); const char *summary = xs_dict_get(args, "spoiler_text"); const char *media_ids = xs_dict_get(args, "media_ids"); + const char *language = xs_dict_get(args, "language"); if (xs_is_null(media_ids)) media_ids = xs_dict_get(args, "media_ids[]"); @@ -2650,7 +2651,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, /* prepare the message */ xs *msg = msg_note(&snac, content, NULL, irt, attach_list, - strcmp(visibility, "public") == 0 ? 0 : 1); + strcmp(visibility, "public") == 0 ? 0 : 1, language); if (!xs_is_null(summary) && *summary) { msg = xs_dict_set(msg, "sensitive", xs_stock(XSTYPE_TRUE)); @@ -3000,7 +3001,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, if (o) { const char *name = xs_dict_get(o, "name"); - xs *msg = msg_note(&snac, "", atto, (char *)id, NULL, 1); + xs *msg = msg_note(&snac, "", atto, (char *)id, NULL, 1, NULL); msg = xs_dict_append(msg, "name", name); xs *c_msg = msg_create(&snac, msg); -- cgit v1.2.3