snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 1bb52559b2de8d896ad2e3a4c2fd4207c460733f
parent 3797355f943d5e2ece5a4ed6c153c295c19f1734
Author: default <nobody@localhost>
Date:   Sat,  1 Oct 2022 08:05:20 +0200

New web action 'Follow'.

Diffstat:
Mhtml.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/html.c b/html.c @@ -867,6 +867,14 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, } else if (strcmp(action, L("Follow")) == 0) { + char *msg = msg_follow(&snac, actor); + + /* reload the actor from the message, in may be different */ + actor = xs_dict_get(msg, "object"); + + following_add(&snac, actor, msg); + + enqueue_output(&snac, msg, actor, 0); } else if (strcmp(action, L("Unfollow")) == 0) {