summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-06-28 21:47:00 +0200
committerdefault <nobody@localhost>2023-06-28 21:47:00 +0200
commitafebf086e761dec552741b2c6930764780ce24ff (patch)
treeb59dc102846d2c78fe43ed5f6a2605664f422d68 /data.c
parent4b1f060be8dff81ed81c99a4c68de2e1b4727b62 (diff)
Fixed unpinning indexing.
Diffstat (limited to 'data.c')
-rw-r--r--data.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/data.c b/data.c
index e3275cb..9972865 100644
--- a/data.c
+++ b/data.c
@@ -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;
}