]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php
Merge branch '1.0.x' into testing
[quix0rs-gnu-social.git] / plugins / SubscriptionThrottle / SubscriptionThrottlePlugin.php
index e898ce9ae0a376d592c8e5ae4d3a369d4b16d535..829219af207c8d6d9d08e41abd865699433d986e 100644 (file)
@@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
  * @link      http://status.net/
  */
-
 class SubscriptionThrottlePlugin extends Plugin
 {
     public $subLimits = array(86400 => 100,
@@ -61,7 +60,6 @@ class SubscriptionThrottlePlugin extends Plugin
      *
      * @return boolean hook value
      */
-
     function onStartSubscribe($user, $other)
     {
         foreach ($this->subLimits as $seconds => $limit) {
@@ -71,7 +69,8 @@ class SubscriptionThrottlePlugin extends Plugin
                 $subtime = strtotime($sub->created);
                 $now     = time();
                 if ($now - $subtime < $seconds) {
-                    throw new Exception(_m("Too many subscriptions. Take a break and try again later."));
+                    // TRANS: Exception thrown when subscribing too quickly.
+                    throw new Exception(_m('Too many subscriptions. Take a break and try again later.'));
                 }
             }
         }
@@ -87,7 +86,6 @@ class SubscriptionThrottlePlugin extends Plugin
      *
      * @return boolean hook value
      */
-
     function onStartJoinGroup($group, $user)
     {
         foreach ($this->groupLimits as $seconds => $limit) {
@@ -97,7 +95,8 @@ class SubscriptionThrottlePlugin extends Plugin
                 $jointime = strtotime($mem->created);
                 $now      = time();
                 if ($now - $jointime < $seconds) {
-                    throw new Exception(_m("Too many memberships. Take a break and try again later."));
+                    // TRANS: Exception thrown when joing groups too quickly.
+                    throw new Exception(_m('Too many memberships. Take a break and try again later.'));
                 }
             }
         }
@@ -113,7 +112,6 @@ class SubscriptionThrottlePlugin extends Plugin
      *
      * @return Subscription a subscription or null
      */
-
     private function _getNthSub($user, $n)
     {
         $sub = new Subscription();
@@ -137,7 +135,6 @@ class SubscriptionThrottlePlugin extends Plugin
      *
      * @return Group_member a membership or null
      */
-
     private function _getNthMem($user, $n)
     {
         $mem = new Group_member();
@@ -160,7 +157,6 @@ class SubscriptionThrottlePlugin extends Plugin
      *
      * @return boolean hook value
      */
-
     function onPluginVersion(&$versions)
     {
         $versions[] = array('name' => 'SubscriptionThrottle',
@@ -168,8 +164,8 @@ class SubscriptionThrottlePlugin extends Plugin
                             'author' => 'Evan Prodromou',
                             'homepage' => 'http://status.net/wiki/Plugin:SubscriptionThrottle',
                             'rawdescription' =>
+                            // TRANS: Plugin description.
                             _m('Configurable limits for subscriptions and group memberships.'));
         return true;
     }
 }
-