summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--activitypub.c6
-rw-r--r--data.c2
-rw-r--r--html.c2
-rw-r--r--mastoapi.c2
-rw-r--r--snac.h2
-rw-r--r--utils.c2
6 files changed, 9 insertions, 7 deletions
diff --git a/activitypub.c b/activitypub.c
index 7f642b9..6c8772d 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -498,7 +498,7 @@ xs_dict *msg_base(snac *snac, const char *type, const char *id,
498 498
499 /* generated values */ 499 /* generated values */
500 if (date && strcmp(date, "@now") == 0) { 500 if (date && strcmp(date, "@now") == 0) {
501 published = xs_str_utctime(0, "%Y-%m-%dT%H:%M:%SZ"); 501 published = xs_str_utctime(0, ISO_DATE_SPEC);
502 date = published; 502 date = published;
503 } 503 }
504 504
@@ -959,7 +959,7 @@ xs_dict *msg_question(snac *user, const char *content, const xs_list *opts, int
959 959
960 /* set the end time */ 960 /* set the end time */
961 time_t t = time(NULL) + end_secs; 961 time_t t = time(NULL) + end_secs;
962 xs *et = xs_str_utctime(t, "%Y-%m-%dT%H:%M:%SZ"); 962 xs *et = xs_str_utctime(t, ISO_DATE_SPEC);
963 963
964 msg = xs_dict_append(msg, "endTime", et); 964 msg = xs_dict_append(msg, "endTime", et);
965 965
@@ -1234,7 +1234,7 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
1234 1234
1235 if (xs_is_null(xs_dict_get(f_msg, "published"))) { 1235 if (xs_is_null(xs_dict_get(f_msg, "published"))) {
1236 /* add a date if it doesn't include one (Mastodon) */ 1236 /* add a date if it doesn't include one (Mastodon) */
1237 xs *date = xs_str_utctime(0, "%Y-%m-%dT%H:%M:%SZ"); 1237 xs *date = xs_str_utctime(0, ISO_DATE_SPEC);
1238 f_msg = xs_dict_set(f_msg, "published", date); 1238 f_msg = xs_dict_set(f_msg, "published", date);
1239 } 1239 }
1240 1240
diff --git a/data.c b/data.c
index fa079cc..303b534 100644
--- a/data.c
+++ b/data.c
@@ -1688,7 +1688,7 @@ void notify_add(snac *snac, const char *type, const char *utype,
1688{ 1688{
1689 xs *ntid = tid(0); 1689 xs *ntid = tid(0);
1690 xs *fn = xs_fmt("%s/notify/", snac->basedir); 1690 xs *fn = xs_fmt("%s/notify/", snac->basedir);
1691 xs *date = xs_str_utctime(0, "%Y-%m-%dT%H:%M:%SZ"); 1691 xs *date = xs_str_utctime(0, ISO_DATE_SPEC);
1692 FILE *f; 1692 FILE *f;
1693 1693
1694 /* create the directory */ 1694 /* create the directory */
diff --git a/html.c b/html.c
index 83a2b13..ea00ac1 100644
--- a/html.c
+++ b/html.c
@@ -1756,7 +1756,7 @@ int html_post_handler(const xs_dict *req, const char *q_path,
1756 } 1756 }
1757 1757
1758 /* set the updated field */ 1758 /* set the updated field */
1759 xs *updated = xs_str_utctime(0, "%Y-%m-%dT%H:%M:%SZ"); 1759 xs *updated = xs_str_utctime(0, ISO_DATE_SPEC);
1760 msg = xs_dict_set(msg, "updated", updated); 1760 msg = xs_dict_set(msg, "updated", updated);
1761 1761
1762 /* overwrite object, not updating the indexes */ 1762 /* overwrite object, not updating the indexes */
diff --git a/mastoapi.c b/mastoapi.c
index dc8320d..feeb06f 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -524,7 +524,7 @@ xs_dict *mastoapi_account(const xs_dict *actor)
524 acct = xs_dict_append(acct, "created_at", pub); 524 acct = xs_dict_append(acct, "created_at", pub);
525 else { 525 else {
526 /* unset created_at crashes Tusky, so lie like a mf */ 526 /* unset created_at crashes Tusky, so lie like a mf */
527 xs *date = xs_str_utctime(0, "%Y-%m-%dT%H:%M:%SZ"); 527 xs *date = xs_str_utctime(0, ISO_DATE_SPEC);
528 acct = xs_dict_append(acct, "created_at", date); 528 acct = xs_dict_append(acct, "created_at", date);
529 } 529 }
530 530
diff --git a/snac.h b/snac.h
index 77825dc..bf8948b 100644
--- a/snac.h
+++ b/snac.h
@@ -9,6 +9,8 @@
9 9
10#define DIR_PERM 02770 10#define DIR_PERM 02770
11 11
12#define ISO_DATE_SPEC "%Y-%m-%dT%H:%M:%SZ"
13
12extern double disk_layout; 14extern double disk_layout;
13extern d_char *srv_basedir; 15extern d_char *srv_basedir;
14extern d_char *srv_config; 16extern d_char *srv_config;
diff --git a/utils.c b/utils.c
index 8594d84..7d51b82 100644
--- a/utils.c
+++ b/utils.c
@@ -218,7 +218,7 @@ int adduser(const char *uid)
218{ 218{
219 snac snac; 219 snac snac;
220 xs *config = xs_dict_new(); 220 xs *config = xs_dict_new();
221 xs *date = xs_str_utctime(0, "%Y-%m-%dT%H:%M:%SZ"); 221 xs *date = xs_str_utctime(0, ISO_DATE_SPEC);
222 xs *pwd = NULL; 222 xs *pwd = NULL;
223 xs *pwd_f = NULL; 223 xs *pwd_f = NULL;
224 xs *key = NULL; 224 xs *key = NULL;