diff options
| author | 2023-04-24 17:11:12 +0200 | |
|---|---|---|
| committer | 2023-04-24 17:11:12 +0200 | |
| commit | 9456a57954821db53b0db90dbe7b7b0a9ba0e6fe (patch) | |
| tree | 7e2146d000292b18667db53bdff512dc7a2ffbd2 | |
| parent | Added mentions to mastoapi_status(). (diff) | |
| download | penes-snac2-9456a57954821db53b0db90dbe7b7b0a9ba0e6fe.tar.gz penes-snac2-9456a57954821db53b0db90dbe7b7b0a9ba0e6fe.tar.xz penes-snac2-9456a57954821db53b0db90dbe7b7b0a9ba0e6fe.zip | |
Added the hashtag list to mastoapi_status().
What is this for?
| -rw-r--r-- | mastoapi.c | 14 |
1 files changed, 14 insertions, 0 deletions
| @@ -590,6 +590,20 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg) | |||
| 590 | ml = xs_list_append(ml, d1); | 590 | ml = xs_list_append(ml, d1); |
| 591 | } | 591 | } |
| 592 | } | 592 | } |
| 593 | else | ||
| 594 | if (strcmp(type, "Hashtag") == 0) { | ||
| 595 | const char *name = xs_dict_get(v, "name"); | ||
| 596 | const char *href = xs_dict_get(v, "href"); | ||
| 597 | |||
| 598 | if (!xs_is_null(name) && !xs_is_null(href)) { | ||
| 599 | xs *nm = xs_strip_chars_i(xs_dup(name), "#"); | ||
| 600 | |||
| 601 | d1 = xs_dict_append(d1, "name", nm); | ||
| 602 | d1 = xs_dict_append(d1, "url", href); | ||
| 603 | |||
| 604 | htl = xs_list_append(htl, d1); | ||
| 605 | } | ||
| 606 | } | ||
| 593 | } | 607 | } |
| 594 | 608 | ||
| 595 | st = xs_dict_append(st, "mentions", ml); | 609 | st = xs_dict_append(st, "mentions", ml); |