snac2

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

commit 3c7cccba3d9d90874e26550e1334a7111883b2fd
parent 2fab441d7133e018d043115a31b0253e67ce214e
Author: default <nobody@localhost>
Date:   Mon, 28 Nov 2022 11:06:46 +0100

Changed following_list() to return a list of actors.

Diffstat:
Mdata.c | 14++++++++++++--
Mhtml.c | 2+-
2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/data.c b/data.c @@ -1146,6 +1146,12 @@ void timeline_admire(snac *snac, char *id, char *admirer, int like) } +/** following **/ + +/* this needs special treatment and cannot use the object db as is, + with a link to a cached author, because we need the Follow object + in case we need to unfollow (Undo + original Follow) */ + d_char *_following_fn(snac *snac, char *actor) { xs *md5 = xs_md5_hex(actor, strlen(actor)); @@ -1242,8 +1248,12 @@ d_char *following_list(snac *snac) if (o != NULL) { char *type = xs_dict_get(o, "type"); - if (!xs_is_null(type) && strcmp(type, "Accept") == 0) - list = xs_list_append(list, o); + if (!xs_is_null(type) && strcmp(type, "Accept") == 0) { + char *actor = xs_dict_get(o, "actor"); + + if (!xs_is_null(actor)) + list = xs_list_append(list, actor); + } } } } diff --git a/html.c b/html.c @@ -938,7 +938,7 @@ d_char *html_people(snac *snac) s = html_user_header(snac, s, 0); -// s = html_people_list(snac, s, wing, L("People you follow"), "i"); + s = html_people_list(snac, s, wing, L("People you follow"), "i"); s = html_people_list(snac, s, wers, L("People that follows you"), "e");