summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBrion Vibber <brion@status.net>2010-01-15 11:13:06 -0800
committerBrion Vibber <brion@status.net>2010-01-15 11:13:06 -0800
commit598072468c9fdb07df2cda9da207f123b14566ae (patch)
tree9846456771d776a0ec29ccc68ea8325dd44968a0 /lib
parent963260d2628cdaccd330c47761ebbf972193f15e (diff)
--xmpp-only hack for queuedaemon.php to run separate queue daemon with only xmpp threads
Diffstat (limited to 'lib')
-rw-r--r--lib/queuemanager.php22
-rw-r--r--lib/stompqueuemanager.php7
2 files changed, 20 insertions, 9 deletions
diff --git a/lib/queuemanager.php b/lib/queuemanager.php
index b98e57a1f..291174d3c 100644
--- a/lib/queuemanager.php
+++ b/lib/queuemanager.php
@@ -149,11 +149,13 @@ abstract class QueueManager extends IoManager
function initialize()
{
if (Event::handle('StartInitializeQueueManager', array($this))) {
- $this->connect('plugin', 'PluginQueueHandler');
- $this->connect('omb', 'OmbQueueHandler');
- $this->connect('ping', 'PingQueueHandler');
- if (common_config('sms', 'enabled')) {
- $this->connect('sms', 'SmsQueueHandler');
+ if (!defined('XMPP_ONLY_FLAG')) { // hack!
+ $this->connect('plugin', 'PluginQueueHandler');
+ $this->connect('omb', 'OmbQueueHandler');
+ $this->connect('ping', 'PingQueueHandler');
+ if (common_config('sms', 'enabled')) {
+ $this->connect('sms', 'SmsQueueHandler');
+ }
}
// XMPP output handlers...
@@ -165,10 +167,14 @@ abstract class QueueManager extends IoManager
$this->connect('confirm', 'XmppConfirmHandler');
}
- // For compat with old plugins not registering their own handlers.
- $this->connect('plugin', 'PluginQueueHandler');
+ if (!defined('XMPP_ONLY_FLAG')) { // hack!
+ // For compat with old plugins not registering their own handlers.
+ $this->connect('plugin', 'PluginQueueHandler');
+ }
+ }
+ if (!defined('XMPP_ONLY_FLAG')) { // hack!
+ Event::handle('EndInitializeQueueManager', array($this));
}
- Event::handle('EndInitializeQueueManager', array($this));
}
/**
diff --git a/lib/stompqueuemanager.php b/lib/stompqueuemanager.php
index a7d735d1c..00590fdb6 100644
--- a/lib/stompqueuemanager.php
+++ b/lib/stompqueuemanager.php
@@ -104,7 +104,12 @@ class StompQueueManager extends QueueManager
*/
function getQueues()
{
- return array_keys($this->handlers[common_config('site', 'server')]);
+ $site = common_config('site', 'server');
+ if (empty($this->handlers[$site])) {
+ return array();
+ } else {
+ return array_keys($this->handlers[$site]);
+ }
}
/**