summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-10-02 09:27:17 +0200
committerdefault <nobody@localhost>2022-10-02 09:27:17 +0200
commit849913dc5987997f9db96e23c7acf9c29f9c6d7f (patch)
tree142b0f98c094b4714b49562f90c952abb3e1f233 /activitypub.c
parent3161eeb0283f990ba83fbce33d5e3f7f0ad95f24 (diff)
Use the time functions of xs_time.h.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/activitypub.c b/activitypub.c
index 9fee973..8771ee8 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -8,6 +8,7 @@
#include "xs_mime.h"
#include "xs_openssl.h"
#include "xs_regex.h"
+#include "xs_time.h"
#include "snac.h"
@@ -281,7 +282,7 @@ d_char *msg_base(snac *snac, char *type, char *id, char *actor, char *date, char
/* generated values */
if (date && strcmp(date, "@now") == 0)
- date = published = xs_utc_time("%Y-%m-%dT%H:%M:%SZ");
+ date = published = xs_str_utctime(0, "%Y-%m-%dT%H:%M:%SZ");
if (id != NULL) {
if (strcmp(id, "@dummy") == 0) {
@@ -649,7 +650,7 @@ int process_message(snac *snac, char *msg, char *req)
if (xs_is_null(xs_dict_get(f_msg, "published"))) {
/* add a date if it doesn't include one (Mastodon) */
- xs *date = xs_utc_time("%Y-%m-%dT%H:%M:%SZ");
+ xs *date = xs_str_utctime(0, "%Y-%m-%dT%H:%M:%SZ");
f_msg = xs_dict_set(f_msg, "published", date);
}