]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
on deleting a notice
authorEvan Prodromou <evan@status.net>
Sat, 14 Aug 2010 18:54:20 +0000 (11:54 -0700)
committerEvan Prodromou <evan@status.net>
Sat, 14 Aug 2010 18:54:20 +0000 (11:54 -0700)
EVENTS.txt
classes/Notice.php

index bc3e0ea90fba33ae25220011442dca02024e4a0d..1a3b2594a2efe55ef5be80810e1321c76385ee99 100644 (file)
@@ -1064,3 +1064,5 @@ EndRssEntryArray: at the end of copying a notice to an array
 - $notice: the notice being copied
 - &$entry: the entry, with all the fields filled up
 
+NoticeDeleteRelated: at the beginning of deleting related fields to a notice
+- $notice: notice being deleted
index 0eeebfadf374aa7e61c89ca7f56f524f77b15bcb..686dfc031eabbcfdcf60492d180009358b4049d0 100644 (file)
@@ -121,16 +121,19 @@ class Notice extends Memcached_DataObject
             $deleted->insert();
         }
 
-        // Clear related records
+        if (Event::handle('NoticeDeleteRelated', array($this))) {
 
-        $this->clearReplies();
-        $this->clearRepeats();
-        $this->clearFaves();
-        $this->clearTags();
-        $this->clearGroupInboxes();
+            // Clear related records
 
-        // NOTE: we don't clear inboxes
-        // NOTE: we don't clear queue items
+            $this->clearReplies();
+            $this->clearRepeats();
+            $this->clearFaves();
+            $this->clearTags();
+            $this->clearGroupInboxes();
+
+            // NOTE: we don't clear inboxes
+            // NOTE: we don't clear queue items
+        }
 
         $result = parent::delete();