Przeglądaj źródła

Fixed unpinning indexing.

default 3 lat temu
rodzic
commit
afebf086e7
1 zmienionych plików z 9 dodań i 1 usunięć
  1. 9 1
      data.c

+ 9 - 1
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;
 }