]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Don't enqueue into plugin or SMS queues when disabled (breaks unqueuehandler if SMS...
authorBrion Vibber <brion@pobox.com>
Mon, 1 Feb 2010 18:16:19 +0000 (10:16 -0800)
committerBrion Vibber <brion@pobox.com>
Mon, 1 Feb 2010 18:16:19 +0000 (10:16 -0800)
lib/util.php

index dd8189a5827b011bdaed1df5d27b31c3c943f4f1..f0f262dc5e032da708d85a84b6ade00ce07db749 100644 (file)
@@ -996,9 +996,14 @@ function common_enqueue_notice($notice)
     static $localTransports = array('omb',
                                     'ping');
 
-    static $allTransports = array('sms', 'plugin');
-
-    $transports = $allTransports;
+    $transports = array();
+    if (common_config('sms', 'enabled')) {
+        $transports[] = 'sms';
+    }
+    if (Event::hasHandler('HandleQueuedNotice')) {
+        $transports[] = 'plugin';
+    }
+    
 
     $xmpp = common_config('xmpp', 'enabled');
 
@@ -1006,6 +1011,7 @@ function common_enqueue_notice($notice)
         $transports[] = 'jabber';
     }
 
+    // @fixme move these checks into QueueManager and/or individual handlers
     if ($notice->is_local == Notice::LOCAL_PUBLIC ||
         $notice->is_local == Notice::LOCAL_NONPUBLIC) {
         $transports = array_merge($transports, $localTransports);