summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-11-28 11:06:46 +0100
committerdefault <nobody@localhost>2022-11-28 11:06:46 +0100
commit3c7cccba3d9d90874e26550e1334a7111883b2fd (patch)
tree4351cb8db405e3be2253f2f4029360ac635a1f76 /data.c
parent2fab441d7133e018d043115a31b0253e67ce214e (diff)
Changed following_list() to return a list of actors.
Diffstat (limited to 'data.c')
-rw-r--r--data.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/data.c b/data.c
index 1b9be2d..dda1550 100644
--- 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);
+ }
}
}
}