summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/html.c b/html.c
index 9687bed..f2f8b33 100644
--- a/html.c
+++ b/html.c
@@ -505,6 +505,10 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
505 if ((actor = xs_dict_get(msg, "attributedTo")) == NULL) 505 if ((actor = xs_dict_get(msg, "attributedTo")) == NULL)
506 return os; 506 return os;
507 507
508 /* ignore muted morons immediately */
509 if (is_muted(snac, actor))
510 return os;
511
508 if (!valid_status(actor_get(snac, actor, &actor_o))) 512 if (!valid_status(actor_get(snac, actor, &actor_o)))
509 return os; 513 return os;
510 514
@@ -842,23 +846,40 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
842 if (action == NULL) 846 if (action == NULL)
843 return 404; 847 return 404;
844 848
845 if (strcmp(action, "Like") == 0) { 849 snac_debug(&snac, 1, xs_fmt("web action '%s' received", action));
850
851 status = 303;
852
853 if (strcmp(action, L("Like")) == 0) {
846 xs *msg = msg_admiration(&snac, id, "Like"); 854 xs *msg = msg_admiration(&snac, id, "Like");
847 post(&snac, msg); 855 post(&snac, msg);
848 timeline_admire(&snac, id, snac.actor, 1); 856 timeline_admire(&snac, id, snac.actor, 1);
849
850 status = 303;
851 } 857 }
852 else 858 else
853 if (strcmp(action, "Boost") == 0) { 859 if (strcmp(action, L("Boost")) == 0) {
854 xs *msg = msg_admiration(&snac, id, "Announce"); 860 xs *msg = msg_admiration(&snac, id, "Announce");
855 post(&snac, msg); 861 post(&snac, msg);
856 timeline_admire(&snac, id, snac.actor, 0); 862 timeline_admire(&snac, id, snac.actor, 0);
857 863 }
858 status = 303; 864 else
865 if (strcmp(action, L("MUTE")) == 0) {
866 mute(&snac, actor);
867 }
868 else
869 if (strcmp(action, L("Follow")) == 0) {
870 }
871 else
872 if (strcmp(action, L("Unfollow")) == 0) {
873 }
874 else
875 if (strcmp(action, L("Delete")) == 0) {
859 } 876 }
860 else 877 else
861 status = 404; 878 status = 404;
879
880 /* delete the cached timeline */
881 if (status == 303)
882 history_del(&snac, "_timeline.html");
862 } 883 }
863 else 884 else
864 if (p_path && strcmp(p_path, "admin/user-setup") == 0) { 885 if (p_path && strcmp(p_path, "admin/user-setup") == 0) {