mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 06:25:04 +00:00
Always make ids unique.
This commit is contained in:
parent
4aabc7a0b5
commit
2921dbe058
1 changed files with 2 additions and 2 deletions
|
@ -347,6 +347,7 @@ d_char *msg_base(snac *snac, char *type, char *id, char *actor, char *date, char
|
||||||
{
|
{
|
||||||
xs *did = NULL;
|
xs *did = NULL;
|
||||||
xs *published = NULL;
|
xs *published = NULL;
|
||||||
|
xs *ntid = tid(0);
|
||||||
|
|
||||||
/* generated values */
|
/* generated values */
|
||||||
if (date && strcmp(date, "@now") == 0) {
|
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 (id != NULL) {
|
||||||
if (strcmp(id, "@dummy") == 0) {
|
if (strcmp(id, "@dummy") == 0) {
|
||||||
xs *ntid = tid(0);
|
|
||||||
did = xs_fmt("%s/d/%s/%s", snac->actor, ntid, type);
|
did = xs_fmt("%s/d/%s/%s", snac->actor, ntid, type);
|
||||||
|
|
||||||
id = did;
|
id = did;
|
||||||
|
@ -364,7 +364,7 @@ d_char *msg_base(snac *snac, char *type, char *id, char *actor, char *date, char
|
||||||
else
|
else
|
||||||
if (strcmp(id, "@object") == 0) {
|
if (strcmp(id, "@object") == 0) {
|
||||||
if (object != NULL) {
|
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;
|
id = did;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue