default пре 3 година
родитељ
комит
afebf086e7
1 измењених фајлова са 9 додато и 1 уклоњено
  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;
 }