summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge/TwitterBridgePlugin.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-09-04 23:52:26 -0400
committerEvan Prodromou <evan@status.net>2010-09-07 04:00:58 -0400
commit6c7262c8ca9f0895584ef5b73fddafb3182582a2 (patch)
treee5b9d0f7f15c70e73e4e97aa59146d0991393efe /plugins/TwitterBridge/TwitterBridgePlugin.php
parente9e06879bb067fd2049c6b4829e9881966a03968 (diff)
Delete Notice_to_status when a notice is deleted
Diffstat (limited to 'plugins/TwitterBridge/TwitterBridgePlugin.php')
-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;
+ }
}