summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authorGravatar default2025-03-02 06:04:52 +0100
committerGravatar default2025-03-02 06:04:52 +0100
commit8bd364bd49116b8b335272300ca05f25e1267df7 (patch)
tree662125524613d1d1309edc990fe143b19e510a49 /mastoapi.c
parentUpdated documentation. (diff)
downloadpenes-snac2-8bd364bd49116b8b335272300ca05f25e1267df7.tar.gz
penes-snac2-8bd364bd49116b8b335272300ca05f25e1267df7.tar.xz
penes-snac2-8bd364bd49116b8b335272300ca05f25e1267df7.zip
msg_note() accepts a nullable post date.
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 797a4da..25b17e2 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -2628,6 +2628,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
2628 const char *summary = xs_dict_get(args, "spoiler_text"); 2628 const char *summary = xs_dict_get(args, "spoiler_text");
2629 const char *media_ids = xs_dict_get(args, "media_ids"); 2629 const char *media_ids = xs_dict_get(args, "media_ids");
2630 const char *language = xs_dict_get(args, "language"); 2630 const char *language = xs_dict_get(args, "language");
2631 const char *sched_date = xs_dict_get(args, "scheduled_at");
2631 2632
2632 if (xs_is_null(media_ids)) 2633 if (xs_is_null(media_ids))
2633 media_ids = xs_dict_get(args, "media_ids[]"); 2634 media_ids = xs_dict_get(args, "media_ids[]");
@@ -2684,7 +2685,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
2684 if (strcmp(visibility, "public") == 0) 2685 if (strcmp(visibility, "public") == 0)
2685 scope = 0; 2686 scope = 0;
2686 2687
2687 xs *msg = msg_note(&snac, content, NULL, irt, attach_list, scope, language); 2688 xs *msg = msg_note(&snac, content, NULL, irt, attach_list, scope, language, sched_date);
2688 2689
2689 if (!xs_is_null(summary) && *summary) { 2690 if (!xs_is_null(summary) && *summary) {
2690 msg = xs_dict_set(msg, "sensitive", xs_stock(XSTYPE_TRUE)); 2691 msg = xs_dict_set(msg, "sensitive", xs_stock(XSTYPE_TRUE));
@@ -3034,7 +3035,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
3034 if (o) { 3035 if (o) {
3035 const char *name = xs_dict_get(o, "name"); 3036 const char *name = xs_dict_get(o, "name");
3036 3037
3037 xs *msg = msg_note(&snac, "", atto, (char *)id, NULL, 1, NULL); 3038 xs *msg = msg_note(&snac, "", atto, (char *)id, NULL, 1, NULL, NULL);
3038 msg = xs_dict_append(msg, "name", name); 3039 msg = xs_dict_append(msg, "name", name);
3039 3040
3040 xs *c_msg = msg_create(&snac, msg); 3041 xs *c_msg = msg_create(&snac, msg);