diff options
| -rw-r--r-- | data.c | 7 | ||||
| -rw-r--r-- | snac.h | 4 |
2 files changed, 6 insertions, 5 deletions
| @@ -1567,9 +1567,10 @@ int timeline_add(snac *snac, const char *id, const xs_dict *o_msg) | |||
| 1567 | } | 1567 | } |
| 1568 | 1568 | ||
| 1569 | 1569 | ||
| 1570 | int timeline_emoji_react(const char *act, const char *id, xs_dict *msg) | 1570 | int timeline_emoji_react(const char *act, const char *id, const xs_dict *msg_o) |
| 1571 | /* adds an emoji reaction to a message */ | 1571 | /* adds an emoji reaction to a message */ |
| 1572 | { | 1572 | { |
| 1573 | xs *msg = xs_dup(msg_o); | ||
| 1573 | msg = xs_dict_append(msg, "attributedTo", act); | 1574 | msg = xs_dict_append(msg, "attributedTo", act); |
| 1574 | msg = xs_dict_set(msg, "type", "EmojiReact"); | 1575 | msg = xs_dict_set(msg, "type", "EmojiReact"); |
| 1575 | const char *emote_id = xs_dict_get(msg, "id"); | 1576 | const char *emote_id = xs_dict_get(msg, "id"); |
| @@ -1583,7 +1584,7 @@ int timeline_emoji_react(const char *act, const char *id, xs_dict *msg) | |||
| 1583 | 1584 | ||
| 1584 | 1585 | ||
| 1585 | int timeline_admire(snac *snac, const char *id, | 1586 | int timeline_admire(snac *snac, const char *id, |
| 1586 | const char *admirer, int like, xs_dict *msg) | 1587 | const char *admirer, int like, const xs_dict *msg) |
| 1587 | /* updates a timeline entry with a new admiration or emoji reaction */ | 1588 | /* updates a timeline entry with a new admiration or emoji reaction */ |
| 1588 | { | 1589 | { |
| 1589 | int ret; | 1590 | int ret; |
| @@ -1599,7 +1600,7 @@ int timeline_admire(snac *snac, const char *id, | |||
| 1599 | /* use utf <3 as a like, as it is ugly */ | 1600 | /* use utf <3 as a like, as it is ugly */ |
| 1600 | if (type && xs_match(type, "Like|EmojiReact|Emoji") && | 1601 | if (type && xs_match(type, "Like|EmojiReact|Emoji") && |
| 1601 | content && strcmp(content, "❤") != 0) { | 1602 | content && strcmp(content, "❤") != 0) { |
| 1602 | ret = timeline_emoji_react(snac->actor, id, xs_dup(msg)); | 1603 | ret = timeline_emoji_react(snac->actor, id, msg); |
| 1603 | snac_debug(snac, 1, xs_fmt("timeline_emoji_react %s", id)); | 1604 | snac_debug(snac, 1, xs_fmt("timeline_emoji_react %s", id)); |
| 1604 | } | 1605 | } |
| 1605 | 1606 | ||
| @@ -183,8 +183,8 @@ xs_str *user_index_fn(snac *user, const char *idx_name); | |||
| 183 | xs_list *timeline_simple_list(snac *user, const char *idx_name, int skip, int show, int *more); | 183 | xs_list *timeline_simple_list(snac *user, const char *idx_name, int skip, int show, int *more); |
| 184 | xs_list *timeline_list(snac *snac, const char *idx_name, int skip, int show, int *more); | 184 | xs_list *timeline_list(snac *snac, const char *idx_name, int skip, int show, int *more); |
| 185 | int timeline_add(snac *snac, const char *id, const xs_dict *o_msg); | 185 | int timeline_add(snac *snac, const char *id, const xs_dict *o_msg); |
| 186 | int timeline_admire(snac *snac, const char *id, const char *admirer, int like, xs_dict *msg); | 186 | int timeline_admire(snac *snac, const char *id, const char *admirer, int like, const xs_dict *msg); |
| 187 | int timeline_emoji_react(const char *atto, const char *id, xs_dict *o_msg); | 187 | int timeline_emoji_react(const char *atto, const char *id, const xs_dict *o_msg); |
| 188 | 188 | ||
| 189 | xs_list *timeline_top_level(snac *snac, const xs_list *list); | 189 | xs_list *timeline_top_level(snac *snac, const xs_list *list); |
| 190 | void timeline_add_mark(snac *user); | 190 | void timeline_add_mark(snac *user); |