Fixed unpinning indexing.

This commit is contained in:
default 2023-06-28 21:47:00 +02:00
parent 4b1f060be8
commit afebf086e7

10
data.c
View file

@ -1388,7 +1388,15 @@ int pin(snac *user, const char *id)
int unpin(snac *user, const char *id)
/* unpin a message */
{
return object_user_cache_del(user, id, "pinned");
int ret = object_user_cache_del(user, id, "pinned");
if (ret != -1) {
/* delete from the index */
xs *idx = xs_fmt("%s/pinned.idx", user->basedir);
index_del(idx, id);
}
return ret;
}