summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-04-24 17:11:12 +0200
committerdefault <nobody@localhost>2023-04-24 17:11:12 +0200
commit9456a57954821db53b0db90dbe7b7b0a9ba0e6fe (patch)
tree7e2146d000292b18667db53bdff512dc7a2ffbd2 /mastoapi.c
parentcfca2adcb9e9d9fbc0c2a30e98d129892dacfed2 (diff)
Added the hashtag list to mastoapi_status().
What is this for?
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 23312f8..0bc5dd9 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -590,6 +590,20 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
ml = xs_list_append(ml, d1);
}
}
+ else
+ if (strcmp(type, "Hashtag") == 0) {
+ const char *name = xs_dict_get(v, "name");
+ const char *href = xs_dict_get(v, "href");
+
+ if (!xs_is_null(name) && !xs_is_null(href)) {
+ xs *nm = xs_strip_chars_i(xs_dup(name), "#");
+
+ d1 = xs_dict_append(d1, "name", nm);
+ d1 = xs_dict_append(d1, "url", href);
+
+ htl = xs_list_append(htl, d1);
+ }
+ }
}
st = xs_dict_append(st, "mentions", ml);