diff options
author | Evan Prodromou <evan@status.net> | 2010-09-04 23:52:26 -0400 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-09-07 04:00:58 -0400 |
commit | 6c7262c8ca9f0895584ef5b73fddafb3182582a2 (patch) | |
tree | e5b9d0f7f15c70e73e4e97aa59146d0991393efe /plugins/TwitterBridge/TwitterBridgePlugin.php | |
parent | e9e06879bb067fd2049c6b4829e9881966a03968 (diff) |
Delete Notice_to_status when a notice is deleted
Diffstat (limited to 'plugins/TwitterBridge/TwitterBridgePlugin.php')
-rw-r--r-- | plugins/TwitterBridge/TwitterBridgePlugin.php | 17 |
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; + } } |