Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x

Conflicts:
	lib/stompqueuemanager.php
This commit is contained in:
Evan Prodromou 2010-01-24 16:12:40 -05:00
commit 4f213f985f
6 changed files with 38 additions and 17 deletions

View File

@ -115,11 +115,11 @@ class ApiAccountUpdateProfileAction extends ApiAuthAction
$original = clone($profile);
if (empty($this->name)) {
if (!empty($this->name)) {
$profile->fullname = $this->name;
}
if (empty($this->url)) {
if (!empty($this->url)) {
$profile->homepage = $this->url;
}

View File

@ -102,7 +102,7 @@ abstract class IoMaster
*/
protected function instantiate($class)
{
if (isset($this->singletons[$class])) {
if (is_string($class) && isset($this->singletons[$class])) {
// Already instantiated a multi-site-capable handler.
// Just let it know it should listen to this site too!
$this->singletons[$class]->addSite(common_config('site', 'server'));
@ -129,7 +129,11 @@ abstract class IoMaster
protected function getManager($class)
{
return call_user_func(array($class, 'get'));
if(is_object($class)){
return $class;
} else {
return call_user_func(array($class, 'get'));
}
}
/**
@ -347,7 +351,7 @@ abstract class IoMaster
* for per-queue and per-site records.
*
* @param string $key counter name
* @param array $owners list of owner keys like 'queue:jabber' or 'site:stat01'
* @param array $owners list of owner keys like 'queue:xmpp' or 'site:stat01'
*/
public function stats($key, $owners=array())
{

View File

@ -181,7 +181,9 @@ abstract class QueueManager extends IoManager
{
if (isset($this->handlers[$queue])) {
$class = $this->handlers[$queue];
if (class_exists($class)) {
if(is_object($class)) {
return $class;
} else if (class_exists($class)) {
return new $class();
} else {
common_log(LOG_ERR, "Nonexistent handler class '$class' for queue '$queue'");
@ -242,7 +244,7 @@ abstract class QueueManager extends IoManager
* Only registered transports will be reliably picked up!
*
* @param string $transport
* @param string $class
* @param string $class class name or object instance
* @param string $group
*/
public function connect($transport, $class, $group='queuedaemon')

View File

@ -86,7 +86,7 @@ class ImapPlugin extends Plugin
}
}
function onStartIoManagerClasses(&$classes)
function onStartQueueDaemonIoManagers(&$classes)
{
$classes[] = new ImapManager($this);
}

View File

@ -414,7 +414,15 @@ class MobileProfilePlugin extends WAP20Plugin
return $proto.'://'.$serverpart.'/'.$pathpart.$relative;
}
function onPluginVersion(&$versions)
{
$versions[] = array('name' => 'MobileProfile',
'version' => STATUSNET_VERSION,
'author' => 'Sarven Capadisli',
'homepage' => 'http://status.net/wiki/Plugin:MobileProfile',
'rawdescription' =>
_m('XHTML MobileProfile output for supporting user agents.'));
return true;
}
}
?>

View File

@ -211,13 +211,20 @@ class PubSubHubBubPlugin extends Plugin
'format' => 'atom'));
}
}
$feeds = array_unique($feeds);
foreach (array_unique($feeds) as $feed) {
if (!$publisher->publish_update($feed)) {
common_log_line(LOG_WARNING,
$feed.' was not published to hub at '.
$this->hub.':'.$publisher->last_response());
}
ob_start();
$ok = $publisher->publish_update($feeds);
$push_last_response = ob_get_clean();
if (!$ok) {
common_log(LOG_WARNING,
'Failure publishing ' . count($feeds) . ' feeds to hub at '.
$this->hub.': '.$push_last_response);
} else {
common_log(LOG_INFO,
'Published ' . count($feeds) . ' feeds to hub at '.
$this->hub.': '.$push_last_response);
}
return true;