]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/FacebookSSO/FacebookSSOPlugin.php
- Still send notices to Facebook from existing Facebook app users
[quix0rs-gnu-social.git] / plugins / FacebookSSO / FacebookSSOPlugin.php
index a726b2facc46d33cde843b73f649be55755f8c32..a094f2957fff4b0ffa24c94788048352cc5f8d20 100644 (file)
@@ -131,7 +131,7 @@ class FacebookSSOPlugin extends Plugin
             include_once $dir . '/actions/' . strtolower(mb_substr($cls, 0, -6)) . '.php';
             return false;
         case 'Facebookclient':
-        case 'Facebookqueuehandler':
+        case 'FacebookQueueHandler':
             include_once $dir . '/lib/' . strtolower($cls) . '.php';
             return false;
         default:
@@ -146,7 +146,7 @@ class FacebookSSOPlugin extends Plugin
     function needsScripts($action)
     {
         static $needy = array(
-            //'FacebookloginAction',
+            'FacebookloginAction',
             'FacebookfinishloginAction',
             'FacebookadminpanelAction',
             'FacebooksettingsAction'
@@ -401,6 +401,37 @@ ENDOFSCRIPT;
         return true;
     }
 
+    /**
+     * Add a Facebook queue item for each notice
+     *
+     * @param Notice $notice      the notice
+     * @param array  &$transports the list of transports (queues)
+     *
+     * @return boolean hook return
+     */
+    function onStartEnqueueNotice($notice, &$transports)
+    {
+        if (self::hasApplication() && $notice->isLocal()) {
+            array_push($transports, 'facebook');
+        }
+        return true;
+    }
+
+    /**
+     * Register Facebook notice queue handler
+     *
+     * @param QueueManager $manager
+     *
+     * @return boolean hook return
+     */
+    function onEndInitializeQueueManager($manager)
+    {
+        if (self::hasApplication()) {
+            $manager->connect('facebook', 'FacebookQueueHandler');
+        }
+        return true;
+    }
+
     /*
      * Add version info for this plugin
      *