diff options
| author | default <nobody@localhost> | 2025-01-05 09:34:00 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2025-01-05 09:34:00 +0100 |
| commit | 3a1cae73265aebdbe678d94fbdc16edf3ccc643f (patch) | |
| tree | 3c50341495d370dfeb7bfe0312ad5644d9c8f865 /mastoapi.c | |
| parent | 17d7e0027abb48040ef989b1894bcd0bc28c9faa (diff) | |
Moved post language setting to msg_note(), where it really belongs.
On the way, posting from the Mastodon API sets the language accordingly.
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |