]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/ActivityModeration/ActivityModerationPlugin.php
fix a link of doc/twitterapi
[quix0rs-gnu-social.git] / plugins / ActivityModeration / ActivityModerationPlugin.php
index c7a24ba991beaceba3fae7641a59de107f8d62c4..208a05449df1eb4d3797c3b8413291783b7e23b5 100644 (file)
@@ -34,6 +34,30 @@ class ActivityModerationPlugin extends ActivityVerbHandlerPlugin
         return true;
     }
 
+    public function onGetNoticeSqlTimestamp($id, &$timestamp)
+    {
+        try {
+            $deleted = Deleted_notice::getByID($id);
+            $timestamp = $deleted->act_created;
+        } catch (NoResultException $e) {
+            return true;
+        }
+        // we're done for the event, so return false to stop it
+        return false;
+    }
+
+    public function onIsNoticeDeleted($id, &$deleted)
+    {
+        try {
+            $found = Deleted_notice::getByID($id);
+            $deleted = ($found instanceof Deleted_notice);
+        } catch (NoResultException $e) {
+            $deleted = false;
+        }
+        // return true (continue event) if $deleted is false, return false (stop event) if deleted notice was found
+        return !$deleted;
+    }
+
     protected function getActionTitle(ManagedAction $action, $verb, Notice $target, Profile $scoped)
     {
         // FIXME: switch based on action type
@@ -144,8 +168,6 @@ class ActivityModerationPlugin extends ActivityVerbHandlerPlugin
         foreach($props as $prop) {
             $stored->$prop = $target->$prop;
         }
-        //$stored->content = $stored->content ?: _('Notice deleted.');
-        //$stored->rendered = $stored->rendered ?: $stored->rendered;
 
         // Let's see if this has been deleted already.
         try {