diff options
Diffstat (limited to 'src/status.c')
-rw-r--r-- | src/status.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/status.c b/src/status.c index 69d1fa2..cfb3645 100644 --- a/src/status.c +++ b/src/status.c @@ -3,6 +3,7 @@ #include <string.h> #include <jansson.h> #include "status.h" +#include "account.h" #include "log.h" struct status *status_from_json(const char *json_data) @@ -57,6 +58,11 @@ struct status *status_from_json_t(const json_t *root) s->url = strdup(json_string_value(url)); } + json_t *account = json_object_get(root, "account"); + if (json_is_object(account)) { + s->account = account_from_json_t(account); + } + json_t *in_reply_to_id = json_object_get(root, "in_reply_to_id"); if (json_is_string(in_reply_to_id)) { s->in_reply_to_id = strdup(json_string_value(in_reply_to_id)); @@ -100,6 +106,8 @@ void status_free(struct status *s) free(s->uri); if (s->url) free(s->url); + if (s->account) + account_free(s->account); if (s->in_reply_to_id) free(s->in_reply_to_id); if (s->in_reply_to_account_id) |