summaryrefslogtreecommitdiff
path: root/src/status.c
diff options
context:
space:
mode:
authornirav <nirav@teisuu.com>2019-03-26 07:54:56 +0530
committerDandelion <nirav@teisuu.com>2019-03-26 07:54:56 +0530
commitcc727e972f7fdc871ee1f42cf014151b67422bf0 (patch)
treeeda5279bf96e4999e4219beb331df4646cfd2a5b /src/status.c
parent4b27c1a348d8de036dabd5525452f5b9ad08a32b (diff)
downloadap_client-cc727e972f7fdc871ee1f42cf014151b67422bf0.tar.gz
ap_client-cc727e972f7fdc871ee1f42cf014151b67422bf0.zip
Update login flow and timeline window
Diffstat (limited to 'src/status.c')
-rw-r--r--src/status.c8
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)