Stop dropping messages with hidden parents.

This commit is contained in:
default 2022-11-24 09:31:58 +01:00
parent 6acf906b64
commit ea94a479f1

11
data.c
View file

@ -696,22 +696,11 @@ int _timeline_write(snac *snac, char *id, char *msg, char *parent, char *referre
if (pfn != NULL && (f = fopen(pfn, "r")) != NULL) { if (pfn != NULL && (f = fopen(pfn, "r")) != NULL) {
xs *j; xs *j;
char *v;
j = xs_readall(f); j = xs_readall(f);
fclose(f); fclose(f);
p_msg = xs_json_loads(j); p_msg = xs_json_loads(j);
if ((v = xs_dict_get(p_msg, "_snac")) != NULL) {
/* is parent hidden? */
if ((v = xs_dict_get(v, "hidden")) && xs_type(v) == XSTYPE_TRUE) {
snac_debug(snac, 1,
xs_fmt("_timeline_write dropping due to hidden parent %s (%s)", id, parent));
return 0;
}
}
} }
} }