diff options
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 24 |
1 files changed, 21 insertions, 3 deletions
| @@ -657,9 +657,17 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch | |||
| 657 | s = xs_str_cat(s, s1); | 657 | s = xs_str_cat(s, s1); |
| 658 | } | 658 | } |
| 659 | 659 | ||
| 660 | if (xs_list_in(likes, snac->md5) == -1) { | 660 | if (!xs_startswith(id, snac->actor)) { |
| 661 | /* not already liked; add button */ | 661 | if (xs_list_in(likes, snac->md5) == -1) { |
| 662 | s = html_button(s, "like", L("Like")); | 662 | /* not already liked; add button */ |
| 663 | s = html_button(s, "like", L("Like")); | ||
| 664 | } | ||
| 665 | } | ||
| 666 | else { | ||
| 667 | if (is_pinned(snac, id)) | ||
| 668 | s = html_button(s, "unpin", L("Unpin")); | ||
| 669 | else | ||
| 670 | s = html_button(s, "pin", L("Pin")); | ||
| 663 | } | 671 | } |
| 664 | 672 | ||
| 665 | if (is_msg_public(snac, msg)) { | 673 | if (is_msg_public(snac, msg)) { |
| @@ -2090,6 +2098,16 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 2090 | } | 2098 | } |
| 2091 | } | 2099 | } |
| 2092 | else | 2100 | else |
| 2101 | if (strcmp(action, L("Pin")) == 0) { /** **/ | ||
| 2102 | pin(&snac, id); | ||
| 2103 | timeline_touch(&snac); | ||
| 2104 | } | ||
| 2105 | else | ||
| 2106 | if (strcmp(action, L("Unpin")) == 0) { /** **/ | ||
| 2107 | unpin(&snac, id); | ||
| 2108 | timeline_touch(&snac); | ||
| 2109 | } | ||
| 2110 | else | ||
| 2093 | status = 404; | 2111 | status = 404; |
| 2094 | 2112 | ||
| 2095 | /* delete the cached timeline */ | 2113 | /* delete the cached timeline */ |