From dd066dad54555dea9e77bacd947c152266275057 Mon Sep 17 00:00:00 2001 From: nekobit Date: Sat, 13 Aug 2022 06:16:49 +0000 Subject: [PATCH] Use _mstdnt_val_datetime_unix_call for known created_at parameters FossilOrigin-Name: c191f39f0f0ad83d5c41056573e2d67e70b7c91639773989f4f0c98e06fbf112 --- include/mastodont_account.h | 2 +- include/mastodont_scrobbles.h | 2 +- src/account.c | 2 +- src/notification.c | 4 ++-- src/scrobbles.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/mastodont_account.h b/include/mastodont_account.h index c9dd966..258c74c 100644 --- a/include/mastodont_account.h +++ b/include/mastodont_account.h @@ -51,7 +51,7 @@ struct mstdnt_account size_t emojis_len; /* Statistic attributes */ - char* created_at; + time_t created_at; char* last_status_at; unsigned statuses_count; unsigned followers_count; diff --git a/include/mastodont_scrobbles.h b/include/mastodont_scrobbles.h index 536bd7a..d77fdfb 100644 --- a/include/mastodont_scrobbles.h +++ b/include/mastodont_scrobbles.h @@ -25,7 +25,7 @@ struct mstdnt_scrobble struct mstdnt_account account; char* album; char* artist; - char* created_at; + time_t created_at; char* id; int length; char* title; diff --git a/src/account.c b/src/account.c index 0d716cb..00ec849 100644 --- a/src/account.c +++ b/src/account.c @@ -196,7 +196,7 @@ int mstdnt_account_json(struct mstdnt_account* acct, cJSON* js) { "username", &(acct->username), _mstdnt_val_string_call }, { "acct", &(acct->acct), _mstdnt_val_string_call }, { "display_name", &(acct->display_name), _mstdnt_val_string_call }, - { "created_at", &(acct->created_at), _mstdnt_val_string_call }, + { "created_at", &(acct->created_at), _mstdnt_val_datetime_unix_call }, { "note", &(acct->note), _mstdnt_val_string_call }, { "url", &(acct->url), _mstdnt_val_string_call }, { "avatar", &(acct->avatar), _mstdnt_val_string_call }, diff --git a/src/notification.c b/src/notification.c index 343076c..96b2638 100644 --- a/src/notification.c +++ b/src/notification.c @@ -90,8 +90,8 @@ int mstdnt_notification_pleroma_json(struct mstdnt_notification_pleroma* notif, memset(notif, 0, sizeof(struct mstdnt_notification_pleroma)); struct _mstdnt_val_ref vals[] = { - { "is_muted", &(notif->is_muted), _mstdnt_val_uint_call }, - { "is_seen", &(notif->is_seen), _mstdnt_val_uint_call }, + { "is_muted", &(notif->is_muted), _mstdnt_val_bool_call }, + { "is_seen", &(notif->is_seen), _mstdnt_val_bool_call }, }; for (v = js; v; v = v->next) diff --git a/src/scrobbles.c b/src/scrobbles.c index 82db849..ccdf818 100644 --- a/src/scrobbles.c +++ b/src/scrobbles.c @@ -32,7 +32,7 @@ int mstdnt_scrobble_json(struct mstdnt_scrobble* scrobble, cJSON* js) { "account", &(scrobble->account), _mstdnt_val_account_call }, { "album", &(scrobble->album), _mstdnt_val_string_call }, { "artist", &(scrobble->artist), _mstdnt_val_string_call }, - { "created_at", &(scrobble->created_at), _mstdnt_val_string_call }, + { "created_at", &(scrobble->created_at), _mstdnt_val_datetime_unix_call }, { "id", &(scrobble->id), _mstdnt_val_string_call }, { "length", &(scrobble->length), _mstdnt_val_uint_call }, { "title", &(scrobble->title), _mstdnt_val_string_call }