Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x
This commit is contained in:
commit
1b7d1d9a4a
@ -46,7 +46,6 @@ require_once INSTALLDIR . '/lib/apiauth.php';
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ApiconversationAction extends ApiAuthAction
|
class ApiconversationAction extends ApiAuthAction
|
||||||
{
|
{
|
||||||
protected $conversation = null;
|
protected $conversation = null;
|
||||||
@ -59,7 +58,6 @@ class ApiconversationAction extends ApiAuthAction
|
|||||||
*
|
*
|
||||||
* @return boolean true
|
* @return boolean true
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function prepare($argarray)
|
function prepare($argarray)
|
||||||
{
|
{
|
||||||
parent::prepare($argarray);
|
parent::prepare($argarray);
|
||||||
@ -67,13 +65,15 @@ class ApiconversationAction extends ApiAuthAction
|
|||||||
$convId = $this->trimmed('id');
|
$convId = $this->trimmed('id');
|
||||||
|
|
||||||
if (empty($convId)) {
|
if (empty($convId)) {
|
||||||
throw new ClientException(_m('no conversation id'));
|
// TRANS: Client exception thrown when no conversation ID is given.
|
||||||
|
throw new ClientException(_('No conversation ID.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->conversation = Conversation::staticGet('id', $convId);
|
$this->conversation = Conversation::staticGet('id', $convId);
|
||||||
|
|
||||||
if (empty($this->conversation)) {
|
if (empty($this->conversation)) {
|
||||||
throw new ClientException(sprintf(_m('No conversation with id %d'), $convId),
|
// TRANS: Client exception thrown when referring to a non-existing conversation ID (%d).
|
||||||
|
throw new ClientException(sprintf(_('No conversation with ID %d.'), $convId),
|
||||||
404);
|
404);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,12 +98,11 @@ class ApiconversationAction extends ApiAuthAction
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function handle($argarray=null)
|
function handle($argarray=null)
|
||||||
{
|
{
|
||||||
$sitename = common_config('site', 'name');
|
$sitename = common_config('site', 'name');
|
||||||
// TRANS: Timeline title for user and friends. %s is a user nickname.
|
// TRANS: Timeline title for user and friends. %s is a user nickname.
|
||||||
$title = _("Conversation");
|
$title = _m('TITLE', 'Conversation');
|
||||||
$id = common_local_url('apiconversation', array('id' => $this->conversation->id, 'format' => $this->format));
|
$id = common_local_url('apiconversation', array('id' => $this->conversation->id, 'format' => $this->format));
|
||||||
$link = common_local_url('conversation', array('id' => $this->conversation->id));
|
$link = common_local_url('conversation', array('id' => $this->conversation->id));
|
||||||
|
|
||||||
@ -168,7 +167,6 @@ class ApiconversationAction extends ApiAuthAction
|
|||||||
*
|
*
|
||||||
* @return boolean is read only action?
|
* @return boolean is read only action?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function isReadOnly($args)
|
function isReadOnly($args)
|
||||||
{
|
{
|
||||||
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
|
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
|
||||||
@ -202,7 +200,6 @@ class ApiconversationAction extends ApiAuthAction
|
|||||||
*
|
*
|
||||||
* @return string etag http header
|
* @return string etag http header
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function etag()
|
function etag()
|
||||||
{
|
{
|
||||||
if (!empty($this->notices) && (count($this->notices) > 0)) {
|
if (!empty($this->notices) && (count($this->notices) > 0)) {
|
||||||
@ -229,7 +226,6 @@ class ApiconversationAction extends ApiAuthAction
|
|||||||
*
|
*
|
||||||
* @return boolean true if delete, else false
|
* @return boolean true if delete, else false
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function requiresAuth()
|
function requiresAuth()
|
||||||
{
|
{
|
||||||
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
|
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
|
||||||
|
@ -125,7 +125,8 @@ class Memcached_DataObject extends Safe_DataObject
|
|||||||
if (count($toFetch) > 0) {
|
if (count($toFetch) > 0) {
|
||||||
$i = DB_DataObject::factory($cls);
|
$i = DB_DataObject::factory($cls);
|
||||||
if (empty($i)) {
|
if (empty($i)) {
|
||||||
throw new Exception(_('Cannot instantiate class ' . $cls));
|
// TRANS: Exception thrown when a class (%s) could not be instantiated.
|
||||||
|
throw new Exception(sprintf(_('Cannot instantiate class %s.'),$cls));
|
||||||
}
|
}
|
||||||
foreach ($otherCols as $otherKeyCol => $otherKeyVal) {
|
foreach ($otherCols as $otherKeyCol => $otherKeyVal) {
|
||||||
$i->$otherKeyCol = $otherKeyVal;
|
$i->$otherKeyCol = $otherKeyVal;
|
||||||
@ -175,7 +176,8 @@ class Memcached_DataObject extends Safe_DataObject
|
|||||||
if (count($toFetch) > 0) {
|
if (count($toFetch) > 0) {
|
||||||
$i = DB_DataObject::factory($cls);
|
$i = DB_DataObject::factory($cls);
|
||||||
if (empty($i)) {
|
if (empty($i)) {
|
||||||
throw new Exception(_('Cannot instantiate class ' . $cls));
|
// TRANS: Exception thrown when a class (%s) could not be instantiated.
|
||||||
|
throw new Exception(sprintf(_('Cannot instantiate class %s.'),$cls));
|
||||||
}
|
}
|
||||||
$i->whereAddIn($keyCol, $toFetch, $i->columnType($keyCol));
|
$i->whereAddIn($keyCol, $toFetch, $i->columnType($keyCol));
|
||||||
if ($i->find()) {
|
if ($i->find()) {
|
||||||
@ -212,7 +214,7 @@ class Memcached_DataObject extends Safe_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fixme Should this return false on lookup fail to match staticGet?
|
* @todo FIXME: Should this return false on lookup fail to match staticGet?
|
||||||
*/
|
*/
|
||||||
function pkeyGet($cls, $kv)
|
function pkeyGet($cls, $kv)
|
||||||
{
|
{
|
||||||
@ -562,7 +564,7 @@ class Memcached_DataObject extends Safe_DataObject
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (in_array($func, $ignoreStatic)) {
|
if (in_array($func, $ignoreStatic)) {
|
||||||
continue; // @fixme this shouldn't be needed?
|
continue; // @todo FIXME: This shouldn't be needed?
|
||||||
}
|
}
|
||||||
$here = get_class($frame['object']) . '->' . $func;
|
$here = get_class($frame['object']) . '->' . $func;
|
||||||
break;
|
break;
|
||||||
@ -705,7 +707,7 @@ class Memcached_DataObject extends Safe_DataObject
|
|||||||
|
|
||||||
if (!$dsn) {
|
if (!$dsn) {
|
||||||
// TRANS: Exception thrown when database name or Data Source Name could not be found.
|
// TRANS: Exception thrown when database name or Data Source Name could not be found.
|
||||||
throw new Exception(_("No database name or DSN found anywhere."));
|
throw new Exception(_('No database name or DSN found anywhere.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $dsn;
|
return $dsn;
|
||||||
|
@ -84,8 +84,10 @@ class GroupsNav extends MoreMenu
|
|||||||
function seeAllItem() {
|
function seeAllItem() {
|
||||||
return array('usergroups',
|
return array('usergroups',
|
||||||
array('nickname' => $this->user->nickname),
|
array('nickname' => $this->user->nickname),
|
||||||
|
// TRANS: Link description for seeing all groups.
|
||||||
_('See all'),
|
_('See all'),
|
||||||
_('See all groups you belong to'));
|
// TRANS: Link title for seeing all groups.
|
||||||
|
_('See all groups you belong to.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,9 @@ class ListsNav extends MoreMenu
|
|||||||
{
|
{
|
||||||
return array('peopletagsbyuser',
|
return array('peopletagsbyuser',
|
||||||
array('nickname' => $this->profile->nickname),
|
array('nickname' => $this->profile->nickname),
|
||||||
|
// TRANS: Link description for seeing all lists.
|
||||||
_('See all'),
|
_('See all'),
|
||||||
_('See all lists you have created'));
|
// TRANS: Link title for seeing all lists.
|
||||||
|
_('See all lists you have created.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class MoreMenu extends Menu
|
class MoreMenu extends Menu
|
||||||
{
|
{
|
||||||
const SOFT_MAX = 5;
|
const SOFT_MAX = 5;
|
||||||
@ -57,7 +56,6 @@ class MoreMenu extends Menu
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function show()
|
function show()
|
||||||
{
|
{
|
||||||
$items = $this->getItems();
|
$items = $this->getItems();
|
||||||
@ -72,7 +70,6 @@ class MoreMenu extends Menu
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Event::handle('StartNav', array($this, &$tag, &$items))) {
|
if (Event::handle('StartNav', array($this, &$tag, &$items))) {
|
||||||
|
|
||||||
$this->out->elementStart('ul', $attrs);
|
$this->out->elementStart('ul', $attrs);
|
||||||
|
|
||||||
$total = count($items);
|
$total = count($items);
|
||||||
@ -89,10 +86,10 @@ class MoreMenu extends Menu
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($total > self::SOFT_MAX + 1) {
|
if ($total > self::SOFT_MAX + 1) {
|
||||||
|
|
||||||
$this->out->elementStart('li', array('class' => 'more_link'));
|
$this->out->elementStart('li', array('class' => 'more_link'));
|
||||||
$this->out->element('a', array('href' => '#',
|
$this->out->element('a', array('href' => '#',
|
||||||
'onclick' => 'SN.U.showMoreMenuItems("'.$menuID.'"); return false;'),
|
'onclick' => 'SN.U.showMoreMenuItems("'.$menuID.'"); return false;'),
|
||||||
|
// TRANS: Link description to show more items in a list.
|
||||||
_('More ▼'));
|
_('More ▼'));
|
||||||
$this->out->elementEnd('li');
|
$this->out->elementEnd('li');
|
||||||
|
|
||||||
@ -123,5 +120,4 @@ class MoreMenu extends Menu
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -120,13 +120,15 @@ class BlogPlugin extends MicroAppPlugin
|
|||||||
'author' => 'Evan Prodromou',
|
'author' => 'Evan Prodromou',
|
||||||
'homepage' => 'http://status.net/wiki/Plugin:Blog',
|
'homepage' => 'http://status.net/wiki/Plugin:Blog',
|
||||||
'rawdescription' =>
|
'rawdescription' =>
|
||||||
|
// TRANS: Plugin description.
|
||||||
_m('Let users write and share long-form texts.'));
|
_m('Let users write and share long-form texts.'));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function appTitle()
|
function appTitle()
|
||||||
{
|
{
|
||||||
return _m('Blog');
|
// TRANS: Blog application title.
|
||||||
|
return _m('TITLE','Blog');
|
||||||
}
|
}
|
||||||
|
|
||||||
function tag()
|
function tag()
|
||||||
@ -149,7 +151,7 @@ class BlogPlugin extends MicroAppPlugin
|
|||||||
$entryObj = $activity->objects[0];
|
$entryObj = $activity->objects[0];
|
||||||
|
|
||||||
if ($entryObj->type != Blog_entry::TYPE) {
|
if ($entryObj->type != Blog_entry::TYPE) {
|
||||||
// TRANS: Exception thrown when blog plugin comes across a non-event type object.
|
// TRANS: Exception thrown when blog plugin comes across a non-blog entry type object.
|
||||||
throw new ClientException(_m('Wrong type for object.'));
|
throw new ClientException(_m('Wrong type for object.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +177,8 @@ class BlogPlugin extends MicroAppPlugin
|
|||||||
$entry = Blog_entry::fromNotice($notice);
|
$entry = Blog_entry::fromNotice($notice);
|
||||||
|
|
||||||
if (empty($entry)) {
|
if (empty($entry)) {
|
||||||
throw new ClientException(sprintf(_('No blog entry for notice %s'),
|
// TRANS: Exception thrown when requesting a non-existing blog entry for notice.
|
||||||
|
throw new ClientException(sprintf(_m('No blog entry for notice %s.'),
|
||||||
$notice->id));
|
$notice->id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class BlogEntryForm extends Form
|
class BlogEntryForm extends Form
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -99,10 +98,10 @@ class BlogEntryForm extends Form
|
|||||||
|
|
||||||
$this->li();
|
$this->li();
|
||||||
$this->out->textarea('blog-entry-content',
|
$this->out->textarea('blog-entry-content',
|
||||||
// TRANS: Field label on event form.
|
// TRANS: Field label on blog entry form.
|
||||||
_m('LABEL','Text'),
|
_m('LABEL','Text'),
|
||||||
null,
|
null,
|
||||||
// TRANS: Field title on event form.
|
// TRANS: Field title on blog entry form.
|
||||||
_m('Text of the blog entry.'),
|
_m('Text of the blog entry.'),
|
||||||
'content');
|
'content');
|
||||||
$this->unli();
|
$this->unli();
|
||||||
@ -124,8 +123,8 @@ class BlogEntryForm extends Form
|
|||||||
*/
|
*/
|
||||||
function formActions()
|
function formActions()
|
||||||
{
|
{
|
||||||
// TRANS: Button text to save an event..
|
|
||||||
$this->out->submit('blog-entry-submit',
|
$this->out->submit('blog-entry-submit',
|
||||||
|
// TRANS: Button text to save a blog entry.
|
||||||
_m('BUTTON', 'Save'),
|
_m('BUTTON', 'Save'),
|
||||||
'submit',
|
'submit',
|
||||||
'submit');
|
'submit');
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ShowblogentryAction extends ShownoticeAction
|
class ShowblogentryAction extends ShownoticeAction
|
||||||
{
|
{
|
||||||
protected $id;
|
protected $id;
|
||||||
@ -81,6 +80,7 @@ class ShowblogentryAction extends ShownoticeAction
|
|||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
// XXX: check for double-encoding
|
// XXX: check for double-encoding
|
||||||
|
// TRANS: Title for a blog entry without a title.
|
||||||
return (empty($this->entry->title)) ? _m('Untitled') : $this->entry->title;
|
return (empty($this->entry->title)) ? _m('Untitled') : $this->entry->title;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,14 +78,14 @@ class NewrsvpAction extends Action
|
|||||||
$eventId = $this->trimmed('event');
|
$eventId = $this->trimmed('event');
|
||||||
|
|
||||||
if (empty($eventId)) {
|
if (empty($eventId)) {
|
||||||
// TRANS: Client exception thrown when requesting a non-exsting event.
|
// TRANS: Client exception thrown when referring to a non-existing event.
|
||||||
throw new ClientException(_m('No such event.'));
|
throw new ClientException(_m('No such event.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->event = Happening::staticGet('id', $eventId);
|
$this->event = Happening::staticGet('id', $eventId);
|
||||||
|
|
||||||
if (empty($this->event)) {
|
if (empty($this->event)) {
|
||||||
// TRANS: Client exception thrown when requesting a non-exsting event.
|
// TRANS: Client exception thrown when referring to a non-existing event.
|
||||||
throw new ClientException(_m('No such event.'));
|
throw new ClientException(_m('No such event.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* Callback handler to populate end time dropdown
|
* Callback handler to populate end time dropdown
|
||||||
*/
|
*/
|
||||||
class TimelistAction extends Action {
|
class TimelistAction extends Action {
|
||||||
|
|
||||||
private $start;
|
private $start;
|
||||||
private $duration;
|
private $duration;
|
||||||
|
|
||||||
@ -63,13 +62,14 @@ class TimelistAction extends Action {
|
|||||||
|
|
||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
// TRANS: Error message displayed when trying to perform an action that requires a logged in user.
|
||||||
$this->clientError(_('Not logged in.'));
|
$this->clientError(_m('Not logged in.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($this->start)) {
|
if (!empty($this->start)) {
|
||||||
$times = EventTimeList::getTimes($this->start, $this->duration);
|
$times = EventTimeList::getTimes($this->start, $this->duration);
|
||||||
} else {
|
} else {
|
||||||
|
// TRANS: Client error when submitting a form with unexpected information.
|
||||||
$this->clientError(_m('Unexpected form submission.'));
|
$this->clientError(_m('Unexpected form submission.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -78,6 +78,7 @@ class TimelistAction extends Action {
|
|||||||
header('Content-Type: application/json; charset=utf-8');
|
header('Content-Type: application/json; charset=utf-8');
|
||||||
print json_encode($times);
|
print json_encode($times);
|
||||||
} else {
|
} else {
|
||||||
|
// TRANS: Client error displayed when using an action in a non-AJAX way.
|
||||||
$this->clientError(_m('This action is AJAX only.'));
|
$this->clientError(_m('This action is AJAX only.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,16 +228,14 @@ class OMBPlugin extends Plugin
|
|||||||
$omb01 = Remote_profile::staticGet('id', $other_id);
|
$omb01 = Remote_profile::staticGet('id', $other_id);
|
||||||
|
|
||||||
if (!empty($omb01)) {
|
if (!empty($omb01)) {
|
||||||
// TRANS: Client error displayed trying to subscribe to an OMB 0.1 remote profile.
|
|
||||||
throw new ClientException(
|
throw new ClientException(
|
||||||
_m(
|
// TRANS: Client error displayed trying to subscribe to an OMB 0.1 remote profile.
|
||||||
'You cannot subscribe to an OMB 0.1 '
|
_m('You cannot subscribe to an OMB 0.1 '
|
||||||
. 'remote profile with this action.'
|
. 'remote profile with this action.'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -257,10 +255,9 @@ class OMBPlugin extends Plugin
|
|||||||
$omb01 = Remote_profile::staticGet('id', $tagged_profile->id);
|
$omb01 = Remote_profile::staticGet('id', $tagged_profile->id);
|
||||||
|
|
||||||
if (!empty($omb01)) {
|
if (!empty($omb01)) {
|
||||||
// TRANS: Client error displayed when trying to add an OMB 0.1 remote profile to a list.
|
|
||||||
$this->clientError(
|
$this->clientError(
|
||||||
_m(
|
// TRANS: Client error displayed when trying to add an OMB 0.1 remote profile to a list.
|
||||||
'You cannot list an OMB 0.1 '
|
_m('You cannot list an OMB 0.1 '
|
||||||
.'remote profile with this action.')
|
.'remote profile with this action.')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -282,10 +279,9 @@ class OMBPlugin extends Plugin
|
|||||||
$omb01 = Remote_profile::staticGet('id', $ptag->tagged);
|
$omb01 = Remote_profile::staticGet('id', $ptag->tagged);
|
||||||
|
|
||||||
if (!empty($omb01)) {
|
if (!empty($omb01)) {
|
||||||
// TRANS: Client error displayed when trying to (un)list an OMB 0.1 remote profile.
|
|
||||||
$this->clientError(
|
$this->clientError(
|
||||||
_m(
|
// TRANS: Client error displayed when trying to (un)list an OMB 0.1 remote profile.
|
||||||
'You cannot (un)list an OMB 0.1 '
|
_m('You cannot (un)list an OMB 0.1 '
|
||||||
. 'remote profile with this action.')
|
. 'remote profile with this action.')
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
@ -317,8 +313,8 @@ class OMBPlugin extends Plugin
|
|||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
common_log_db_error($token, 'DELETE', __FILE__);
|
common_log_db_error($token, 'DELETE', __FILE__);
|
||||||
// TRANS: Exception thrown when the OMB token for a subscription could not deleted on the server.
|
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
|
// TRANS: Exception thrown when the OMB token for a subscription could not deleted on the server.
|
||||||
_m('Could not delete subscription OMB token.')
|
_m('Could not delete subscription OMB token.')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -394,12 +390,10 @@ class OMBPlugin extends Plugin
|
|||||||
'version' => STATUSNET_VERSION,
|
'version' => STATUSNET_VERSION,
|
||||||
'author' => 'Zach Copley',
|
'author' => 'Zach Copley',
|
||||||
'homepage' => 'http://status.net/wiki/Plugin:Sample',
|
'homepage' => 'http://status.net/wiki/Plugin:Sample',
|
||||||
'rawdescription' =>
|
|
||||||
// TRANS: Plugin description.
|
// TRANS: Plugin description.
|
||||||
_m('A sample plugin to show basics of development for new hackers.')
|
'rawdescription' => _m('A sample plugin to show basics of development for new hackers.')
|
||||||
);
|
);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,4 +28,3 @@ Note: once you have a sizable number of users, sending OMB messages whenever
|
|||||||
someone posts a message can really slow down your site; it may cause posting
|
someone posts a message can really slow down your site; it may cause posting
|
||||||
to timeout. You may wish to enable queuing and handle OMB communication
|
to timeout. You may wish to enable queuing and handle OMB communication
|
||||||
offline. See the "queues and daemons" section of the main StatusNet README.
|
offline. See the "queues and daemons" section of the main StatusNet README.
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @package OStatusPlugin
|
* @package OStatusPlugin
|
||||||
* @maintainer Brion Vibber <brion@status.net>
|
* @maintainer Brion Vibber <brion@status.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Ostatus_profile extends Managed_DataObject
|
class Ostatus_profile extends Managed_DataObject
|
||||||
{
|
{
|
||||||
public $__table = 'ostatus_profile';
|
public $__table = 'ostatus_profile';
|
||||||
@ -141,7 +140,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
*
|
*
|
||||||
* Assumes that 'activity' namespace has been previously defined.
|
* Assumes that 'activity' namespace has been previously defined.
|
||||||
*
|
*
|
||||||
* @fixme replace with wrappers on asActivityObject when it's got everything.
|
* @todo FIXME: Replace with wrappers on asActivityObject when it's got everything.
|
||||||
*
|
*
|
||||||
* @param string $element one of 'actor', 'subject', 'object', 'target'
|
* @param string $element one of 'actor', 'subject', 'object', 'target'
|
||||||
* @return string
|
* @return string
|
||||||
@ -301,7 +300,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
$actor->getURI(),
|
$actor->getURI(),
|
||||||
common_date_iso8601(time()));
|
common_date_iso8601(time()));
|
||||||
|
|
||||||
// @fixme consolidate all these NS settings somewhere
|
// @todo FIXME: Consolidate all these NS settings somewhere.
|
||||||
$attributes = array('xmlns' => Activity::ATOM,
|
$attributes = array('xmlns' => Activity::ATOM,
|
||||||
'xmlns:activity' => 'http://activitystrea.ms/spec/1.0/',
|
'xmlns:activity' => 'http://activitystrea.ms/spec/1.0/',
|
||||||
'xmlns:thr' => 'http://purl.org/syndication/thread/1.0',
|
'xmlns:thr' => 'http://purl.org/syndication/thread/1.0',
|
||||||
@ -414,7 +413,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
|
|
||||||
if ($feed->localName == 'feed' && $feed->namespaceURI == Activity::ATOM) {
|
if ($feed->localName == 'feed' && $feed->namespaceURI == Activity::ATOM) {
|
||||||
$this->processAtomFeed($feed, $source);
|
$this->processAtomFeed($feed, $source);
|
||||||
} else if ($feed->localName == 'rss') { // @fixme check namespace
|
} else if ($feed->localName == 'rss') { // @todo FIXME: Check namespace.
|
||||||
$this->processRssFeed($feed, $source);
|
$this->processRssFeed($feed, $source);
|
||||||
} else {
|
} else {
|
||||||
// TRANS: Exception.
|
// TRANS: Exception.
|
||||||
@ -466,7 +465,6 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
*
|
*
|
||||||
* @return Notice Notice representing the new (or existing) activity
|
* @return Notice Notice representing the new (or existing) activity
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function processEntry($entry, $feed, $source)
|
public function processEntry($entry, $feed, $source)
|
||||||
{
|
{
|
||||||
$activity = new Activity($entry, $feed);
|
$activity = new Activity($entry, $feed);
|
||||||
@ -525,13 +523,15 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count($activity->objects) != 1) {
|
if (count($activity->objects) != 1) {
|
||||||
throw new ClientException(_m("Can only handle share activities with exactly one object."));
|
// TRANS: Client exception thrown when trying to share multiple activities at once.
|
||||||
|
throw new ClientException(_m('Can only handle share activities with exactly one object.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$shared = $activity->objects[0];
|
$shared = $activity->objects[0];
|
||||||
|
|
||||||
if (!($shared instanceof Activity)) {
|
if (!($shared instanceof Activity)) {
|
||||||
throw new ClientException(_m("Can only handle shared activities."));
|
// TRANS: Client exception thrown when trying to share a non-activity object.
|
||||||
|
throw new ClientException(_m('Can only handle shared activities.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$other = Ostatus_profile::ensureActivityObjectProfile($shared->actor);
|
$other = Ostatus_profile::ensureActivityObjectProfile($shared->actor);
|
||||||
@ -542,7 +542,9 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
|
|
||||||
if (empty($sharedNotice)) {
|
if (empty($sharedNotice)) {
|
||||||
$sharedId = ($shared->id) ? $shared->id : $shared->objects[0]->id;
|
$sharedId = ($shared->id) ? $shared->id : $shared->objects[0]->id;
|
||||||
throw new ClientException(sprintf(_m("Failed to save activity %s."),
|
// TRANS: Client exception thrown when saving an activity share fails.
|
||||||
|
// TRANS: %s is a share ID.
|
||||||
|
throw new ClientException(sprintf(_m('Failed to save activity %s.'),
|
||||||
$sharedId));
|
$sharedId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -578,7 +580,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
} else if (!empty($activity->title)) {
|
} else if (!empty($activity->title)) {
|
||||||
$sourceContent = $activity->title;
|
$sourceContent = $activity->title;
|
||||||
} else {
|
} else {
|
||||||
// @fixme fetch from $sourceUrl?
|
// @todo FIXME: Fetch from $sourceUrl?
|
||||||
// TRANS: Client exception. %s is a source URI.
|
// TRANS: Client exception. %s is a source URI.
|
||||||
throw new ClientException(sprintf(_m('No content for notice %s.'),$sourceUri));
|
throw new ClientException(sprintf(_m('No content for notice %s.'),$sourceUri));
|
||||||
}
|
}
|
||||||
@ -652,7 +654,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
$options['replies'] = $replies;
|
$options['replies'] = $replies;
|
||||||
|
|
||||||
// Maintain direct reply associations
|
// Maintain direct reply associations
|
||||||
// @fixme what about conversation ID?
|
// @todo FIXME: What about conversation ID?
|
||||||
if (!empty($activity->context->replyToID)) {
|
if (!empty($activity->context->replyToID)) {
|
||||||
$orig = Notice::staticGet('uri',
|
$orig = Notice::staticGet('uri',
|
||||||
$activity->context->replyToID);
|
$activity->context->replyToID);
|
||||||
@ -688,7 +690,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
|
|
||||||
// Atom enclosures -> attachment URLs
|
// Atom enclosures -> attachment URLs
|
||||||
foreach ($activity->enclosures as $href) {
|
foreach ($activity->enclosures as $href) {
|
||||||
// @fixme save these locally or....?
|
// @todo FIXME: Save these locally or....?
|
||||||
$options['urls'][] = $href;
|
$options['urls'][] = $href;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -705,7 +707,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
* @param Activity $activity
|
* @param Activity $activity
|
||||||
* @param string $method 'push' or 'salmon'
|
* @param string $method 'push' or 'salmon'
|
||||||
* @return mixed saved Notice or false
|
* @return mixed saved Notice or false
|
||||||
* @fixme break up this function, it's getting nasty long
|
* @todo FIXME: Break up this function, it's getting nasty long
|
||||||
*/
|
*/
|
||||||
public function processPost($activity, $method)
|
public function processPost($activity, $method)
|
||||||
{
|
{
|
||||||
@ -750,7 +752,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
} else if (!empty($note->title)) {
|
} else if (!empty($note->title)) {
|
||||||
$sourceContent = $note->title;
|
$sourceContent = $note->title;
|
||||||
} else {
|
} else {
|
||||||
// @fixme fetch from $sourceUrl?
|
// @todo FIXME: Fetch from $sourceUrl?
|
||||||
// TRANS: Client exception. %s is a source URI.
|
// TRANS: Client exception. %s is a source URI.
|
||||||
throw new ClientException(sprintf(_m('No content for notice %s.'),$sourceUri));
|
throw new ClientException(sprintf(_m('No content for notice %s.'),$sourceUri));
|
||||||
}
|
}
|
||||||
@ -822,7 +824,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
$options['replies'] = $replies;
|
$options['replies'] = $replies;
|
||||||
|
|
||||||
// Maintain direct reply associations
|
// Maintain direct reply associations
|
||||||
// @fixme what about conversation ID?
|
// @todo FIXME: What about conversation ID?
|
||||||
if (!empty($activity->context->replyToID)) {
|
if (!empty($activity->context->replyToID)) {
|
||||||
$orig = Notice::staticGet('uri',
|
$orig = Notice::staticGet('uri',
|
||||||
$activity->context->replyToID);
|
$activity->context->replyToID);
|
||||||
@ -858,7 +860,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
|
|
||||||
// Atom enclosures -> attachment URLs
|
// Atom enclosures -> attachment URLs
|
||||||
foreach ($activity->enclosures as $href) {
|
foreach ($activity->enclosures as $href) {
|
||||||
// @fixme save these locally or....?
|
// @todo FIXME: Save these locally or....?
|
||||||
$options['urls'][] = $href;
|
$options['urls'][] = $href;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -907,7 +909,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
// Is the recipient a local user?
|
// Is the recipient a local user?
|
||||||
$user = User::staticGet('uri', $recipient);
|
$user = User::staticGet('uri', $recipient);
|
||||||
if ($user) {
|
if ($user) {
|
||||||
// @fixme sender verification, spam etc?
|
// @todo FIXME: Sender verification, spam etc?
|
||||||
$replies[] = $recipient;
|
$replies[] = $recipient;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -936,7 +938,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
$oprofile = Ostatus_profile::ensureProfileURI($recipient);
|
$oprofile = Ostatus_profile::ensureProfileURI($recipient);
|
||||||
if ($oprofile->isGroup()) {
|
if ($oprofile->isGroup()) {
|
||||||
// Deliver to local members of this remote group.
|
// Deliver to local members of this remote group.
|
||||||
// @fixme sender verification?
|
// @todo FIXME: Sender verification?
|
||||||
$groups[] = $oprofile->group_id;
|
$groups[] = $oprofile->group_id;
|
||||||
} else {
|
} else {
|
||||||
// may be canonicalized or something
|
// may be canonicalized or something
|
||||||
@ -1129,7 +1131,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
*
|
*
|
||||||
* @param DOMElement $feedEl root element of a loaded Atom feed
|
* @param DOMElement $feedEl root element of a loaded Atom feed
|
||||||
* @param array $hints additional discovery information passed from higher levels
|
* @param array $hints additional discovery information passed from higher levels
|
||||||
* @fixme should this be marked public?
|
* @todo FIXME: Should this be marked public?
|
||||||
* @return Ostatus_profile
|
* @return Ostatus_profile
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@ -1155,7 +1157,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
*
|
*
|
||||||
* @param DOMElement $feedEl root element of a loaded RSS feed
|
* @param DOMElement $feedEl root element of a loaded RSS feed
|
||||||
* @param array $hints additional discovery information passed from higher levels
|
* @param array $hints additional discovery information passed from higher levels
|
||||||
* @fixme should this be marked public?
|
* @todo FIXME: Should this be marked public?
|
||||||
* @return Ostatus_profile
|
* @return Ostatus_profile
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@ -1181,7 +1183,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @fixme we should check whether this feed has elements
|
// @todo FIXME: We should check whether this feed has elements
|
||||||
// with different <author> or <dc:creator> elements, and... I dunno.
|
// with different <author> or <dc:creator> elements, and... I dunno.
|
||||||
// Do something about that.
|
// Do something about that.
|
||||||
|
|
||||||
@ -1219,7 +1221,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
$this->uri));
|
$this->uri));
|
||||||
}
|
}
|
||||||
|
|
||||||
// @fixme this should be better encapsulated
|
// @todo FIXME: This should be better encapsulated
|
||||||
// ripped from oauthstore.php (for old OMB client)
|
// ripped from oauthstore.php (for old OMB client)
|
||||||
$temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
|
$temp_filename = tempnam(sys_get_temp_dir(), 'listener_avatar');
|
||||||
try {
|
try {
|
||||||
@ -1233,7 +1235,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
} else {
|
} else {
|
||||||
$id = $this->profile_id;
|
$id = $this->profile_id;
|
||||||
}
|
}
|
||||||
// @fixme should we be using different ids?
|
// @todo FIXME: Should we be using different ids?
|
||||||
$imagefile = new ImageFile($id, $temp_filename);
|
$imagefile = new ImageFile($id, $temp_filename);
|
||||||
$filename = Avatar::filename($id,
|
$filename = Avatar::filename($id,
|
||||||
image_type_to_extension($imagefile->type),
|
image_type_to_extension($imagefile->type),
|
||||||
@ -1244,7 +1246,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
unlink($temp_filename);
|
unlink($temp_filename);
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
// @fixme hardcoded chmod is lame, but seems to be necessary to
|
// @todo FIXME: Hardcoded chmod is lame, but seems to be necessary to
|
||||||
// keep from accidentally saving images from command-line (queues)
|
// keep from accidentally saving images from command-line (queues)
|
||||||
// that can't be read from web server, which causes hard-to-notice
|
// that can't be read from web server, which causes hard-to-notice
|
||||||
// problems later on:
|
// problems later on:
|
||||||
@ -1426,7 +1428,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fixme validate stuff somewhere
|
* @todo FIXME: Validate stuff somewhere.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1652,7 +1654,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @fixme tags/categories
|
// @todo FIXME: tags/categories
|
||||||
// @todo tags from categories
|
// @todo tags from categories
|
||||||
|
|
||||||
if ($profile->id) {
|
if ($profile->id) {
|
||||||
@ -1887,7 +1889,7 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
$xrd = $disco->lookup($addr);
|
$xrd = $disco->lookup($addr);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
// Save negative cache entry so we don't waste time looking it up again.
|
// Save negative cache entry so we don't waste time looking it up again.
|
||||||
// @fixme distinguish temporary failures?
|
// @todo FIXME: Distinguish temporary failures?
|
||||||
self::cacheSet(sprintf('ostatus_profile:webfinger:%s', $addr), null);
|
self::cacheSet(sprintf('ostatus_profile:webfinger:%s', $addr), null);
|
||||||
// TRANS: Exception.
|
// TRANS: Exception.
|
||||||
throw new Exception(_m('Not a valid webfinger address.'));
|
throw new Exception(_m('Not a valid webfinger address.'));
|
||||||
@ -1930,14 +1932,14 @@ class Ostatus_profile extends Managed_DataObject
|
|||||||
return $oprofile;
|
return $oprofile;
|
||||||
} catch (OStatusShadowException $e) {
|
} catch (OStatusShadowException $e) {
|
||||||
// We've ended up with a remote reference to a local user or group.
|
// We've ended up with a remote reference to a local user or group.
|
||||||
// @fixme ideally we should be able to say who it was so we can
|
// @todo FIXME: Ideally we should be able to say who it was so we can
|
||||||
// go back and refer to it the regular way
|
// go back and refer to it the regular way
|
||||||
throw $e;
|
throw $e;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
common_log(LOG_WARNING, "Failed creating profile from profile URL '$profileUrl': " . $e->getMessage());
|
common_log(LOG_WARNING, "Failed creating profile from profile URL '$profileUrl': " . $e->getMessage());
|
||||||
// keep looking
|
// keep looking
|
||||||
//
|
//
|
||||||
// @fixme this means an error discovering from profile page
|
// @todo FIXME: This means an error discovering from profile page
|
||||||
// may give us a corrupt entry using the webfinger URI, which
|
// may give us a corrupt entry using the webfinger URI, which
|
||||||
// will obscure the correct page-keyed profile later on.
|
// will obscure the correct page-keyed profile later on.
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,6 @@ class RealtimePlugin extends Plugin
|
|||||||
* When it's time to initialize the plugin, calculate and
|
* When it's time to initialize the plugin, calculate and
|
||||||
* pass the URLs we need.
|
* pass the URLs we need.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function onInitializePlugin()
|
function onInitializePlugin()
|
||||||
{
|
{
|
||||||
// FIXME: need to find a better way to pass this pattern in
|
// FIXME: need to find a better way to pass this pattern in
|
||||||
@ -367,9 +366,8 @@ class RealtimePlugin extends Plugin
|
|||||||
$convurl = $conv->uri;
|
$convurl = $conv->uri;
|
||||||
|
|
||||||
if(empty($convurl)) {
|
if(empty($convurl)) {
|
||||||
$msg = sprintf(
|
$msg = sprintf( "Could not find Conversation ID %d to make 'in context'"
|
||||||
"Couldn't find Conversation ID %d to make 'in context'"
|
. "link for Notice ID %d.",
|
||||||
. "link for Notice ID %d",
|
|
||||||
$notice->conversation,
|
$notice->conversation,
|
||||||
$notice->id
|
$notice->id
|
||||||
);
|
);
|
||||||
|
@ -46,7 +46,6 @@ if (!defined('STATUSNET')) {
|
|||||||
*
|
*
|
||||||
* @see DB_DataObject
|
* @see DB_DataObject
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Realtime_channel extends Managed_DataObject
|
class Realtime_channel extends Managed_DataObject
|
||||||
{
|
{
|
||||||
const TIMEOUT = 1800; // 30 minutes
|
const TIMEOUT = 1800; // 30 minutes
|
||||||
@ -71,7 +70,6 @@ class Realtime_channel extends Managed_DataObject
|
|||||||
* @param mixed $v Value to lookup
|
* @param mixed $v Value to lookup
|
||||||
*
|
*
|
||||||
* @return Realtime_channel object found, or null for no hits
|
* @return Realtime_channel object found, or null for no hits
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
function staticGet($k, $v=null)
|
function staticGet($k, $v=null)
|
||||||
{
|
{
|
||||||
@ -84,7 +82,6 @@ class Realtime_channel extends Managed_DataObject
|
|||||||
* @param array $kv array of key-value mappings
|
* @param array $kv array of key-value mappings
|
||||||
*
|
*
|
||||||
* @return Realtime_channel object found, or null for no hits
|
* @return Realtime_channel object found, or null for no hits
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
function pkeyGet($kv)
|
function pkeyGet($kv)
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class ClosechannelAction extends Action
|
class ClosechannelAction extends Action
|
||||||
{
|
{
|
||||||
protected $channelKey = null;
|
protected $channelKey = null;
|
||||||
@ -57,24 +56,26 @@ class ClosechannelAction extends Action
|
|||||||
*
|
*
|
||||||
* @return boolean true
|
* @return boolean true
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function prepare($argarray)
|
function prepare($argarray)
|
||||||
{
|
{
|
||||||
parent::prepare($argarray);
|
parent::prepare($argarray);
|
||||||
|
|
||||||
if (!$this->isPost()) {
|
if (!$this->isPost()) {
|
||||||
|
// TRANS: Client exception. Do not translate POST.
|
||||||
throw new ClientException(_m('You have to POST it.'));
|
throw new ClientException(_m('You have to POST it.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->channelKey = $this->trimmed('channelkey');
|
$this->channelKey = $this->trimmed('channelkey');
|
||||||
|
|
||||||
if (empty($this->channelKey)) {
|
if (empty($this->channelKey)) {
|
||||||
|
// TRANS: Client exception thrown when the channel key argument is missing.
|
||||||
throw new ClientException(_m('No channel key argument.'));
|
throw new ClientException(_m('No channel key argument.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->channel = Realtime_channel::staticGet('channel_key', $this->channelKey);
|
$this->channel = Realtime_channel::staticGet('channel_key', $this->channelKey);
|
||||||
|
|
||||||
if (empty($this->channel)) {
|
if (empty($this->channel)) {
|
||||||
|
// TRANS: Client exception thrown when referring to a non-existing channel.
|
||||||
throw new ClientException(_m('No such channel.'));
|
throw new ClientException(_m('No such channel.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +89,6 @@ class ClosechannelAction extends Action
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function handle($argarray=null)
|
function handle($argarray=null)
|
||||||
{
|
{
|
||||||
$this->channel->decrement();
|
$this->channel->decrement();
|
||||||
@ -107,7 +107,6 @@ class ClosechannelAction extends Action
|
|||||||
*
|
*
|
||||||
* @return boolean is read only action?
|
* @return boolean is read only action?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function isReadOnly($args)
|
function isReadOnly($args)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -44,7 +44,6 @@ if (!defined('STATUSNET')) {
|
|||||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
|
||||||
* @link http://status.net/
|
* @link http://status.net/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class KeepalivechannelAction extends Action
|
class KeepalivechannelAction extends Action
|
||||||
{
|
{
|
||||||
protected $channelKey = null;
|
protected $channelKey = null;
|
||||||
@ -57,24 +56,26 @@ class KeepalivechannelAction extends Action
|
|||||||
*
|
*
|
||||||
* @return boolean true
|
* @return boolean true
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function prepare($argarray)
|
function prepare($argarray)
|
||||||
{
|
{
|
||||||
parent::prepare($argarray);
|
parent::prepare($argarray);
|
||||||
|
|
||||||
if (!$this->isPost()) {
|
if (!$this->isPost()) {
|
||||||
|
// TRANS: Client exception. Do not translate POST.
|
||||||
throw new ClientException(_m('You have to POST it.'));
|
throw new ClientException(_m('You have to POST it.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->channelKey = $this->trimmed('channelkey');
|
$this->channelKey = $this->trimmed('channelkey');
|
||||||
|
|
||||||
if (empty($this->channelKey)) {
|
if (empty($this->channelKey)) {
|
||||||
|
// TRANS: Client exception thrown when the channel key argument is missing.
|
||||||
throw new ClientException(_m('No channel key argument.'));
|
throw new ClientException(_m('No channel key argument.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->channel = Realtime_channel::staticGet('channel_key', $this->channelKey);
|
$this->channel = Realtime_channel::staticGet('channel_key', $this->channelKey);
|
||||||
|
|
||||||
if (empty($this->channel)) {
|
if (empty($this->channel)) {
|
||||||
|
// TRANS: Client exception thrown when referring to a non-existing channel.
|
||||||
throw new ClientException(_m('No such channel.'));
|
throw new ClientException(_m('No such channel.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +89,6 @@ class KeepalivechannelAction extends Action
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function handle($argarray=null)
|
function handle($argarray=null)
|
||||||
{
|
{
|
||||||
$this->channel->touch();
|
$this->channel->touch();
|
||||||
@ -107,7 +107,6 @@ class KeepalivechannelAction extends Action
|
|||||||
*
|
*
|
||||||
* @return boolean is read only action?
|
* @return boolean is read only action?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function isReadOnly($args)
|
function isReadOnly($args)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user