summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-04-24 17:25:32 +0200
committerGravatar default2023-04-24 17:25:32 +0200
commitf625d8842605e4d18be106260fc85ba88ad50b0b (patch)
tree451f445166b6c7f9b5968c787c40e1ab7556fc84
parentAdded the hashtag list to mastoapi_status(). (diff)
downloadsnac2-f625d8842605e4d18be106260fc85ba88ad50b0b.tar.gz
snac2-f625d8842605e4d18be106260fc85ba88ad50b0b.tar.xz
snac2-f625d8842605e4d18be106260fc85ba88ad50b0b.zip
Added custom emojis to Statuses.
-rw-r--r--mastoapi.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/mastoapi.c b/mastoapi.c
index 0bc5dd9..012164e 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -604,6 +604,28 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
604 htl = xs_list_append(htl, d1); 604 htl = xs_list_append(htl, d1);
605 } 605 }
606 } 606 }
607 else
608 if (strcmp(type, "Emoji") == 0) {
609 const char *name = xs_dict_get(v, "name");
610 const xs_dict *icon = xs_dict_get(v, "icon");
611
612 if (!xs_is_null(name) && !xs_is_null(icon)) {
613 const char *url = xs_dict_get(icon, "url");
614
615 if (!xs_is_null(url)) {
616 xs *nm = xs_strip_chars_i(xs_dup(name), ":");
617 xs *t = xs_val_new(XSTYPE_TRUE);
618
619 d1 = xs_dict_append(d1, "shortcode", nm);
620 d1 = xs_dict_append(d1, "url", url);
621 d1 = xs_dict_append(d1, "static_url", url);
622 d1 = xs_dict_append(d1, "visible_in_picker", t);
623 d1 = xs_dict_append(d1, "category", "Emojis");
624
625 eml = xs_list_append(eml, d1);
626 }
627 }
628 }
607 } 629 }
608 630
609 st = xs_dict_append(st, "mentions", ml); 631 st = xs_dict_append(st, "mentions", ml);