summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-08-14 11:54:20 -0700
committerEvan Prodromou <evan@status.net>2010-08-14 11:54:20 -0700
commit6d89aa09317719dd4f682f75a10e8e9b50132b5c (patch)
treebe0521856536bf14205f4c53924a80e21e43fe2a
parent9e4f40806a2fc4769a4dcc37d1ff337a1d02d8d4 (diff)
on deleting a notice
-rw-r--r--EVENTS.txt2
-rw-r--r--classes/Notice.php19
2 files changed, 13 insertions, 8 deletions
diff --git a/EVENTS.txt b/EVENTS.txt
index bc3e0ea90..1a3b2594a 100644
--- a/EVENTS.txt
+++ b/EVENTS.txt
@@ -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
diff --git a/classes/Notice.php b/classes/Notice.php
index 0eeebfadf..686dfc031 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -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();