diff options
author | default <nobody@localhost> | 2023-01-22 20:31:16 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-01-22 20:31:16 +0100 |
commit | 2921dbe0581e96e0f1067cae6aa665dfd5cbc9d6 (patch) | |
tree | 9effdc43c344327b435204108193f8e1dad8c614 /activitypub.c | |
parent | 4aabc7a0b5eeac7a051bc8e93f45d0be2ff6c35b (diff) |
Always make ids unique.
Diffstat (limited to 'activitypub.c')
-rw-r--r-- | activitypub.c | 4 |
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 { xs *did = NULL; xs *published = NULL; + xs *ntid = tid(0); /* generated values */ 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 if (id != NULL) { if (strcmp(id, "@dummy") == 0) { - xs *ntid = tid(0); did = xs_fmt("%s/d/%s/%s", snac->actor, ntid, type); id = did; @@ -364,7 +364,7 @@ d_char *msg_base(snac *snac, char *type, char *id, char *actor, char *date, char else if (strcmp(id, "@object") == 0) { if (object != NULL) { - did = xs_fmt("%s/%s", xs_dict_get(object, "id"), type); + did = xs_fmt("%s/%s_%s", xs_dict_get(object, "id"), type, ntid); id = did; } else |