]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
hide notice form if not able to post
authorEvan Prodromou <evan@status.net>
Thu, 7 Oct 2010 14:32:29 +0000 (10:32 -0400)
committerEvan Prodromou <evan@status.net>
Thu, 7 Oct 2010 14:32:29 +0000 (10:32 -0400)
plugins/RequireValidatedEmail/RequireValidatedEmailPlugin.php

index a7d7874f1fb7107e1ff45adb4ee85a647dc85761..6c0ef37d519b4f44d5d4b0636069ec6964fbe71e 100644 (file)
@@ -216,4 +216,23 @@ class RequireValidatedEmailPlugin extends Plugin
                 _m('Disables posting without a validated email address.'));
         return true;
     }
+
+    /**
+     * Hide the notice form if the user isn't able to post.
+     *
+     * @param Action $action action being shown
+     *
+     * @return boolean hook value
+     */
+
+    function onStartShowNoticeForm($action)
+    {
+        $user = common_current_user();
+        if (!empty($user)) { // it's a remote notice
+            if (!$this->validated($user)) {
+                return false;
+            }
+        }
+        return true;
+    }
 }