summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-11-24 08:18:51 +0100
committerdefault <nobody@localhost>2022-11-24 08:18:51 +0100
commit42449d9cadbbb2497e89b24ac277d2e22f46f184 (patch)
treec9dc51a88ae9fb0a34d3b6f1b05318e25cfa7cbb /data.c
parentecea10e11c00ac6a27954d7e8ed595e92ba69031 (diff)
Also check for a non-empty in_reply_to in object_add().
Diffstat (limited to 'data.c')
-rw-r--r--data.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/data.c b/data.c
index f5bd131..409055a 100644
--- a/data.c
+++ b/data.c
@@ -399,7 +399,7 @@ int object_add(const char *id, d_char *obj)
/* does this object has a parent? */
char *in_reply_to = xs_dict_get(obj, "inReplyTo");
- if (!xs_is_null(in_reply_to)) {
+ if (!xs_is_null(in_reply_to) && *in_reply_to) {
/* update the children index of the parent */
xs *pfn = _object_fn(in_reply_to);
@@ -412,7 +412,7 @@ int object_add(const char *id, d_char *obj)
else
status = 500;
- srv_debug(2, xs_fmt("object_add %s %s %d", id, fn, status));
+ srv_debug(0, xs_fmt("object_add %s %s %d", id, fn, status));
return status;
}
@@ -844,8 +844,10 @@ int timeline_add(snac *snac, char *id, char *o_msg, char *parent, char *referrer
msg = xs_dict_set(msg, "_snac", md);
- if ((ret = _timeline_write(snac, id, msg, parent, referrer)))
+ if ((ret = _timeline_write(snac, id, msg, parent, referrer))) {
snac_debug(snac, 1, xs_fmt("timeline_add %s", id));
+ object_add(id, o_msg);
+ }
return ret;
}