mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-25 16:53:37 +00:00
Also check for a non-empty in_reply_to in object_add().
This commit is contained in:
parent
ecea10e11c
commit
42449d9cad
1 changed files with 5 additions and 3 deletions
8
data.c
8
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue