mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
New function timeline_update_indexes().
This commit is contained in:
parent
c0e3193529
commit
2c34ec8d6c
1 changed files with 5 additions and 5 deletions
10
data.c
10
data.c
|
@ -913,11 +913,9 @@ int _timeline_write(snac *snac, char *id, char *msg, char *parent, char *referre
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void timeline_object_add(snac *snac, const char *id, char *msg)
|
void timeline_update_indexes(snac *snac, const char *id)
|
||||||
/* adds an object and update the user indexes */
|
/* updates the indexes */
|
||||||
{
|
{
|
||||||
object_add(id, msg);
|
|
||||||
|
|
||||||
/* add to the private index */
|
/* add to the private index */
|
||||||
xs *idx = xs_fmt("%s/private.idx", snac->basedir);
|
xs *idx = xs_fmt("%s/private.idx", snac->basedir);
|
||||||
index_add(idx, id);
|
index_add(idx, id);
|
||||||
|
@ -969,7 +967,8 @@ int timeline_add(snac *snac, char *id, char *o_msg, char *parent, char *referrer
|
||||||
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));
|
snac_debug(snac, 1, xs_fmt("timeline_add %s", id));
|
||||||
|
|
||||||
timeline_object_add(snac, id, o_msg);
|
object_add(id, o_msg);
|
||||||
|
timeline_update_indexes(snac, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1024,6 +1023,7 @@ void timeline_admire(snac *snac, char *id, char *admirer, int like)
|
||||||
else
|
else
|
||||||
snac_log(snac, xs_fmt("timeline_admire ignored for unknown object %s", id));
|
snac_log(snac, xs_fmt("timeline_admire ignored for unknown object %s", id));
|
||||||
|
|
||||||
|
timeline_update_indexes(snac, id);
|
||||||
object_admire(id, admirer, like);
|
object_admire(id, admirer, like);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue