diff options
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 5 |
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 @@ | |||
| 8 | #include "xs_mime.h" | 8 | #include "xs_mime.h" |
| 9 | #include "xs_openssl.h" | 9 | #include "xs_openssl.h" |
| 10 | #include "xs_regex.h" | 10 | #include "xs_regex.h" |
| 11 | #include "xs_time.h" | ||
| 11 | 12 | ||
| 12 | #include "snac.h" | 13 | #include "snac.h" |
| 13 | 14 | ||
| @@ -281,7 +282,7 @@ d_char *msg_base(snac *snac, char *type, char *id, char *actor, char *date, char | |||
| 281 | 282 | ||
| 282 | /* generated values */ | 283 | /* generated values */ |
| 283 | if (date && strcmp(date, "@now") == 0) | 284 | if (date && strcmp(date, "@now") == 0) |
| 284 | date = published = xs_utc_time("%Y-%m-%dT%H:%M:%SZ"); | 285 | date = published = xs_str_utctime(0, "%Y-%m-%dT%H:%M:%SZ"); |
| 285 | 286 | ||
| 286 | if (id != NULL) { | 287 | if (id != NULL) { |
| 287 | if (strcmp(id, "@dummy") == 0) { | 288 | if (strcmp(id, "@dummy") == 0) { |
| @@ -649,7 +650,7 @@ int process_message(snac *snac, char *msg, char *req) | |||
| 649 | 650 | ||
| 650 | if (xs_is_null(xs_dict_get(f_msg, "published"))) { | 651 | if (xs_is_null(xs_dict_get(f_msg, "published"))) { |
| 651 | /* add a date if it doesn't include one (Mastodon) */ | 652 | /* add a date if it doesn't include one (Mastodon) */ |
| 652 | xs *date = xs_utc_time("%Y-%m-%dT%H:%M:%SZ"); | 653 | xs *date = xs_str_utctime(0, "%Y-%m-%dT%H:%M:%SZ"); |
| 653 | f_msg = xs_dict_set(f_msg, "published", date); | 654 | f_msg = xs_dict_set(f_msg, "published", date); |
| 654 | } | 655 | } |
| 655 | 656 | ||