]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/File_to_post.php
Merge remote-tracking branch 'evan/blogplugin' into newblogplugin
[quix0rs-gnu-social.git] / classes / File_to_post.php
index 530921adcb05aacdf2422d20f108cb0069484eff..bcb6771f4f19077cdd265f2c3c61511f4af586e7 100644 (file)
@@ -52,6 +52,12 @@ class File_to_post extends Memcached_DataObject
                 $f2p->file_id = $file_id;
                 $f2p->post_id = $notice_id;
                 $f2p->insert();
+                
+                $f = File::staticGet($file_id);
+
+                if (!empty($f)) {
+                    $f->blowCache();
+                }
             }
 
             if (empty($seen[$notice_id])) {
@@ -66,4 +72,13 @@ class File_to_post extends Memcached_DataObject
     {
         return Memcached_DataObject::pkeyGet('File_to_post', $kv);
     }
+
+    function delete()
+    {
+        $f = File::staticGet('id', $this->file_id);
+        if (!empty($f)) {
+            $f->blowCache();
+        }
+        return parent::delete();
+    }
 }