]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/actions/pushcallback.php
* i18n/L10n updates and FIXMEs added
[quix0rs-gnu-social.git] / plugins / OStatus / actions / pushcallback.php
index 9a2067b8ca0725e5b8ffa201add9bc4fedf4ba03..6c69787455df7dde3c2e88aa2aed66066eee7048 100644 (file)
@@ -37,7 +37,7 @@ class PushCallbackAction extends Action
             $this->handleGet();
         }
     }
-    
+
     /**
      * Handler for POST content updates from the hub
      */
@@ -46,11 +46,12 @@ class PushCallbackAction extends Action
         $feedid = $this->arg('feed');
         common_log(LOG_INFO, "POST for feed id $feedid");
         if (!$feedid) {
-            throw new ServerException('Empty or invalid feed id', 400);
+            throw new ServerException('Empty or invalid feed id.', 400);
         }
 
         $feedsub = FeedSub::staticGet('id', $feedid);
         if (!$feedsub) {
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
             throw new ServerException('Unknown PuSH feed id ' . $feedid, 400);
         }
 
@@ -70,7 +71,7 @@ class PushCallbackAction extends Action
         $qm = QueueManager::get();
         $qm->enqueue($data, 'pushin');
     }
-    
+
     /**
      * Handler for GET verification requests from the hub.
      */
@@ -88,20 +89,24 @@ class PushCallbackAction extends Action
 
         $feedsub = FeedSub::staticGet('uri', $topic);
         if (!$feedsub) {
-            throw new ClientException("Bad hub.topic feed $topic", 404);
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
+            throw new ClientException("Bad hub.topic feed $topic.", 404);
         }
 
         if ($feedsub->verify_token !== $verify_token) {
-            throw new ClientException("Bad hub.verify_token $token for $topic", 404);
+            // @todo i18n FIXME: added i18n and use sprintf when using parameters.
+            throw new ClientException("Bad hub.verify_token $token for $topic.", 404);
         }
 
         if ($mode == 'subscribe') {
             // We may get re-sub requests legitimately.
             if ($feedsub->sub_state != 'subscribe' && $feedsub->sub_state != 'active') {
+                // @todo i18n FIXME: added i18n and use sprintf when using parameters.
                 throw new ClientException("Unexpected subscribe request for $topic.", 404);
             }
         } else {
             if ($feedsub->sub_state != 'unsubscribe') {
+                // @todo i18n FIXME: added i18n and use sprintf when using parameters.
                 throw new ClientException("Unexpected unsubscribe request for $topic.", 404);
             }
         }