summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-09-04 23:52:26 -0400
committerEvan Prodromou <evan@status.net>2010-09-04 23:52:26 -0400
commit3e8569d99f6283ba5cdf52d4f58e616ef1e2dd4a (patch)
treeb0f0fb85efb805db44ca07f58eb514c1f442da28
parentb2bcbf4a777c1fa7af91df6041296d5814b585b2 (diff)
Delete Notice_to_status when a notice is deleted
-rw-r--r--plugins/TwitterBridge/TwitterBridgePlugin.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/TwitterBridge/TwitterBridgePlugin.php b/plugins/TwitterBridge/TwitterBridgePlugin.php
index 5676025c2..b0f99c179 100644
--- a/plugins/TwitterBridge/TwitterBridgePlugin.php
+++ b/plugins/TwitterBridge/TwitterBridgePlugin.php
@@ -411,4 +411,21 @@ class TwitterBridgePlugin extends Plugin
return true;
}
+
+ /**
+ * If a notice gets deleted, remove the Notice_to_status mapping
+ *
+ * @param Notice $notice The notice getting deleted
+ *
+ * @return boolean hook value
+ */
+
+ function onNoticeDeleteRelated($notice)
+ {
+ $n2s = Notice_to_status::staticGet('notice_id', $notice->id);
+ if (!empty($n2s)) {
+ $n2s->delete();
+ }
+ return true;
+ }
}