summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/activitypub.c b/activitypub.c
index 24cf49d..1fb09c6 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1257,7 +1257,6 @@ int update_question(snac *user, const char *id)
1257 xs *msg = NULL; 1257 xs *msg = NULL;
1258 xs *rcnt = xs_dict_new(); 1258 xs *rcnt = xs_dict_new();
1259 xs *z = xs_number_new(0); 1259 xs *z = xs_number_new(0);
1260 xs *rcpts = xs_list_new();
1261 xs *lopts = xs_list_new(); 1260 xs *lopts = xs_list_new();
1262 xs_list *opts; 1261 xs_list *opts;
1263 xs_list *p; 1262 xs_list *p;
@@ -1286,6 +1285,9 @@ int update_question(snac *user, const char *id)
1286 } 1285 }
1287 } 1286 }
1288 1287
1288 xs_set s;
1289 xs_set_init(&s);
1290
1289 /* iterate now the children (the votes) */ 1291 /* iterate now the children (the votes) */
1290 xs *chld = object_children(id); 1292 xs *chld = object_children(id);
1291 p = chld; 1293 p = chld;
@@ -1307,11 +1309,13 @@ int update_question(snac *user, const char *id)
1307 xs *ucnt = xs_number_new(xs_number_get(cnt) + 1); 1309 xs *ucnt = xs_number_new(xs_number_get(cnt) + 1);
1308 rcnt = xs_dict_set(rcnt, name, ucnt); 1310 rcnt = xs_dict_set(rcnt, name, ucnt);
1309 1311
1310 rcpts = xs_list_append(rcpts, atto); 1312 xs_set_add(&s, atto);
1311 } 1313 }
1312 } 1314 }
1313 } 1315 }
1314 1316
1317 xs *rcpts = xs_set_result(&s);
1318
1315 /* create a new list of options with their new counts */ 1319 /* create a new list of options with their new counts */
1316 xs *nopts = xs_list_new(); 1320 xs *nopts = xs_list_new();
1317 p = lopts; 1321 p = lopts;
@@ -1354,6 +1358,7 @@ int update_question(snac *user, const char *id)
1354 /* update the count of voters */ 1358 /* update the count of voters */
1355 xs *vcnt = xs_number_new(xs_list_len(rcpts)); 1359 xs *vcnt = xs_number_new(xs_list_len(rcpts));
1356 msg = xs_dict_set(msg, "votersCount", vcnt); 1360 msg = xs_dict_set(msg, "votersCount", vcnt);
1361 msg = xs_dict_set(msg, "cc", rcpts);
1357 1362
1358 /* store */ 1363 /* store */
1359 object_add_ow(id, msg); 1364 object_add_ow(id, msg);