commit 2921dbe

default  ·  2023-01-22 19:31:16 +0000 UTC
parent 4aabc7a
Always make ids unique.
1 files changed,  +2, -2
+2, -2
 1@@ -347,6 +347,7 @@ d_char *msg_base(snac *snac, char *type, char *id, char *actor, char *date, char
 2 {
 3     xs *did       = NULL;
 4     xs *published = NULL;
 5+    xs *ntid      = tid(0);
 6 
 7     /* generated values */
 8     if (date && strcmp(date, "@now") == 0) {
 9@@ -356,7 +357,6 @@ d_char *msg_base(snac *snac, char *type, char *id, char *actor, char *date, char
10 
11     if (id != NULL) {
12         if (strcmp(id, "@dummy") == 0) {
13-            xs *ntid = tid(0);
14             did = xs_fmt("%s/d/%s/%s", snac->actor, ntid, type);
15 
16             id = did;
17@@ -364,7 +364,7 @@ d_char *msg_base(snac *snac, char *type, char *id, char *actor, char *date, char
18         else
19         if (strcmp(id, "@object") == 0) {
20             if (object != NULL) {
21-                did = xs_fmt("%s/%s", xs_dict_get(object, "id"), type);
22+                did = xs_fmt("%s/%s_%s", xs_dict_get(object, "id"), type, ntid);
23                 id = did;
24             }
25             else