diff options
| author | 2022-11-28 11:06:46 +0100 | |
|---|---|---|
| committer | 2022-11-28 11:06:46 +0100 | |
| commit | 3c7cccba3d9d90874e26550e1334a7111883b2fd (patch) | |
| tree | 4351cb8db405e3be2253f2f4029360ac635a1f76 /data.c | |
| parent | Deleted debug trap. (diff) | |
| download | snac2-3c7cccba3d9d90874e26550e1334a7111883b2fd.tar.gz snac2-3c7cccba3d9d90874e26550e1334a7111883b2fd.tar.xz snac2-3c7cccba3d9d90874e26550e1334a7111883b2fd.zip | |
Changed following_list() to return a list of actors.
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 14 |
1 files changed, 12 insertions, 2 deletions
| @@ -1146,6 +1146,12 @@ void timeline_admire(snac *snac, char *id, char *admirer, int like) | |||
| 1146 | } | 1146 | } |
| 1147 | 1147 | ||
| 1148 | 1148 | ||
| 1149 | /** following **/ | ||
| 1150 | |||
| 1151 | /* this needs special treatment and cannot use the object db as is, | ||
| 1152 | with a link to a cached author, because we need the Follow object | ||
| 1153 | in case we need to unfollow (Undo + original Follow) */ | ||
| 1154 | |||
| 1149 | d_char *_following_fn(snac *snac, char *actor) | 1155 | d_char *_following_fn(snac *snac, char *actor) |
| 1150 | { | 1156 | { |
| 1151 | xs *md5 = xs_md5_hex(actor, strlen(actor)); | 1157 | xs *md5 = xs_md5_hex(actor, strlen(actor)); |
| @@ -1242,8 +1248,12 @@ d_char *following_list(snac *snac) | |||
| 1242 | if (o != NULL) { | 1248 | if (o != NULL) { |
| 1243 | char *type = xs_dict_get(o, "type"); | 1249 | char *type = xs_dict_get(o, "type"); |
| 1244 | 1250 | ||
| 1245 | if (!xs_is_null(type) && strcmp(type, "Accept") == 0) | 1251 | if (!xs_is_null(type) && strcmp(type, "Accept") == 0) { |
| 1246 | list = xs_list_append(list, o); | 1252 | char *actor = xs_dict_get(o, "actor"); |
| 1253 | |||
| 1254 | if (!xs_is_null(actor)) | ||
| 1255 | list = xs_list_append(list, actor); | ||
| 1256 | } | ||
| 1247 | } | 1257 | } |
| 1248 | } | 1258 | } |
| 1249 | } | 1259 | } |