diff options
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 30 |
1 files changed, 15 insertions, 15 deletions
| @@ -1382,7 +1382,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1382 | } | 1382 | } |
| 1383 | } | 1383 | } |
| 1384 | else | 1384 | else |
| 1385 | if (strcmp(op, "context") == 0) { | 1385 | if (strcmp(op, "context") == 0) { /** **/ |
| 1386 | /* return ancestors and children */ | 1386 | /* return ancestors and children */ |
| 1387 | xs *anc = xs_list_new(); | 1387 | xs *anc = xs_list_new(); |
| 1388 | xs *des = xs_list_new(); | 1388 | xs *des = xs_list_new(); |
| @@ -1422,8 +1422,8 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1422 | out = xs_dict_append(out, "descendants", des); | 1422 | out = xs_dict_append(out, "descendants", des); |
| 1423 | } | 1423 | } |
| 1424 | else | 1424 | else |
| 1425 | if (strcmp(op, "reblogged_by") == 0 || | 1425 | if (strcmp(op, "reblogged_by") == 0 || /** **/ |
| 1426 | strcmp(op, "favourited_by") == 0) { | 1426 | strcmp(op, "favourited_by") == 0) { /** **/ |
| 1427 | /* return the list of people who liked or boosted this */ | 1427 | /* return the list of people who liked or boosted this */ |
| 1428 | out = xs_list_new(); | 1428 | out = xs_list_new(); |
| 1429 | 1429 | ||
| @@ -1719,7 +1719,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 1719 | /* no operation (?) */ | 1719 | /* no operation (?) */ |
| 1720 | } | 1720 | } |
| 1721 | else | 1721 | else |
| 1722 | if (strcmp(op, "favourite") == 0) { | 1722 | if (strcmp(op, "favourite") == 0) { /** **/ |
| 1723 | xs *n_msg = msg_admiration(&snac, id, "Like"); | 1723 | xs *n_msg = msg_admiration(&snac, id, "Like"); |
| 1724 | 1724 | ||
| 1725 | if (n_msg != NULL) { | 1725 | if (n_msg != NULL) { |
| @@ -1730,7 +1730,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 1730 | } | 1730 | } |
| 1731 | } | 1731 | } |
| 1732 | else | 1732 | else |
| 1733 | if (strcmp(op, "unfavourite") == 0) { | 1733 | if (strcmp(op, "unfavourite") == 0) { /** **/ |
| 1734 | /* partial support: as the original Like message | 1734 | /* partial support: as the original Like message |
| 1735 | is not stored anywhere here, it's not possible | 1735 | is not stored anywhere here, it's not possible |
| 1736 | to send an Undo + Like; the only thing done here | 1736 | to send an Undo + Like; the only thing done here |
| @@ -1738,7 +1738,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 1738 | object_unadmire(id, snac.actor, 1); | 1738 | object_unadmire(id, snac.actor, 1); |
| 1739 | } | 1739 | } |
| 1740 | else | 1740 | else |
| 1741 | if (strcmp(op, "reblog") == 0) { | 1741 | if (strcmp(op, "reblog") == 0) { /** **/ |
| 1742 | xs *n_msg = msg_admiration(&snac, id, "Announce"); | 1742 | xs *n_msg = msg_admiration(&snac, id, "Announce"); |
| 1743 | 1743 | ||
| 1744 | if (n_msg != NULL) { | 1744 | if (n_msg != NULL) { |
| @@ -1749,32 +1749,32 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 1749 | } | 1749 | } |
| 1750 | } | 1750 | } |
| 1751 | else | 1751 | else |
| 1752 | if (strcmp(op, "unreblog") == 0) { | 1752 | if (strcmp(op, "unreblog") == 0) { /** **/ |
| 1753 | /* partial support: see comment in 'unfavourite' */ | 1753 | /* partial support: see comment in 'unfavourite' */ |
| 1754 | object_unadmire(id, snac.actor, 0); | 1754 | object_unadmire(id, snac.actor, 0); |
| 1755 | } | 1755 | } |
| 1756 | else | 1756 | else |
| 1757 | if (strcmp(op, "bookmark") == 0) { | 1757 | if (strcmp(op, "bookmark") == 0) { /** **/ |
| 1758 | /* snac does not support bookmarks */ | 1758 | /* snac does not support bookmarks */ |
| 1759 | } | 1759 | } |
| 1760 | else | 1760 | else |
| 1761 | if (strcmp(op, "unbookmark") == 0) { | 1761 | if (strcmp(op, "unbookmark") == 0) { /** **/ |
| 1762 | /* snac does not support bookmarks */ | 1762 | /* snac does not support bookmarks */ |
| 1763 | } | 1763 | } |
| 1764 | else | 1764 | else |
| 1765 | if (strcmp(op, "pin") == 0) { | 1765 | if (strcmp(op, "pin") == 0) { /** **/ |
| 1766 | /* snac does not support pinning */ | 1766 | /* snac does not support pinning */ |
| 1767 | } | 1767 | } |
| 1768 | else | 1768 | else |
| 1769 | if (strcmp(op, "unpin") == 0) { | 1769 | if (strcmp(op, "unpin") == 0) { /** **/ |
| 1770 | /* snac does not support pinning */ | 1770 | /* snac does not support pinning */ |
| 1771 | } | 1771 | } |
| 1772 | else | 1772 | else |
| 1773 | if (strcmp(op, "mute") == 0) { | 1773 | if (strcmp(op, "mute") == 0) { /** **/ |
| 1774 | /* Mastodon's mute is snac's hide */ | 1774 | /* Mastodon's mute is snac's hide */ |
| 1775 | } | 1775 | } |
| 1776 | else | 1776 | else |
| 1777 | if (strcmp(op, "unmute") == 0) { | 1777 | if (strcmp(op, "unmute") == 0) { /** **/ |
| 1778 | /* Mastodon's unmute is snac's unhide */ | 1778 | /* Mastodon's unmute is snac's unhide */ |
| 1779 | } | 1779 | } |
| 1780 | } | 1780 | } |
| @@ -1895,7 +1895,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 1895 | /* ? */ | 1895 | /* ? */ |
| 1896 | } | 1896 | } |
| 1897 | else | 1897 | else |
| 1898 | if (strcmp(opt, "follow") == 0) { | 1898 | if (strcmp(opt, "follow") == 0) { /** **/ |
| 1899 | if (valid_status(object_get_by_md5(md5, &actor_o))) { | 1899 | if (valid_status(object_get_by_md5(md5, &actor_o))) { |
| 1900 | const char *actor = xs_dict_get(actor_o, "id"); | 1900 | const char *actor = xs_dict_get(actor_o, "id"); |
| 1901 | 1901 | ||
| @@ -1914,7 +1914,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path, | |||
| 1914 | } | 1914 | } |
| 1915 | } | 1915 | } |
| 1916 | else | 1916 | else |
| 1917 | if (strcmp(opt, "unfollow") == 0) { | 1917 | if (strcmp(opt, "unfollow") == 0) { /** **/ |
| 1918 | if (valid_status(object_get_by_md5(md5, &actor_o))) { | 1918 | if (valid_status(object_get_by_md5(md5, &actor_o))) { |
| 1919 | const char *actor = xs_dict_get(actor_o, "id"); | 1919 | const char *actor = xs_dict_get(actor_o, "id"); |
| 1920 | 1920 | ||