From 9a7b800cc19ff6b69fe1d373a58b9dd0cbf901ec Mon Sep 17 00:00:00 2001 From: nekobit Date: Sat, 30 Jul 2022 20:03:39 +0000 Subject: [PATCH] Status application info FossilOrigin-Name: 3a9f6c4cefebb8f9fb29f05a80cf4ab3f0350eea79c2c78c534f9f19ce6bc810 --- include/mastodont_application.h | 2 ++ src/application.c | 6 ++++++ src/status.c | 1 + 3 files changed, 9 insertions(+) diff --git a/include/mastodont_application.h b/include/mastodont_application.h index b77ab05..6313f26 100644 --- a/include/mastodont_application.h +++ b/include/mastodont_application.h @@ -75,4 +75,6 @@ int mastodont_obtain_oauth_token(mastodont_t* data, struct mstdnt_storage* storage, struct mstdnt_oauth_token* app); +void _mstdnt_val_application_call(cJSON* v, void* _type); + #endif /* MASTODONT_ACCOUNT */ diff --git a/src/application.c b/src/application.c index 1f59584..33e8f95 100644 --- a/src/application.c +++ b/src/application.c @@ -20,6 +20,12 @@ #include #include +void _mstdnt_val_application_call(cJSON* v, void* _type) +{ + struct mstdnt_app* type = _type; + mstdnt_app_json(type, v->child); +} + static int mstdnt_app_json(cJSON* json, struct mstdnt_app* app) { /* Zero out */ diff --git a/src/status.c b/src/status.c index a4c8c4e..c998d99 100644 --- a/src/status.c +++ b/src/status.c @@ -115,6 +115,7 @@ int mstdnt_status_json(struct mstdnt_status* status, cJSON* js) { "bookmarked", &(status->bookmarked), _mstdnt_val_bool_call }, { "pinned", &(status->pinned), _mstdnt_val_bool_call }, { "reblogs_count", &(status->reblogs_count), _mstdnt_val_uint_call }, + { "application", &(status->application), _mstdnt_val_application_call }, { "favourites_count", &(status->favourites_count), _mstdnt_val_uint_call }, { "replies_count", &(status->replies_count), _mstdnt_val_uint_call }, { "media_attachments", &att_args, _mstdnt_val_attachments_call },