Use _mstdnt_val_datetime_unix_call for known created_at parameters

FossilOrigin-Name: c191f39f0f0ad83d5c41056573e2d67e70b7c91639773989f4f0c98e06fbf112
This commit is contained in:
nekobit 2022-08-13 06:16:49 +00:00
parent a14da74d56
commit dd066dad54
5 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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 },

View File

@ -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)

View File

@ -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 }