summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-01-22 20:31:16 +0100
committerGravatar default2023-01-22 20:31:16 +0100
commit2921dbe0581e96e0f1067cae6aa665dfd5cbc9d6 (patch)
tree9effdc43c344327b435204108193f8e1dad8c614
parentUpdated TODO. (diff)
downloadpenes-snac2-2921dbe0581e96e0f1067cae6aa665dfd5cbc9d6.tar.gz
penes-snac2-2921dbe0581e96e0f1067cae6aa665dfd5cbc9d6.tar.xz
penes-snac2-2921dbe0581e96e0f1067cae6aa665dfd5cbc9d6.zip
Always make ids unique.
-rw-r--r--activitypub.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/activitypub.c b/activitypub.c
index 5e020b1..aab81a9 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -347,6 +347,7 @@ d_char *msg_base(snac *snac, char *type, char *id, char *actor, char *date, char
347{ 347{
348 xs *did = NULL; 348 xs *did = NULL;
349 xs *published = NULL; 349 xs *published = NULL;
350 xs *ntid = tid(0);
350 351
351 /* generated values */ 352 /* generated values */
352 if (date && strcmp(date, "@now") == 0) { 353 if (date && strcmp(date, "@now") == 0) {
@@ -356,7 +357,6 @@ d_char *msg_base(snac *snac, char *type, char *id, char *actor, char *date, char
356 357
357 if (id != NULL) { 358 if (id != NULL) {
358 if (strcmp(id, "@dummy") == 0) { 359 if (strcmp(id, "@dummy") == 0) {
359 xs *ntid = tid(0);
360 did = xs_fmt("%s/d/%s/%s", snac->actor, ntid, type); 360 did = xs_fmt("%s/d/%s/%s", snac->actor, ntid, type);
361 361
362 id = did; 362 id = did;
@@ -364,7 +364,7 @@ d_char *msg_base(snac *snac, char *type, char *id, char *actor, char *date, char
364 else 364 else
365 if (strcmp(id, "@object") == 0) { 365 if (strcmp(id, "@object") == 0) {
366 if (object != NULL) { 366 if (object != NULL) {
367 did = xs_fmt("%s/%s", xs_dict_get(object, "id"), type); 367 did = xs_fmt("%s/%s_%s", xs_dict_get(object, "id"), type, ntid);
368 id = did; 368 id = did;
369 } 369 }
370 else 370 else