]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Delete Notice_to_status when a notice is deleted
authorEvan Prodromou <evan@status.net>
Sun, 5 Sep 2010 03:52:26 +0000 (23:52 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 7 Sep 2010 08:00:58 +0000 (04:00 -0400)
plugins/TwitterBridge/TwitterBridgePlugin.php

index 5676025c220f836cfbd797839b92b6812b3ed3b4..b0f99c17983a9637de7dac4347a0c243e960efbb 100644 (file)
@@ -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;
+    }
 }