]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Controller/PocketController.php
Moved Pocket token to user config
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Controller / PocketController.php
index a2dcd8a7f0ff5df767197780e03b73f3c84feeea..56be5cbfd8e56215f5b5a5bc22e063922ee0e221 100644 (file)
@@ -20,8 +20,10 @@ class PocketController extends Controller
         $pocket = $this->get('wallabag_import.pocket.import');
         $pocket->setUser($this->getUser());
 
-        if ($this->get('craue_config')->get('rabbitmq')) {
-            $pocket->setRabbitmqProducer($this->get('old_sound_rabbit_mq.wallabag_pocket_producer'));
+        if ($this->get('craue_config')->get('import_with_rabbitmq')) {
+            $pocket->setProducer($this->get('old_sound_rabbit_mq.import_pocket_producer'));
+        } elseif ($this->get('craue_config')->get('import_with_redis')) {
+            $pocket->setProducer($this->get('wallabag_import.producer.redis.pocket'));
         }
 
         return $pocket;
@@ -42,7 +44,7 @@ class PocketController extends Controller
 
         return $this->render('WallabagImportBundle:Pocket:index.html.twig', [
             'import' => $this->getPocketImportService(),
-            'has_consumer_key' => '' == trim($this->get('craue_config')->get('pocket_consumer_key')) ? false : true,
+            'has_consumer_key' => '' === trim($this->getUser()->getConfig()->getPocketConsumerKey()) ? false : true,
             'form' => $form->createView(),
         ]);
     }
@@ -100,6 +102,12 @@ class PocketController extends Controller
                 '%imported%' => $summary['imported'],
                 '%skipped%' => $summary['skipped'],
             ]);
+
+            if (0 < $summary['queued']) {
+                $message = $this->get('translator')->trans('flashes.import.notice.summary_with_queue', [
+                    '%queued%' => $summary['queued'],
+                ]);
+            }
         }
 
         $this->get('session')->getFlashBag()->add(