From: Evan Prodromou Date: Sun, 5 Sep 2010 03:52:26 +0000 (-0400) Subject: Delete Notice_to_status when a notice is deleted X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3e8569d99f6283ba5cdf52d4f58e616ef1e2dd4a;p=quix0rs-gnu-social.git Delete Notice_to_status when a notice is deleted --- diff --git a/plugins/TwitterBridge/TwitterBridgePlugin.php b/plugins/TwitterBridge/TwitterBridgePlugin.php index 5676025c22..b0f99c1798 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; + } }