Commit da34de74 authored by Brion Vibber's avatar Brion Vibber

Merge branch 'testing'

parents 63a0e84a d13d73c5
......@@ -291,23 +291,6 @@ class ProfileNoticeListItem extends NoticeListItem
$this->out->elementStart('span', 'repeat');
$this->out->elementStart('a', $attrs);
$avatar = $this->profile->getAvatar(AVATAR_MINI_SIZE);
$this->out->element('img', array('src' => ($avatar) ?
$avatar->displayUrl() :
Avatar::defaultImage(AVATAR_MINI_SIZE),
'class' => 'avatar photo',
'width' => AVATAR_MINI_SIZE,
'height' => AVATAR_MINI_SIZE,
'alt' =>
($this->profile->fullname) ?
$this->profile->fullname :
$this->profile->nickname));
$this->out->elementEnd('a');
$text_link = XMLStringer::estring('a', $attrs, $this->profile->nickname);
$this->out->raw(sprintf(_('Repeat of %s'), $text_link));
......
......@@ -326,13 +326,7 @@ class Notice extends Memcached_DataObject
# XXX: someone clever could prepend instead of clearing the cache
$notice->blowOnInsert();
if (common_config('queue', 'inboxes')) {
$qm = QueueManager::get();
$qm->enqueue($notice, 'distrib');
} else {
$handler = new DistribQueueHandler();
$handler->handle($notice);
}
$notice->distribute();
return $notice;
}
......@@ -1447,4 +1441,31 @@ class Notice extends Memcached_DataObject
$gi->free();
}
function distribute()
{
if (common_config('queue', 'inboxes')) {
// If there's a failure, we want to _force_
// distribution at this point.
try {
$qm = QueueManager::get();
$qm->enqueue($this, 'distrib');
} catch (Exception $e) {
// If the exception isn't transient, this
// may throw more exceptions as DQH does
// its own enqueueing. So, we ignore them!
try {
$handler = new DistribQueueHandler();
$handler->handle($this);
} catch (Exception $e) {
common_log(LOG_ERR, "emergency redistribution resulted in " . $e->getMessage());
}
// Re-throw so somebody smarter can handle it.
throw $e;
}
} else {
$handler = new DistribQueueHandler();
$handler->handle($this);
}
}
}
......@@ -168,8 +168,6 @@ class ApplicationEditForm extends Form
$this->access_type = '';
}
$this->out->hidden('token', common_session_token());
$this->out->elementStart('ul', 'form_data');
$this->out->elementStart('li', array('id' => 'application_icon'));
......
......@@ -115,6 +115,10 @@ function __autoload($cls)
require_once 'Validate.php';
require_once 'markdown.php';
// XXX: other formats here
define('NICKNAME_FMT', VALIDATE_NUM.VALIDATE_ALPHA_LOWER);
require_once INSTALLDIR.'/lib/util.php';
require_once INSTALLDIR.'/lib/action.php';
require_once INSTALLDIR.'/lib/mail.php';
......@@ -136,6 +140,3 @@ try {
exit;
}
// XXX: other formats here
define('NICKNAME_FMT', VALIDATE_NUM.VALIDATE_ALPHA_LOWER);
......@@ -85,6 +85,7 @@ $default =
'stomp_username' => null,
'stomp_password' => null,
'stomp_persistent' => true, // keep items across queue server restart, if persistence is enabled
'stomp_manual_failover' => true, // if multiple servers are listed, treat them as separate (enqueue on one randomly, listen on all)
'monitor' => null, // URL to monitor ping endpoint (work in progress)
'softlimit' => '90%', // total size or % of memory_limit at which to restart queue threads gracefully
'debug_memory' => false, // true to spit memory usage to log
......
......@@ -33,6 +33,22 @@ class LiberalStomp extends Stomp
return $this->_socket;
}
/**
* Return the host we're currently connected to.
*
* @return string
*/
function getServer()
{
$idx = $this->_currentHost;
if ($idx >= 0) {
$host = $this->_hosts[$idx];
return "$host[0]:$host[1]";
} else {
return '[unconnected]';
}
}
/**
* Make socket connection to the server
* We also set the stream to non-blocking mode, since we'll be
......@@ -71,10 +87,12 @@ class LiberalStomp extends Stomp
// @fixme this sometimes hangs in blocking mode...
// shouldn't we have been idle until we found there's more data?
$read = fread($this->_socket, $rb);
if ($read === false) {
$this->_reconnect();
if ($read === false || ($read === '' && feof($this->_socket))) {
// @fixme possibly attempt an auto reconnect as old code?
throw new StompException("Error reading");
//$this->_reconnect();
// @fixme this will lose prior items
return $this->readFrames();
//return $this->readFrames();
}
$data .= $read;
if (strpos($data, "\x00") !== false) {
......
......@@ -555,11 +555,8 @@ class NoticeListItem extends Widget
$this->out->raw(_('Repeated by'));
$avatar = $repeater->getAvatar(AVATAR_MINI_SIZE);
$this->out->elementStart('a', $attrs);
$this->out->element('span', 'nickname', $repeater->nickname);
$this->out->element('span', 'fn nickname', $repeater->nickname);
$this->out->elementEnd('a');
$this->out->elementEnd('span');
......
This diff is collapsed.
......@@ -89,7 +89,7 @@ class FacebookAction extends Action
function showScripts()
{
$this->script('facebookapp.js');
$this->script(common_path('plugins/Facebook/facebookapp.js'));
}
/**
......@@ -397,8 +397,6 @@ class FacebookAction extends Action
return;
}
}
}
......
......@@ -59,6 +59,8 @@ class MemcachePlugin extends Plugin
public $persistent = null;
public $defaultExpiry = 86400; // 24h
/**
* Initialize the plugin
*
......@@ -110,6 +112,9 @@ class MemcachePlugin extends Plugin
function onStartCacheSet(&$key, &$value, &$flag, &$expiry, &$success)
{
$this->_ensureConn();
if ($expiry === null) {
$expiry = $this->defaultExpiry;
}
$success = $this->_conn->set($key, $value, $flag, $expiry);
Event::handle('EndCacheSet', array($key, $value, $flag,
$expiry));
......
......@@ -1127,8 +1127,17 @@ top:3px;
}
.dialogbox .submit_dialogbox {
text-indent:0;
font-weight:bold;
text-indent:0;
min-width:46px;
}
#wrap form.processing input.submit,
.entity_actions a.processing,
.dialogbox.processing .submit_dialogbox {
cursor:wait;
outline:none;
text-indent:-9999px;
}
.notice-options {
......
......@@ -196,11 +196,12 @@ background-color:transparent;
}
#wrap form.processing input.submit,
.entity_actions a.processing {
.entity_actions a.processing,
.dialogbox.processing .submit_dialogbox {
background:#FFFFFF url(../../base/images/icons/icon_processing.gif) no-repeat 47% 47%;
cursor:wait;
text-indent:-9999px;
outline:none;
}
.notice-options .form_repeat.processing {
background-image:none;
}
#content {
......
......@@ -196,11 +196,12 @@ background-color:transparent;
}
#wrap form.processing input.submit,
.entity_actions a.processing {
.entity_actions a.processing,
.dialogbox.processing .submit_dialogbox {
background:#FFFFFF url(../../base/images/icons/icon_processing.gif) no-repeat 47% 47%;
cursor:wait;
text-indent:-9999px;
outline:none;
}
.notice-options .form_repeat.processing {
background-image:none;
}
#content {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment