diff options
Diffstat (limited to 'lib')
108 files changed, 1617 insertions, 1211 deletions
diff --git a/lib/Shorturl_api.php b/lib/Shorturl_api.php index 22d5b4cb5..18ae7719b 100644 --- a/lib/Shorturl_api.php +++ b/lib/Shorturl_api.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,9 +17,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -class ShortUrlApi +abstract class ShortUrlApi { protected $service_url; protected $long_limit = 27; @@ -35,11 +35,9 @@ class ShortUrlApi return $url; } - protected function shorten_imp($url) { - return "To Override"; - } + protected abstract function shorten_imp($url); - private function is_long($url) { + protected function is_long($url) { return strlen($url) >= common_config('site', 'shorturllength'); } @@ -71,61 +69,3 @@ class ShortUrlApi } } -class LilUrl extends ShortUrlApi -{ - function __construct() - { - parent::__construct('http://ur1.ca/'); - } - - protected function shorten_imp($url) { - $data['longurl'] = $url; - $response = $this->http_post($data); - if (!$response) return $url; - $y = @simplexml_load_string($response); - if (!isset($y->body)) return $url; - $x = $y->body->p[0]->a->attributes(); - if (isset($x['href'])) return $x['href']; - return $url; - } -} - - -class PtitUrl extends ShortUrlApi -{ - function __construct() - { - parent::__construct('http://ptiturl.com/?creer=oui&action=Reduire&url='); - } - - protected function shorten_imp($url) { - $response = $this->http_get($url); - if (!$response) return $url; - $response = $this->tidy($response); - $y = @simplexml_load_string($response); - if (!isset($y->body)) return $url; - $xml = $y->body->center->table->tr->td->pre->a->attributes(); - if (isset($xml['href'])) return $xml['href']; - return $url; - } -} - -class TightUrl extends ShortUrlApi -{ - function __construct() - { - parent::__construct('http://2tu.us/?save=y&url='); - } - - protected function shorten_imp($url) { - $response = $this->http_get($url); - if (!$response) return $url; - $response = $this->tidy($response); - $y = @simplexml_load_string($response); - if (!isset($y->body)) return $url; - $xml = $y->body->p[0]->code[0]->a->attributes(); - if (isset($xml['href'])) return $xml['href']; - return $url; - } -} - diff --git a/lib/accountsettingsaction.php b/lib/accountsettingsaction.php index 9a7c69124..a004a3ed9 100644 --- a/lib/accountsettingsaction.php +++ b/lib/accountsettingsaction.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for account settings actions * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Settings - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,10 +37,10 @@ require_once INSTALLDIR.'/lib/settingsaction.php'; * Base class for account settings actions * * @category Settings - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see Widget */ @@ -66,10 +66,10 @@ class AccountSettingsAction extends SettingsAction * A widget for showing the settings group local nav menu * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see HTMLOutputter */ diff --git a/lib/action.php b/lib/action.php index ebd722719..8056cb9ec 100644 --- a/lib/action.php +++ b/lib/action.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for all actions (~views) * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -45,11 +45,11 @@ require_once INSTALLDIR.'/lib/htmloutputter.php'; * model classes to read and write to the database; and doing ouput. * * @category Output - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see HTMLOutputter */ @@ -195,28 +195,32 @@ class Action extends HTMLOutputter // lawsuit { if (Event::handle('StartShowStyles', array($this))) { - if (Event::handle('StartShowLaconicaStyles', array($this))) { + // Use old name for StatusNet for compatibility on events + + if (Event::handle('StartShowStatusNetStyles', array($this)) && + Event::handle('StartShowLaconicaStyles', array($this))) { $this->cssLink('css/display.css',null,'screen, projection, tv'); if (common_config('site', 'mobile')) { // TODO: "handheld" CSS for other mobile devices $this->cssLink('css/mobile.css','base','only screen and (max-device-width: 480px)'); // Mobile WebKit } $this->cssLink('css/print.css','base','print'); + Event::handle('EndShowStatusNetStyles', array($this)); Event::handle('EndShowLaconicaStyles', array($this)); } if (Event::handle('StartShowUAStyles', array($this))) { $this->comment('[if IE]><link rel="stylesheet" type="text/css" '. - 'href="'.theme_path('css/ie.css', 'base').'?version='.LACONICA_VERSION.'" /><![endif]'); + 'href="'.theme_path('css/ie.css', 'base').'?version='.STATUSNET_VERSION.'" /><![endif]'); foreach (array(6,7) as $ver) { if (file_exists(theme_file('css/ie'.$ver.'.css', 'base'))) { // Yes, IE people should be put in jail. $this->comment('[if lte IE '.$ver.']><link rel="stylesheet" type="text/css" '. - 'href="'.theme_path('css/ie'.$ver.'.css', 'base').'?version='.LACONICA_VERSION.'" /><![endif]'); + 'href="'.theme_path('css/ie'.$ver.'.css', 'base').'?version='.STATUSNET_VERSION.'" /><![endif]'); } } $this->comment('[if IE]><link rel="stylesheet" type="text/css" '. - 'href="'.theme_path('css/ie.css', null).'?version='.LACONICA_VERSION.'" /><![endif]'); + 'href="'.theme_path('css/ie.css', null).'?version='.STATUSNET_VERSION.'" /><![endif]'); Event::handle('EndShowUAStyles', array($this)); } @@ -252,12 +256,14 @@ class Action extends HTMLOutputter // lawsuit $this->script('js/jquery.joverlay.min.js'); Event::handle('EndShowJQueryScripts', array($this)); } - if (Event::handle('StartShowLaconicaScripts', array($this))) { + if (Event::handle('StartShowStatusNetScripts', array($this)) && + Event::handle('StartShowLaconicaScripts', array($this))) { $this->script('js/xbImportNode.js'); $this->script('js/util.js'); // Frame-busting code to avoid clickjacking attacks. $this->element('script', array('type' => 'text/javascript'), 'if (window.top !== window.self) { window.top.location.href = window.self.location.href; }'); + Event::handle('EndShowStatusNetScripts', array($this)); Event::handle('EndShowLaconicaScripts', array($this)); } Event::handle('EndShowScripts', array($this)); @@ -740,26 +746,26 @@ class Action extends HTMLOutputter // lawsuit function showLicenses() { $this->elementStart('dl', array('id' => 'licenses')); - $this->showLaconicaLicense(); + $this->showStatusNetLicense(); $this->showContentLicense(); $this->elementEnd('dl'); } /** - * Show Laconica license. + * Show StatusNet license. * * @return nothing */ - function showLaconicaLicense() + function showStatusNetLicense() { - $this->element('dt', array('id' => 'site_laconica_license'), _('Laconica software license')); + $this->element('dt', array('id' => 'site_statusnet_license'), _('StatusNet software license')); $this->elementStart('dd', null); if (common_config('site', 'broughtby')) { $instr = _('**%%site.name%%** is a microblogging service brought to you by [%%site.broughtby%%](%%site.broughtbyurl%%). '); } else { $instr = _('**%%site.name%%** is a microblogging service. '); } - $instr .= sprintf(_('It runs the [Laconica](http://laconi.ca/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), LACONICA_VERSION); + $instr .= sprintf(_('It runs the [StatusNet](http://status.net/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), STATUSNET_VERSION); $output = common_markup_to_html($instr); $this->raw($output); $this->elementEnd('dd'); @@ -773,7 +779,7 @@ class Action extends HTMLOutputter // lawsuit */ function showContentLicense() { - $this->element('dt', array('id' => 'site_content_license'), _('Laconica software license')); + $this->element('dt', array('id' => 'site_content_license'), _('Site content license')); $this->elementStart('dd', array('id' => 'site_content_license_cc')); $this->elementStart('p'); $this->element('img', array('id' => 'license_cc', diff --git a/lib/arraywrapper.php b/lib/arraywrapper.php index 47ae057dc..8a1cdd96e 100644 --- a/lib/arraywrapper.php +++ b/lib/arraywrapper.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php index 41d03f8e2..51ceca857 100644 --- a/lib/attachmentlist.php +++ b/lib/attachmentlist.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * widget for displaying a list of notice attachments * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category UI - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -41,10 +41,10 @@ if (!defined('LACONICA')) { * data for e.g. the profile page. * * @category UI - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * @see Notice * @see NoticeListItem * @see ProfileNoticeList @@ -127,10 +127,10 @@ class AttachmentList extends Widget * author info (since that's implicit by the data in the page). * * @category UI - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * @see NoticeList * @see ProfileNoticeListItem */ diff --git a/lib/attachmentnoticesection.php b/lib/attachmentnoticesection.php index eb3176376..578c171ff 100644 --- a/lib/attachmentnoticesection.php +++ b/lib/attachmentnoticesection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * FIXME * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,10 +37,10 @@ if (!defined('LACONICA')) { * These are the widgets that show interesting data about a person * group, or site. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class AttachmentNoticeSection extends NoticeSection diff --git a/lib/attachmenttagcloudsection.php b/lib/attachmenttagcloudsection.php index 50bfceccb..e2f85ae02 100644 --- a/lib/attachmenttagcloudsection.php +++ b/lib/attachmenttagcloudsection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Attachment tag cloud section * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Attachment tag cloud section * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class AttachmentTagCloudSection extends TagCloudSection diff --git a/lib/blockform.php b/lib/blockform.php index af766b823..4820d09af 100644 --- a/lib/blockform.php +++ b/lib/blockform.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Form for blocking a user * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for blocking a user * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see UnblockForm */ diff --git a/lib/channel.php b/lib/channel.php index 38c1d4d67..3cd168786 100644 --- a/lib/channel.php +++ b/lib/channel.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } class Channel { diff --git a/lib/clienterroraction.php b/lib/clienterroraction.php index 7ddc35eb6..7d007a756 100644 --- a/lib/clienterroraction.php +++ b/lib/clienterroraction.php @@ -6,14 +6,14 @@ * PHP version 5 * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ * - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -29,7 +29,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -39,10 +39,10 @@ require_once INSTALLDIR.'/lib/error.php'; * Class for displaying HTTP client errors * * @category Action - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ClientErrorAction extends ErrorAction { diff --git a/lib/clientexception.php b/lib/clientexception.php index 3020d7f50..01c013a01 100644 --- a/lib/clientexception.php +++ b/lib/clientexception.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * class for a client exception (user error) * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Exception - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,10 +37,10 @@ if (!defined('LACONICA')) { * Subclass of PHP Exception for user errors. * * @category Exception - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ClientException extends Exception diff --git a/lib/command.php b/lib/command.php index 371386dc5..11d40b8e1 100644 --- a/lib/command.php +++ b/lib/command.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/channel.php'); @@ -114,7 +114,6 @@ class StatsCommand extends Command class FavCommand extends Command { - var $other = null; function __construct($user, $other) @@ -158,6 +157,108 @@ class FavCommand extends Command $channel->output($this->user, _('Notice marked as fave.')); } + +} +class JoinCommand extends Command +{ + var $other = null; + + function __construct($user, $other) + { + parent::__construct($user); + $this->other = $other; + } + + function execute($channel) + { + + $nickname = common_canonical_nickname($this->other); + $group = User_group::staticGet('nickname', $nickname); + $cur = $this->user; + + if (!$group) { + $channel->error($cur, _('No such group.')); + return; + } + + if ($cur->isMember($group)) { + $channel->error($cur, _('You are already a member of that group')); + return; + } + if (Group_block::isBlocked($group, $cur->getProfile())) { + $channel->error($cur, _('You have been blocked from that group by the admin.')); + return; + } + + $member = new Group_member(); + + $member->group_id = $group->id; + $member->profile_id = $cur->id; + $member->created = common_sql_now(); + + $result = $member->insert(); + if (!$result) { + common_log_db_error($member, 'INSERT', __FILE__); + $channel->error($cur, sprintf(_('Could not join user %s to group %s'), + $cur->nickname, $group->nickname)); + return; + } + + $channel->output($cur, sprintf(_('%s joined group %s'), + $cur->nickname, + $group->nickname)); + } + +} +class DropCommand extends Command +{ + var $other = null; + + function __construct($user, $other) + { + parent::__construct($user); + $this->other = $other; + } + + function execute($channel) + { + + $nickname = common_canonical_nickname($this->other); + $group = User_group::staticGet('nickname', $nickname); + $cur = $this->user; + + if (!$group) { + $channel->error($cur, _('No such group.')); + return; + } + + if (!$cur->isMember($group)) { + $channel->error($cur, _('You are not a member of that group.')); + return; + } + + $member = new Group_member(); + + $member->group_id = $group->id; + $member->profile_id = $cur->id; + + if (!$member->find(true)) { + $channel->error($cur,_('Could not find membership record.')); + return; + } + $result = $member->delete(); + if (!$result) { + common_log_db_error($member, 'INSERT', __FILE__); + $channel->error($cur, sprintf(_('Could not remove user %s to group %s'), + $cur->nickname, $group->nickname)); + return; + } + + $channel->output($cur, sprintf(_('%s left group %s'), + $cur->nickname, + $group->nickname)); + } + } class WhoisCommand extends Command @@ -396,6 +497,8 @@ class HelpCommand extends Command "get <nickname> - get last notice from user\n". "whois <nickname> - get profile info on user\n". "fav <nickname> - add user's last notice as a 'fave'\n". + "join <group> - join group\n". + "drop <group> - leave group\n". "stats - get your stats\n". "stop - same as 'off'\n". "quit - same as 'off'\n". diff --git a/lib/commandinterpreter.php b/lib/commandinterpreter.php index 6538d4442..6e4340e5d 100644 --- a/lib/commandinterpreter.php +++ b/lib/commandinterpreter.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once INSTALLDIR.'/lib/command.php'; @@ -33,7 +33,7 @@ class CommandInterpreter # We try to support all the same commands as Twitter, see # http://getsatisfaction.com/twitter/topics/what_are_the_twitter_commands # There are a few compatibility commands from earlier versions of - # Laconica + # StatusNet switch(strtolower($cmd)) { case 'help': @@ -70,6 +70,26 @@ class CommandInterpreter } else { return new OffCommand($user); } + case 'join': + if (!$arg) { + return null; + } + list($other, $extra) = explode(' ', $arg, 2); + if ($extra) { + return null; + } else { + return new JoinCommand($user, $other); + } + case 'drop': + if (!$arg) { + return null; + } + list($other, $extra) = explode(' ', $arg, 2); + if ($extra) { + return null; + } else { + return new DropCommand($user, $other); + } case 'follow': case 'sub': if (!$arg) { diff --git a/lib/common.php b/lib/common.php index d23d9da7d..5652e986e 100644 --- a/lib/common.php +++ b/lib/common.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,11 +17,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -define('LACONICA_VERSION', '0.9.0dev'); +define('STATUSNET_VERSION', '0.9.0dev'); +define('LACONICA_VERSION', STATUSNET_VERSION); // compatibility -// XXX: move these to class variables +define('STATUSNET_CODENAME', 'Stand'); define('AVATAR_PROFILE_SIZE', 96); define('AVATAR_STREAM_SIZE', 48); @@ -49,6 +50,9 @@ require_once('PEAR.php'); require_once('DB/DataObject.php'); require_once('DB/DataObject/Cast.php'); # for dates +if (!function_exists('gettext')) { + require_once("php-gettext/gettext.inc"); +} require_once(INSTALLDIR.'/lib/language.php'); // This gets included before the config file, so that admin code and plugins @@ -93,7 +97,7 @@ if (isset($path)) { $config = array('site' => - array('name' => 'Just another Laconica microblog', + array('name' => 'Just another StatusNet microblog', 'server' => $_server, 'theme' => 'default', 'path' => $_path, @@ -119,14 +123,14 @@ $config = 'textlimit' => 140, ), 'syslog' => - array('appname' => 'laconica', # for syslog + array('appname' => 'statusnet', # for syslog 'priority' => 'debug', # XXX: currently ignored 'facility' => LOG_USER), 'queue' => array('enabled' => false, 'subsystem' => 'db', # default to database, or 'stomp' 'stomp_server' => null, - 'queue_basename' => 'laconica', + 'queue_basename' => 'statusnet', 'stomp_username' => null, 'stomp_password' => null, ), @@ -197,7 +201,7 @@ $config = 'twitterbridge' => array('enabled' => false), 'integration' => - array('source' => 'Laconica', # source attribute for Twitter + array('source' => 'StatusNet', # source attribute for Twitter 'taguri' => $_server.',2009'), # base for tag URIs 'twitter' => array('consumer_key' => null, @@ -217,7 +221,7 @@ $config = 'snapshot' => array('run' => 'web', 'frequency' => 10000, - 'reporturl' => 'http://laconi.ca/stats/report'), + 'reporturl' => 'http://status.net/stats/report'), 'attachments' => array('server' => null, 'dir' => INSTALLDIR . '/file/', @@ -345,10 +349,14 @@ function addPlugin($name, $attrs = null) if (isset($conffile)) { $_config_files = array($conffile); } else { - $_config_files = array('/etc/laconica/laconica.php', + $_config_files = array('/etc/statusnet/statusnet.php', + '/etc/statusnet/laconica.php', + '/etc/laconica/laconica.php', + '/etc/statusnet/'.$_server.'.php', '/etc/laconica/'.$_server.'.php'); if (strlen($_path) > 0) { + $_config_files[] = '/etc/statusnet/'.$_server.'_'.$_path.'.php'; $_config_files[] = '/etc/laconica/'.$_server.'_'.$_path.'.php'; } @@ -372,12 +380,12 @@ function _have_config() // XXX: Throw a conniption if database not installed -// Fixup for laconica.ini +// Fixup for statusnet.ini $_db_name = substr($config['db']['database'], strrpos($config['db']['database'], '/') + 1); -if ($_db_name != 'laconica' && !array_key_exists('ini_'.$_db_name, $config['db'])) { - $config['db']['ini_'.$_db_name] = INSTALLDIR.'/classes/laconica.ini'; +if ($_db_name != 'statusnet' && !array_key_exists('ini_'.$_db_name, $config['db'])) { + $config['db']['ini_'.$_db_name] = INSTALLDIR.'/classes/statusnet.ini'; } function __autoload($cls) diff --git a/lib/connectsettingsaction.php b/lib/connectsettingsaction.php index 7902931e0..e5fb8727b 100644 --- a/lib/connectsettingsaction.php +++ b/lib/connectsettingsaction.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for connection settings actions * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Settings - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,10 +37,10 @@ require_once INSTALLDIR.'/lib/settingsaction.php'; * Base class for connection settings actions * * @category Settings - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see Widget */ @@ -66,10 +66,10 @@ class ConnectSettingsAction extends SettingsAction * A widget for showing the connect group local nav menu * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see HTMLOutputter */ diff --git a/lib/currentuserdesignaction.php b/lib/currentuserdesignaction.php index 52516b624..c2f38cd00 100644 --- a/lib/currentuserdesignaction.php +++ b/lib/currentuserdesignaction.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for actions that use the current user's design * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,10 +38,10 @@ if (!defined('LACONICA')) { * design. This superclass returns that design. * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * */ diff --git a/lib/daemon.php b/lib/daemon.php index 231f5414e..4c2491e97 100644 --- a/lib/daemon.php +++ b/lib/daemon.php @@ -1,7 +1,7 @@ <?php /** - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } diff --git a/lib/dberroraction.php b/lib/dberroraction.php index a04e5f74f..2cb66a022 100644 --- a/lib/dberroraction.php +++ b/lib/dberroraction.php @@ -5,14 +5,14 @@ * PHP version 5 * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ * - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -28,7 +28,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -42,10 +42,10 @@ require_once INSTALLDIR.'/lib/servererroraction.php'; * to the DB, so we don't trigger it again. * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ */ class DBErrorAction extends ServerErrorAction diff --git a/lib/dbqueuemanager.php b/lib/dbqueuemanager.php index 19aa9f3ae..750300928 100644 --- a/lib/dbqueuemanager.php +++ b/lib/dbqueuemanager.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Simple-minded queue manager for storing items in the database * @@ -20,11 +20,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category QueueManager - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class DBQueueManager extends QueueManager diff --git a/lib/deleteaction.php b/lib/deleteaction.php index 91c6487a9..f702820c6 100644 --- a/lib/deleteaction.php +++ b/lib/deleteaction.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for deleting things * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Personal - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } diff --git a/lib/designsettings.php b/lib/designsettings.php index a48ec9d22..fe4222597 100644 --- a/lib/designsettings.php +++ b/lib/designsettings.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Change user password * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Settings - * @package Laconica - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @author Zach Copley <zach@controlyourself.ca> - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Sarven Capadisli <csarven@status.net> + * @author Zach Copley <zach@status.net> + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -42,11 +42,11 @@ require_once INSTALLDIR . '/lib/webcolor.php'; * background images, and fetching a default design * * @category Settings - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class DesignSettingsAction extends AccountSettingsAction @@ -326,6 +326,7 @@ class DesignSettingsAction extends AccountSettingsAction $this->script('js/farbtastic/farbtastic.js'); $this->script('js/farbtastic/farbtastic.go.js'); + $this->script('js/userdesign.go.js'); } /** diff --git a/lib/disfavorform.php b/lib/disfavorform.php index 45a9ddb1d..5b135b38a 100644 --- a/lib/disfavorform.php +++ b/lib/disfavorform.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Form for disfavoring a notice * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for disfavoring a notice * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see FavorForm */ diff --git a/lib/error.php b/lib/error.php index 3127c83fe..0c521db08 100644 --- a/lib/error.php +++ b/lib/error.php @@ -6,14 +6,14 @@ * PHP version 5 * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ * - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -29,7 +29,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,10 +37,10 @@ if (!defined('LACONICA')) { * Base class for displaying HTTP errors * * @category Action - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ErrorAction extends Action { diff --git a/lib/event.php b/lib/event.php index 4ccee17e6..4819b71b4 100644 --- a/lib/event.php +++ b/lib/event.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * utilities for defining and running event handlers * @@ -20,27 +20,27 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Event - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } /** * Class for events * - * This "class" two static functions for managing events in the Laconica code. + * This "class" two static functions for managing events in the StatusNet code. * * @category Event - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @todo Define a system for using Event instances */ @@ -54,7 +54,7 @@ class Event { /** * Add an event handler * - * To run some code at a particular point in Laconica processing. + * To run some code at a particular point in StatusNet processing. * Named events include receiving an XMPP message, adding a new notice, * or showing part of an HTML page. * diff --git a/lib/facebookaction.php b/lib/facebookaction.php index 1e0b2bda7..411f79594 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Low-level generator for HTML * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Faceboook - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -95,6 +95,7 @@ class FacebookAction extends Action function showStylesheets() { $this->cssLink('css/display.css', 'base'); + $this->cssLink('css/display.css',null,'screen, projection, tv'); $this->cssLink('css/facebookapp.css', 'base'); } @@ -363,7 +364,7 @@ class FacebookAction extends Action display:inline-block; } - #facebook_laconica_app { + #facebook_statusnet_app { text-indent:-9999px; height:16px; width:16px; @@ -662,7 +663,7 @@ class FacebookProfileBoxNotice extends FacebookNoticeListItem $this->app_uri = 'http://apps.facebook.com/' . $app_props['canvas_name']; $this->app_name = $app_props['application_name']; - $this->out->elementStart('a', array('id' => 'facebook_laconica_app', + $this->out->elementStart('a', array('id' => 'facebook_statusnet_app', 'href' => $this->app_uri)); $this->out->text($this->app_name); $this->out->elementEnd('a'); diff --git a/lib/facebookutil.php b/lib/facebookutil.php index e31a71f5e..f5121609d 100644 --- a/lib/facebookutil.php +++ b/lib/facebookutil.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -109,7 +109,6 @@ function facebookBroadcastNotice($notice) $can_update = $facebook->api_client->users_hasAppPermission('status_update', $fbuid); - if (!empty($attachments) && $can_publish == 1) { $fbattachment = format_attachments($attachments); $facebook->api_client->stream_publish($status, $fbattachment, @@ -178,20 +177,42 @@ function format_attachments($attachments) $fbattachment = array(); $fbattachment['media'] = array(); - // Facebook only supports one attachment per item + foreach($attachments as $attachment) + { + if($enclosure = $attachment->getEnclosure()){ + $fbmedia = get_fbmedia_for_attachment($enclosure); + }else{ + $fbmedia = get_fbmedia_for_attachment($attachment); + } + if($fbmedia){ + $fbattachment['media'][]=$fbmedia; + }else{ + $fbattachment['name'] = ($attachment->title ? + $attachment->title : $attachment->url); + $fbattachment['href'] = $attachment->url; + } + } + if(count($fbattachment['media'])>0){ + unset($fbattachment['name']); + unset($fbattachment['href']); + } + return $fbattachment; +} - $attachment = $attachments[0]; +/** +* given an File objects, returns an associative array suitable for Facebook media +*/ +function get_fbmedia_for_attachment($attachment) +{ $fbmedia = array(); if (strncmp($attachment->mimetype, 'image/', strlen('image/')) == 0) { $fbmedia['type'] = 'image'; $fbmedia['src'] = $attachment->url; $fbmedia['href'] = $attachment->url; - $fbattachment['media'][] = $fbmedia; } else if ($attachment->mimetype == 'audio/mpeg') { $fbmedia['type'] = 'mp3'; $fbmedia['src'] = $attachment->url; - $fbattachment['media'][] = $fbmedia; }else if ($attachment->mimetype == 'application/x-shockwave-flash') { $fbmedia['type'] = 'flash'; @@ -200,14 +221,10 @@ function format_attachments($attachments) // $fbmedia['imgsrc']=''; $fbmedia['swfsrc'] = $attachment->url; - $fbattachment['media'][] = $fbmedia; }else{ - $fbattachment['name'] = ($attachment->title ? - $attachment->title : $attachment->url); - $fbattachment['href'] = $attachment->url; + return false; } - - return $fbattachment; + return $fbmedia; } function remove_facebook_app($flink) diff --git a/lib/favorform.php b/lib/favorform.php index f3a7a9756..625df7c8b 100644 --- a/lib/favorform.php +++ b/lib/favorform.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Form for favoring a notice * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for favoring a notice * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see DisfavorForm */ diff --git a/lib/featureduserssection.php b/lib/featureduserssection.php index 4b9238d47..f0753a25e 100644 --- a/lib/featureduserssection.php +++ b/lib/featureduserssection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Section for featured users * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Section for featured users * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class FeaturedUsersSection extends ProfileSection diff --git a/lib/feed.php b/lib/feed.php index 466926844..e9fb6fdff 100644 --- a/lib/feed.php +++ b/lib/feed.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Data structure for info about syndication feeds (RSS 1.0, RSS 2.0, Atom) * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Feed - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,11 +37,11 @@ if (!defined('LACONICA')) { * This structure is a helpful container for shipping around information about syndication feeds. * * @category Feed - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class Feed diff --git a/lib/feedlist.php b/lib/feedlist.php index 927e43c33..9ae83f5e8 100644 --- a/lib/feedlist.php +++ b/lib/feedlist.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Widget for showing a list of feeds * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ if (!defined('LACONICA')) { * Typically used for Action::showExportList() * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see Action::showExportList() */ diff --git a/lib/form.php b/lib/form.php index f872aef0b..87b7a5cba 100644 --- a/lib/form.php +++ b/lib/form.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for forms * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -41,11 +41,11 @@ require_once INSTALLDIR.'/lib/widget.php'; * lets us abstract out the basic features of the form. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see HTMLOutputter */ diff --git a/lib/galleryaction.php b/lib/galleryaction.php index b389fc00f..18cc7b929 100644 --- a/lib/galleryaction.php +++ b/lib/galleryaction.php @@ -1,7 +1,7 @@ <?php /** - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } diff --git a/lib/groupdesignaction.php b/lib/groupdesignaction.php index c7cdff1fe..3eb3964e8 100644 --- a/lib/groupdesignaction.php +++ b/lib/groupdesignaction.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for actions that use the current user's design * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Action - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,10 +38,10 @@ if (!defined('LACONICA')) { * This superclass returns that design. * * @category Action - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * */ class GroupDesignAction extends Action { diff --git a/lib/groupeditform.php b/lib/groupeditform.php index 47e62d469..433f6a138 100644 --- a/lib/groupeditform.php +++ b/lib/groupeditform.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Form for editing a group * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for editing a group * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see UnsubscribeForm */ diff --git a/lib/grouplist.php b/lib/grouplist.php index 1ded5160b..b41c5b5f8 100644 --- a/lib/grouplist.php +++ b/lib/grouplist.php @@ -1,7 +1,7 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Widget to show a list of groups * @@ -21,14 +21,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Public - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,10 +40,10 @@ define('GROUPS_PER_PAGE', 20); * Widget to show a list of groups * * @category Public - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class GroupList extends Widget diff --git a/lib/groupminilist.php b/lib/groupminilist.php index ae2d237f1..dff81eff5 100644 --- a/lib/groupminilist.php +++ b/lib/groupminilist.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Widget to show a mini-list of groups * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Public - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -39,10 +39,10 @@ define('GROUPS_PER_MINILIST', 27); * Widget to show a list of groups, good for sidebar * * @category Public - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class GroupMiniList extends GroupList diff --git a/lib/groupnav.php b/lib/groupnav.php index 9e530c447..31cf378c8 100644 --- a/lib/groupnav.php +++ b/lib/groupnav.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Tabset for a particular group * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,11 +40,11 @@ require_once INSTALLDIR.'/lib/widget.php'; * Shows a group of tabs for a particular user group * * @category Output - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see HTMLOutputter */ diff --git a/lib/groupsbymemberssection.php b/lib/groupsbymemberssection.php index ad4884bf8..19b35eddb 100644 --- a/lib/groupsbymemberssection.php +++ b/lib/groupsbymemberssection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Groups with the most members section * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Groups with the most members section * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class GroupsByMembersSection extends GroupSection diff --git a/lib/groupsbypostssection.php b/lib/groupsbypostssection.php index dc7925d5e..45d49aba6 100644 --- a/lib/groupsbypostssection.php +++ b/lib/groupsbypostssection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Groups with the most posts section * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Groups with the most posts section * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class GroupsByPostsSection extends GroupSection diff --git a/lib/groupsection.php b/lib/groupsection.php index c19299493..7327f9e1a 100644 --- a/lib/groupsection.php +++ b/lib/groupsection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for sections showing lists of groups * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,10 +40,10 @@ define('GROUPS_PER_SECTION', 6); * group, or site. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class GroupSection extends Section diff --git a/lib/grouptagcloudsection.php b/lib/grouptagcloudsection.php index 0e0cbdd63..091cf4845 100644 --- a/lib/grouptagcloudsection.php +++ b/lib/grouptagcloudsection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Personal tag cloud section * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Group tag cloud section * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class GroupTagCloudSection extends TagCloudSection diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index 683a5e0b7..8ad7dc20f 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Low-level generator for HTML * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Output - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -47,11 +47,11 @@ define('PAGE_TYPE_PREFS', * HTML-creation class. * * @category Output - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see Action * @see XMLOutputter @@ -352,7 +352,7 @@ class HTMLOutputter extends XMLOutputter $url = parse_url($src); if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment)) { - $src = common_path($src) . '?version=' . LACONICA_VERSION; + $src = common_path($src) . '?version=' . STATUSNET_VERSION; } $this->element('script', array('type' => $type, 'src' => $src), @@ -374,7 +374,7 @@ class HTMLOutputter extends XMLOutputter if( empty($url->scheme) && empty($url->host) && empty($url->query) && empty($url->fragment)) { if(file_exists(theme_file($src,$theme))){ - $src = theme_path($src, $theme) . '?version=' . LACONICA_VERSION; + $src = theme_path($src, $theme) . '?version=' . STATUSNET_VERSION; }else{ $src = common_path($src); } diff --git a/lib/imagefile.php b/lib/imagefile.php index 52e4c4b22..88f461481 100644 --- a/lib/imagefile.php +++ b/lib/imagefile.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Abstraction for an image file * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Image - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Zach Copley <zach@controlyourself.ca> - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Zach Copley <zach@status.net> + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ if (!defined('LACONICA')) { * Makes it slightly easier to accept an image file from upload. * * @category Image - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ImageFile diff --git a/lib/jabber.php b/lib/jabber.php index e15076160..3dcdce5db 100644 --- a/lib/jabber.php +++ b/lib/jabber.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * utility functions for Jabber/GTalk/XMPP messages * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Network - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -67,7 +67,7 @@ function jabber_normalize_jid($jid) } /** - * the JID of the Jabber daemon for this Laconica instance + * the JID of the Jabber daemon for this StatusNet instance * * @return string JID of the Jabber daemon */ @@ -309,7 +309,7 @@ function jabber_special_presence($type, $to=null, $show=null, $status=null) * who have Jabber addresses, and have Jabber notification enabled, and * have this subscription enabled for Jabber. It also sends the notice to * all recipients of @-replies who have Jabber addresses and Jabber notification - * enabled. This is really the heart of Jabber distribution in Laconica. + * enabled. This is really the heart of Jabber distribution in StatusNet. * * @param Notice $notice The notice to broadcast * diff --git a/lib/joinform.php b/lib/joinform.php index 1edb2f72d..aefb553aa 100644 --- a/lib/joinform.php +++ b/lib/joinform.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Form for joining a group * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for joining a group * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see UnsubscribeForm */ diff --git a/lib/jsonsearchresultslist.php b/lib/jsonsearchresultslist.php index 34a3d530e..569bfa873 100644 --- a/lib/jsonsearchresultslist.php +++ b/lib/jsonsearchresultslist.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * widget for displaying a list of notices * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Search - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * widget-like class for showing JSON search results * * @category Search - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * */ @@ -147,10 +147,10 @@ class JSONSearchResultsList * widget for displaying a single JSON search result * * @category UI - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * @see JSONSearchResultsList */ diff --git a/lib/language.php b/lib/language.php index 9ad2d31bd..561a4ddb8 100644 --- a/lib/language.php +++ b/lib/language.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * utility functions for i18n * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category I18n - * @package Laconica + * @package StatusNet * @author Matthew Gregg <matthew.gregg@gmail.com> * @author Ciaran Gultnieks <ciaran@ciarang.com> - * @author Evan Prodromou <evan@controlyourself.ca> + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } diff --git a/lib/leaveform.php b/lib/leaveform.php index 696559a25..e63d96ee8 100644 --- a/lib/leaveform.php +++ b/lib/leaveform.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Form for leaving a group * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for leaving a group * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see UnsubscribeForm */ diff --git a/lib/logingroupnav.php b/lib/logingroupnav.php index 59f313302..b545fbf26 100644 --- a/lib/logingroupnav.php +++ b/lib/logingroupnav.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Menu for login group of actions * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Menu - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,10 +37,10 @@ require_once INSTALLDIR.'/lib/widget.php'; * Menu for login group of actions * * @category Output - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see Widget */ diff --git a/lib/mail.php b/lib/mail.php index 2e471fd6d..df585406c 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * utilities for sending email * @@ -20,17 +20,17 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Mail - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Zach Copley <zach@controlyourself.ca> - * @author Robin Millette <millette@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Zach Copley <zach@status.net> + * @author Robin Millette <millette@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -692,11 +692,11 @@ function mail_facebook_app_removed($user) $site_name = common_config('site', 'name'); $subject = sprintf( - _('Your %1\$s Facebook application access has been disabled.', + _('Your %1$s Facebook application access has been disabled.', $site_name)); $body = sprintf(_("Hi, %1\$s. We're sorry to inform you that we are " . - 'unable to update your Facebook status from %2\$s, and have disabled ' . + 'unable to update your Facebook status from %2$s, and have disabled ' . 'the Facebook application for your account. This may be because ' . 'you have removed the Facebook application\'s authorization, or ' . 'have deleted your Facebook account. You can re-enable the ' . diff --git a/lib/mailbox.php b/lib/mailbox.php index f1f6e98c1..e1d384a06 100644 --- a/lib/mailbox.php +++ b/lib/mailbox.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * common superclass for direct messages inbox and outbox * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Message - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,10 +37,10 @@ define('MESSAGES_PER_PAGE', 20); * common superclass for direct messages inbox and outbox * * @category Message - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * @see InboxAction * @see OutboxAction */ @@ -213,26 +213,20 @@ class MailboxAction extends CurrentUserDesignAction } $this->elementStart('div', 'entry-content'); - $this->elementStart('dl', 'timestamp'); - $this->element('dt', null, _('Published')); - $this->elementStart('dd', null); - $dt = common_date_iso8601($message->created); $this->elementStart('a', array('rel' => 'bookmark', + 'class' => 'timestamp', 'href' => $messageurl)); + $dt = common_date_iso8601($message->created); $this->element('abbr', array('class' => 'published', 'title' => $dt), common_date_string($message->created)); $this->elementEnd('a'); - $this->elementEnd('dd'); - $this->elementEnd('dl'); if ($message->source) { - $this->elementStart('dl', 'device'); - $this->elementStart('dt'); - $this->text(_('From')); - $this->elementEnd('dt'); - $this->showSource($message->source); - $this->elementEnd('dl'); + $this->elementStart('span', 'source'); + $this->text(_('from')); + $this->element('span', 'device', $this->showSource($message->source)); + $this->elementEnd('span'); } $this->elementEnd('div'); @@ -277,18 +271,18 @@ class MailboxAction extends CurrentUserDesignAction case 'mail': case 'omb': case 'api': - $this->element('dd', null, $source_name); + $this->element('span', 'device', $source_name); break; default: $ns = Notice_source::staticGet($source); if ($ns) { - $this->elementStart('dd', null); + $this->elementStart('span', 'device'); $this->element('a', array('href' => $ns->url, - 'rel' => 'external'), - $ns->name); - $this->elementEnd('dd'); + 'rel' => 'external'), + $ns->name); + $this->elementEnd('span'); } else { - $this->element('dd', null, $source_name); + $this->out->element('span', 'device', $source_name); } break; } diff --git a/lib/messageform.php b/lib/messageform.php index 044fdc719..e25ebfa08 100644 --- a/lib/messageform.php +++ b/lib/messageform.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Form for posting a direct message * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for posting a direct message * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see HTMLOutputter */ diff --git a/lib/microid.php b/lib/microid.php index 806b7ee7d..e2e7d7607 100644 --- a/lib/microid.php +++ b/lib/microid.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Microid class * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category ID - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * A class for microids * * @category ID - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * @see http://microid.org/ */ diff --git a/lib/noticeform.php b/lib/noticeform.php index 35a21c6bd..cee46709e 100644 --- a/lib/noticeform.php +++ b/lib/noticeform.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Form for posting a notice * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,11 +40,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Frequently-used form for posting a notice * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see HTMLOutputter */ diff --git a/lib/noticelist.php b/lib/noticelist.php index 5429d943f..ec85e4a5c 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * widget for displaying a list of notices * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category UI - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -45,10 +45,10 @@ require_once INSTALLDIR.'/lib/attachmentlist.php'; * data for e.g. the profile page. * * @category UI - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * @see Notice * @see NoticeListItem * @see ProfileNoticeList @@ -133,10 +133,10 @@ class NoticeList extends Widget * author info (since that's implicit by the data in the page). * * @category UI - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * @see NoticeList * @see ProfileNoticeListItem */ diff --git a/lib/noticesection.php b/lib/noticesection.php index ca1432686..b223932ef 100644 --- a/lib/noticesection.php +++ b/lib/noticesection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for sections showing lists of notices * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,10 +40,10 @@ define('NOTICES_PER_SECTION', 6); * group, or site. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class NoticeSection extends Section diff --git a/lib/nudgeform.php b/lib/nudgeform.php index 7380462a7..3f13b5846 100644 --- a/lib/nudgeform.php +++ b/lib/nudgeform.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Form for nudging a user * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for nudging a user * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see DisfavorForm */ diff --git a/lib/oauthclient.php b/lib/oauthclient.php index b66a24be4..f1827726e 100644 --- a/lib/oauthclient.php +++ b/lib/oauthclient.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for doing OAuth calls as a consumer * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Action - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,10 +37,10 @@ require_once 'OAuth.php'; * Exception wrapper for cURL errors * * @category Integration - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * */ class OAuthClientCurlException extends Exception @@ -51,10 +51,10 @@ class OAuthClientCurlException extends Exception * Base class for doing OAuth calls as a consumer * * @category Integration - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * */ class OAuthClient @@ -191,7 +191,7 @@ class OAuthClient CURLOPT_FAILONERROR => true, CURLOPT_HEADER => false, CURLOPT_FOLLOWLOCATION => true, - CURLOPT_USERAGENT => 'Laconica', + CURLOPT_USERAGENT => 'StatusNet', CURLOPT_CONNECTTIMEOUT => 120, CURLOPT_TIMEOUT => 120, CURLOPT_HTTPAUTH => CURLAUTH_ANY, diff --git a/lib/oauthstore.php b/lib/oauthstore.php index 87d8cf213..e69a00f55 100644 --- a/lib/oauthstore.php +++ b/lib/oauthstore.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,13 +17,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { - exit(1); -} +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once 'libomb/datastore.php'; -class LaconicaDataStore extends OMB_Datastore +class StatusNetOAuthDataStore extends OAuthDataStore { // We keep a record of who's contacted us diff --git a/lib/omb.php b/lib/omb.php index b9d0eef64..0566701ff 100644 --- a/lib/omb.php +++ b/lib/omb.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,9 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { - exit(1); -} +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once INSTALLDIR.'/lib/oauthstore.php'; require_once 'OAuth.php'; @@ -52,7 +50,7 @@ function omb_oauth_datastore() { static $store = null; if (is_null($store)) { - $store = new LaconicaDataStore(); + $store = new StatusNetOAuthDataStore(); } return $store; } @@ -137,7 +135,7 @@ function omb_broadcast_profile($profile) common_debug('Posting to ' . $rp->updateprofileurl, __FILE__); /* Update profile. */ - $service = new Laconica_OMB_Service_Consumer( + $service = new StatusNet_OMB_Service_Consumer( array(OMB_ENDPOINT_UPDATEPROFILE => $rp->updateprofileurl)); try { $service->setToken($rp->token, $rp->secret); @@ -155,7 +153,7 @@ function omb_broadcast_profile($profile) return; } -class Laconica_OMB_Service_Consumer extends OMB_Service_Consumer { +class StatusNet_OMB_Service_Consumer extends OMB_Service_Consumer { public function __construct($urls) { $this->services = $urls; diff --git a/lib/ownerdesignaction.php b/lib/ownerdesignaction.php index b42df926d..d557f10c0 100644 --- a/lib/ownerdesignaction.php +++ b/lib/ownerdesignaction.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for actions that use the page owner's design * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -39,10 +39,10 @@ if (!defined('LACONICA')) { * design. * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * */ diff --git a/lib/parallelizingdaemon.php b/lib/parallelizingdaemon.php index dc28b5643..517115de0 100644 --- a/lib/parallelizingdaemon.php +++ b/lib/parallelizingdaemon.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for making daemons that can do several tasks in parallel. * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Daemon - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ declare(ticks = 1); * Daemon able to spawn multiple child processes to do work in parallel * * @category Daemon - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ParallelizingDaemon extends Daemon diff --git a/lib/personalgroupnav.php b/lib/personalgroupnav.php index acc033667..cdde1feca 100644 --- a/lib/personalgroupnav.php +++ b/lib/personalgroupnav.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for all actions (~views) * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -44,11 +44,11 @@ require_once INSTALLDIR.'/lib/widget.php'; * model classes to read and write to the database; and doing ouput. * * @category Output - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see HTMLOutputter */ diff --git a/lib/personaltagcloudsection.php b/lib/personaltagcloudsection.php index 978153a84..0b29d58ca 100644 --- a/lib/personaltagcloudsection.php +++ b/lib/personaltagcloudsection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Personal tag cloud section * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Personal tag cloud section * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class PersonalTagCloudSection extends TagCloudSection diff --git a/lib/ping.php b/lib/ping.php index d26c73417..175bf8440 100644 --- a/lib/ping.php +++ b/lib/ping.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } function ping_broadcast_notice($notice) { @@ -47,7 +47,7 @@ function ping_broadcast_notice($notice) { $context = stream_context_create(array('http' => array('method' => "POST", 'header' => "Content-Type: text/xml\r\n". - "User-Agent: Laconica/".LACONICA_VERSION."\r\n", + "User-Agent: StatusNet/".STATUSNET_VERSION."\r\n", 'content' => $req))); $file = file_get_contents($notify_url, false, $context); @@ -81,11 +81,11 @@ function ping_broadcast_notice($notice) { if ($type === 'get') { $result = $fetcher->get($notify_url . '?' . http_build_query($args), - array('User-Agent: Laconica/'.LACONICA_VERSION)); + array('User-Agent: StatusNet/'.STATUSNET_VERSION)); } else { $result = $fetcher->post($notify_url, http_build_query($args), - array('User-Agent: Laconica/'.LACONICA_VERSION)); + array('User-Agent: StatusNet/'.STATUSNET_VERSION)); } if ($result->status != '200') { common_log(LOG_WARNING, diff --git a/lib/plugin.php b/lib/plugin.php index 7b2436e54..59bf3ba9d 100644 --- a/lib/plugin.php +++ b/lib/plugin.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Utility class for plugins * @@ -20,21 +20,21 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Plugin - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } /** * Base class for plugins * - * A base class for Laconica plugins. Mostly a light wrapper around + * A base class for StatusNet plugins. Mostly a light wrapper around * the Event framework. * * Subclasses of Plugin will automatically handle an event if they define @@ -45,10 +45,10 @@ if (!defined('LACONICA')) { * initialize() and cleanup() methods, respectively. * * @category Plugin - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see Event */ @@ -76,4 +76,18 @@ class Plugin { return true; } + + /* + * the name of the shortener + * shortenerInfo associative array with additional information. One possible element is 'freeService' which can be true or false + * shortener array, first element is the name of the class, second element is an array to be passed as constructor parameters to the class + */ + function registerUrlShortener($name, $shortenerInfo, $shortener) + { + global $_shorteners; + if(!is_array($_shorteners)){ + $_shorteners=array(); + } + $_shorteners[$name]=array('info'=>$shortenerInfo, 'callInfo'=>$shortener); + } } diff --git a/lib/popularnoticesection.php b/lib/popularnoticesection.php index 167a6ff8d..35b914a50 100644 --- a/lib/popularnoticesection.php +++ b/lib/popularnoticesection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for sections showing lists of notices * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,10 +38,10 @@ if (!defined('LACONICA')) { * group, or site. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class PopularNoticeSection extends NoticeSection diff --git a/lib/profileaction.php b/lib/profileaction.php index 9e9c79c78..e3a39ad8b 100644 --- a/lib/profileaction.php +++ b/lib/profileaction.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Common parent of Personal and Profile actions * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Personal - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -41,10 +41,10 @@ require_once INSTALLDIR.'/lib/groupminilist.php'; * Abstracts out common code from profile and personal tabs * * @category Personal - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ProfileAction extends OwnerDesignAction diff --git a/lib/profilelist.php b/lib/profilelist.php index 774538a4b..331430b3e 100644 --- a/lib/profilelist.php +++ b/lib/profilelist.php @@ -1,7 +1,7 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Widget to show a list of profiles * @@ -21,14 +21,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Public - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/widget.php'; * Widget to show a list of profiles * * @category Public - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ProfileList extends Widget diff --git a/lib/profileminilist.php b/lib/profileminilist.php index 357b4a2db..079170d80 100644 --- a/lib/profileminilist.php +++ b/lib/profileminilist.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Widget to show a list of profiles * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Public - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -39,10 +39,10 @@ define('PROFILES_PER_MINILIST', 27); * Widget to show a list of profiles, good for sidebar * * @category Public - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ProfileMiniList extends ProfileList diff --git a/lib/profilesection.php b/lib/profilesection.php index d463a07b0..504b1b7f7 100644 --- a/lib/profilesection.php +++ b/lib/profilesection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for sections showing lists of people * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,10 +40,10 @@ define('PROFILES_PER_SECTION', 6); * group, or site. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ProfileSection extends Section diff --git a/lib/publicgroupnav.php b/lib/publicgroupnav.php index 485d25e20..ae9cbdebb 100644 --- a/lib/publicgroupnav.php +++ b/lib/publicgroupnav.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Menu for public group of actions * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Menu - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,11 +37,11 @@ require_once INSTALLDIR.'/lib/widget.php'; * Menu for public group of actions * * @category Output - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see Widget */ diff --git a/lib/queuehandler.php b/lib/queuehandler.php index f11e5bd90..8c65a97c6 100644 --- a/lib/queuehandler.php +++ b/lib/queuehandler.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/daemon.php'); require_once(INSTALLDIR.'/classes/Queue_item.php'); @@ -75,6 +75,7 @@ class QueueHandler extends Daemon function run() { if (!$this->start()) { + $this->log(LOG_WARNING, 'failed to start'); return false; } @@ -87,9 +88,15 @@ class QueueHandler extends Daemon $qm->service($queue, $this); + $this->log(LOG_INFO, 'finished servicing the queue'); + if (!$this->finish()) { + $this->log(LOG_WARNING, 'failed to clean up'); return false; } + + $this->log(LOG_INFO, 'terminating normally'); + return true; } diff --git a/lib/queuemanager.php b/lib/queuemanager.php index 582c24790..43105b7a8 100644 --- a/lib/queuemanager.php +++ b/lib/queuemanager.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Abstract class for queue managers * @@ -20,12 +20,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category QueueManager - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class QueueManager diff --git a/lib/router.php b/lib/router.php index 5bffdb16b..f122c2b64 100644 --- a/lib/router.php +++ b/lib/router.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * URL routing utilities * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category URL - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -39,10 +39,10 @@ require_once 'Net/URL/Mapper.php'; * Cheap wrapper around Net_URL_Mapper * * @category URL - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class Router @@ -388,30 +388,36 @@ class Router array('action' => 'api', 'apiaction' => 'help')); - // laconica + // statusnet - $m->connect('api/laconica/:method', + $m->connect('api/statusnet/:method', array('action' => 'api', - 'apiaction' => 'laconica')); + 'apiaction' => 'statusnet')); + + // For older methods, we provide "laconica" base action $m->connect('api/laconica/:method', array('action' => 'api', - 'apiaction' => 'laconica')); + 'apiaction' => 'statusnet')); + + // Groups and tags are newer than 0.8.1 so no backward-compatibility + // necessary // Groups //'list' has to be handled differently, as php will not allow a method to be named 'list' - $m->connect('api/laconica/groups/list/:argument', + $m->connect('api/statusnet/groups/list/:argument', array('action' => 'api', 'method' => 'list_groups', 'apiaction' => 'groups')); + foreach (array('xml', 'json', 'rss', 'atom') as $e) { - $m->connect('api/laconica/groups/list.' . $e, + $m->connect('api/statusnet/groups/list.' . $e, array('action' => 'api', 'method' => 'list_groups.' . $e, 'apiaction' => 'groups')); } - $m->connect('api/laconica/groups/:method', + $m->connect('api/statusnet/groups/:method', array('action' => 'api', 'apiaction' => 'statuses'), array('method' => '(list_all|)(\.(atom|rss|xml|json))?')); @@ -421,20 +427,20 @@ class Router 'apiaction' => 'statuses'), array('method' => '(|user_timeline|friends_timeline|replies|mentions|show|destroy|friends|followers)')); - $m->connect('api/laconica/groups/:method/:argument', + $m->connect('api/statusnet/groups/:method/:argument', array('action' => 'api', 'apiaction' => 'groups')); - $m->connect('api/laconica/groups/:method', + $m->connect('api/statusnet/groups/:method', array('action' => 'api', 'apiaction' => 'groups')); // Tags - $m->connect('api/laconica/tags/:method/:argument', + $m->connect('api/statusnet/tags/:method/:argument', array('action' => 'api', 'apiaction' => 'tags')); - $m->connect('api/laconica/tags/:method', + $m->connect('api/statusnet/tags/:method', array('action' => 'api', 'apiaction' => 'tags')); diff --git a/lib/rssaction.php b/lib/rssaction.php index 0aca96566..dd0f1005a 100644 --- a/lib/rssaction.php +++ b/lib/rssaction.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for RSS 1.0 feed actions * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Mail - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @author Earle Martin <earle@downlode.org> - * @copyright 2008-9 Control Yourself, Inc. + * @copyright 2008-9 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } define('DEFAULT_RSS_LIMIT', 48); @@ -102,7 +102,7 @@ class Rss10Action extends Action if (!isset($_SERVER['PHP_AUTH_USER'])) { # This header makes basic auth go - header('WWW-Authenticate: Basic realm="Laconica RSS"'); + header('WWW-Authenticate: Basic realm="StatusNet RSS"'); # If the user hits cancel -- bam! $this->show_basic_auth_error(); @@ -244,7 +244,7 @@ class Rss10Action extends Action $this->element('dc:creator', null, ($profile->fullname) ? $profile->fullname : $profile->nickname); $this->element('foaf:maker', array('rdf:resource' => $creator_uri)); $this->element('sioc:has_creator', array('rdf:resource' => $creator_uri.'#acct')); - $this->element('laconica:postIcon', array('rdf:resource' => $profile->avatarUrl())); + $this->element('statusnet:postIcon', array('rdf:resource' => $profile->avatarUrl())); $this->element('cc:licence', array('rdf:resource' => common_config('license', 'url'))); if ($notice->reply_to) { $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to)); @@ -258,26 +258,27 @@ class Rss10Action extends Action $attachments = $notice->attachments(); if($attachments){ foreach($attachments as $attachment){ - if ($attachment->isEnclosure()) { + $enclosure=$attachment->getEnclosure(); + if ($enclosure) { // DO NOT move xmlns declaration to root element. Making it // the default namespace here improves compatibility with // real-world feed readers. $attribs = array( - 'rdf:resource' => $attachment->url, - 'url' => $attachment->url, + 'rdf:resource' => $enclosure->url, + 'url' => $enclosure->url, 'xmlns' => 'http://purl.oclc.org/net/rss_2.0/enc#' ); - if ($attachment->title) { - $attribs['dc:title'] = $attachment->title; + if ($enclosure->title) { + $attribs['dc:title'] = $enclosure->title; } - if ($attachment->modified) { - $attribs['dc:date'] = common_date_w3dtf($attachment->modified); + if ($enclosure->modified) { + $attribs['dc:date'] = common_date_w3dtf($enclosure->modified); } - if ($attachment->size) { - $attribs['length'] = $attachment->size; + if ($enclosure->size) { + $attribs['length'] = $enclosure->size; } - if ($attachment->mimetype) { - $attribs['type'] = $attachment->mimetype; + if ($enclosure->mimetype) { + $attribs['type'] = $enclosure->mimetype; } $this->element('enclosure', $attribs); } @@ -353,8 +354,8 @@ class Rss10Action extends Action 'http://rdfs.org/sioc/types#', 'xmlns:rdfs' => 'http://www.w3.org/2000/01/rdf-schema#', - 'xmlns:laconica' => - 'http://laconi.ca/ont/', + 'xmlns:statusnet' => + 'http://status.net/ont/', 'xmlns' => 'http://purl.org/rss/1.0/')); $this->elementStart('sioc:Site', array('rdf:about' => common_root_url())); $this->element('sioc:name', null, common_config('site', 'name')); diff --git a/lib/search_engines.php b/lib/search_engines.php index 7c26363fc..69f6ff468 100644 --- a/lib/search_engines.php +++ b/lib/search_engines.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } class SearchEngine { diff --git a/lib/searchaction.php b/lib/searchaction.php index 34fe9373f..0d9f85a8f 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -5,14 +5,14 @@ * PHP version 5 * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Robin Millette <millette@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Robin Millette <millette@status.net> * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ * - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -28,7 +28,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/searchgroupnav.php'; * Base search action class. * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Robin Millette <millette@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Robin Millette <millette@status.net> * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ */ class SearchAction extends Action { diff --git a/lib/searchgroupnav.php b/lib/searchgroupnav.php index 3ba3f9cd9..677365ea9 100644 --- a/lib/searchgroupnav.php +++ b/lib/searchgroupnav.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Menu for search actions * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Menu - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,10 +37,10 @@ require_once INSTALLDIR.'/lib/widget.php'; * Menu for public group of actions * * @category Output - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see Widget */ diff --git a/lib/section.php b/lib/section.php index d14575086..53a3a70fa 100644 --- a/lib/section.php +++ b/lib/section.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for sections (sidebar widgets) * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,10 +40,10 @@ require_once INSTALLDIR.'/lib/widget.php'; * group, or site. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class Section extends Widget diff --git a/lib/servererroraction.php b/lib/servererroraction.php index c46f3228b..c6400605e 100644 --- a/lib/servererroraction.php +++ b/lib/servererroraction.php @@ -6,14 +6,14 @@ * PHP version 5 * * @category Action - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ * - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -29,7 +29,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -47,10 +47,10 @@ require_once INSTALLDIR.'/lib/error.php'; * See: http://tools.ietf.org/html/rfc2616#section-10 * * @category Action - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> + * @package StatusNet + * @author Zach Copley <zach@status.net> * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ServerErrorAction extends ErrorAction diff --git a/lib/serverexception.php b/lib/serverexception.php index b8ed6846e..7dc9765ad 100644 --- a/lib/serverexception.php +++ b/lib/serverexception.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * class for a server exception (user error) * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Exception - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,10 +37,10 @@ if (!defined('LACONICA')) { * Subclass of PHP Exception for server errors. The user typically can't fix these. * * @category Exception - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class ServerException extends Exception diff --git a/lib/settingsaction.php b/lib/settingsaction.php index a923a98b2..c3669868d 100644 --- a/lib/settingsaction.php +++ b/lib/settingsaction.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for settings actions * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Settings - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Base class for settings group of actions * * @category Settings - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see Widget */ diff --git a/lib/snapshot.php b/lib/snapshot.php index 4b05b502d..ede846e5b 100644 --- a/lib/snapshot.php +++ b/lib/snapshot.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * A snapshot of site stats that can report itself to headquarters * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Stats - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -36,16 +36,16 @@ if (!defined('LACONICA')) { * * This class will collect statistics on the site and report them to * a statistics server of the admin's choice. (Default is the big one - * at laconi.ca.) + * at status.net.) * * It can either be called from a cron job, or run occasionally by the * Web site. * * @category Stats - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * */ @@ -125,7 +125,7 @@ class Snapshot // Some basic identification stuff - $this->stats['version'] = LACONICA_VERSION; + $this->stats['version'] = STATUSNET_VERSION; $this->stats['phpversion'] = phpversion(); $this->stats['name'] = common_config('site', 'name'); $this->stats['root'] = common_root_url(); @@ -181,7 +181,7 @@ class Snapshot 'header' => 'Content-type: '. 'application/x-www-form-urlencoded', 'content' => $postdata, - 'user_agent' => 'Laconica/'.LACONICA_VERSION + 'user_agent' => 'StatusNet/'.STATUSNET_VERSION ) ); diff --git a/lib/stompqueuemanager.php b/lib/stompqueuemanager.php index 46baeb5c7..f059b42f0 100644 --- a/lib/stompqueuemanager.php +++ b/lib/stompqueuemanager.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Abstract class for queue managers * @@ -20,12 +20,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category QueueManager - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ require_once 'Stomp.php'; diff --git a/lib/subgroupnav.php b/lib/subgroupnav.php index 520991923..2748b59e1 100644 --- a/lib/subgroupnav.php +++ b/lib/subgroupnav.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Local navigation for subscriptions group of pages * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Subs - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -37,10 +37,10 @@ require_once INSTALLDIR.'/lib/widget.php'; * Local nav menu for subscriptions, subscribers * * @category Subs - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class SubGroupNav extends Widget diff --git a/lib/subpeopletagcloudsection.php b/lib/subpeopletagcloudsection.php index 9f6948dc9..b23a82240 100644 --- a/lib/subpeopletagcloudsection.php +++ b/lib/subpeopletagcloudsection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Personal tag cloud section * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Personal tag cloud section * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class SubPeopleTagCloudSection extends TagCloudSection diff --git a/lib/subs.php b/lib/subs.php index e76023752..68c89c842 100644 --- a/lib/subs.php +++ b/lib/subs.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once('XMPPHP/XMPP.php'); diff --git a/lib/subscribeform.php b/lib/subscribeform.php index c65134e46..ae2a6db61 100644 --- a/lib/subscribeform.php +++ b/lib/subscribeform.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Form for subscribing to a user * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for subscribing to a user * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see UnsubscribeForm */ diff --git a/lib/subscriberspeopleselftagcloudsection.php b/lib/subscriberspeopleselftagcloudsection.php index 115241a53..5a570ae28 100644 --- a/lib/subscriberspeopleselftagcloudsection.php +++ b/lib/subscriberspeopleselftagcloudsection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Personal tag cloud section * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Personal tag cloud section * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class SubscribersPeopleSelfTagCloudSection extends SubPeopleTagCloudSection diff --git a/lib/subscriberspeopletagcloudsection.php b/lib/subscriberspeopletagcloudsection.php index 4dafbc1c7..284996b59 100644 --- a/lib/subscriberspeopletagcloudsection.php +++ b/lib/subscriberspeopletagcloudsection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Personal tag cloud section * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Personal tag cloud section * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class SubscribersPeopleTagCloudSection extends SubPeopleTagCloudSection diff --git a/lib/subscriptionlist.php b/lib/subscriptionlist.php index 23da64cca..89f63e321 100644 --- a/lib/subscriptionlist.php +++ b/lib/subscriptionlist.php @@ -1,7 +1,7 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Widget to show a list of profiles * @@ -21,14 +21,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Public - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2008-2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2008-2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/profilelist.php'; * Widget to show a list of subscriptions * * @category Public - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class SubscriptionList extends ProfileList diff --git a/lib/subscriptionspeopleselftagcloudsection.php b/lib/subscriptionspeopleselftagcloudsection.php index 3896294d2..9be60dfa1 100644 --- a/lib/subscriptionspeopleselftagcloudsection.php +++ b/lib/subscriptionspeopleselftagcloudsection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Personal tag cloud section * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Personal tag cloud section * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class SubscriptionsPeopleSelfTagCloudSection extends SubPeopleTagCloudSection diff --git a/lib/subscriptionspeopletagcloudsection.php b/lib/subscriptionspeopletagcloudsection.php index f9c8672e3..fde24b282 100644 --- a/lib/subscriptionspeopletagcloudsection.php +++ b/lib/subscriptionspeopletagcloudsection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Personal tag cloud section * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Personal tag cloud section * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class SubscriptionsPeopleTagCloudSection extends SubPeopleTagCloudSection diff --git a/lib/tagcloudsection.php b/lib/tagcloudsection.php index 62f7d8961..692f5d966 100644 --- a/lib/tagcloudsection.php +++ b/lib/tagcloudsection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for sections showing tag clouds * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,10 +40,10 @@ define('TAGS_PER_SECTION', 20); * group, or site. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class TagCloudSection extends Section diff --git a/lib/theme.php b/lib/theme.php index 2fe6ab69b..08e3e8538 100644 --- a/lib/theme.php +++ b/lib/theme.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Utilities for theme files and paths * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Paths - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } diff --git a/lib/topposterssection.php b/lib/topposterssection.php index 1a2ce0014..cbb6a98eb 100644 --- a/lib/topposterssection.php +++ b/lib/topposterssection.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for sections showing lists of people * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,10 +38,10 @@ if (!defined('LACONICA')) { * group, or site. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class TopPostersSection extends ProfileSection diff --git a/lib/twitterapi.php b/lib/twitterapi.php index 583007208..d199e4dee 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -88,7 +88,7 @@ class TwitterapiAction extends Action Avatar::defaultImage(AVATAR_STREAM_SIZE); $twitter_user['url'] = ($profile->homepage) ? $profile->homepage : null; - $twitter_user['protected'] = false; # not supported by Laconica yet + $twitter_user['protected'] = false; # not supported by StatusNet yet $twitter_user['followers_count'] = $profile->subscriberCount(); // To be supported soon... @@ -159,7 +159,7 @@ class TwitterapiAction extends Action $twitter_status = array(); $twitter_status['text'] = $notice->content; - $twitter_status['truncated'] = false; # Not possible on Laconica + $twitter_status['truncated'] = false; # Not possible on StatusNet $twitter_status['created_at'] = $this->date_twitter($notice->created); $twitter_status['in_reply_to_status_id'] = ($notice->reply_to) ? intval($notice->reply_to) : null; @@ -274,11 +274,12 @@ class TwitterapiAction extends Action $enclosures = array(); foreach ($attachments as $attachment) { - if ($attachment->isEnclosure()) { + $enclosure_o=$attachment->getEnclosure(); + if ($enclosure_o) { $enclosure = array(); - $enclosure['url'] = $attachment->url; - $enclosure['mimetype'] = $attachment->mimetype; - $enclosure['size'] = $attachment->size; + $enclosure['url'] = $enclosure_o->url; + $enclosure['mimetype'] = $enclosure_o->mimetype; + $enclosure['size'] = $enclosure_o->size; $enclosures[] = $enclosure; } } @@ -594,7 +595,6 @@ class TwitterapiAction extends Action $this->init_document('rss'); - $this->elementStart('channel'); $this->element('title', null, $title); $this->element('link', null, $link); if (!is_null($suplink)) { @@ -620,7 +620,6 @@ class TwitterapiAction extends Action } } - $this->elementEnd('channel'); $this->end_twitter_rss(); } @@ -667,7 +666,6 @@ class TwitterapiAction extends Action $this->init_document('rss'); - $this->elementStart('channel'); $this->element('title', null, $title); $this->element('link', null, $link); $this->element('description', null, $subtitle); @@ -686,7 +684,6 @@ class TwitterapiAction extends Action } } - $this->elementEnd('channel'); $this->end_twitter_rss(); } @@ -791,6 +788,52 @@ class TwitterapiAction extends Action $this->end_document('xml'); } + function show_twitter_xml_users($user) + { + + $this->init_document('xml'); + $this->elementStart('users', array('type' => 'array')); + + if (is_array($user)) { + foreach ($group as $g) { + $twitter_user = $this->twitter_user_array($g); + $this->show_twitter_xml_user($twitter_user,'user'); + } + } else { + while ($user->fetch()) { + $twitter_user = $this->twitter_user_array($user); + $this->show_twitter_xml_user($twitter_user); + } + } + + $this->elementEnd('users'); + $this->end_document('xml'); + } + + function show_json_users($user) + { + + $this->init_document('json'); + + $users = array(); + + if (is_array($user)) { + foreach ($user as $u) { + $twitter_user = $this->twitter_user_array($u); + array_push($users, $twitter_user); + } + } else { + while ($user->fetch()) { + $twitter_user = $this->twitter_user_array($user); + array_push($users, $twitter_user); + } + } + + $this->show_json_objects($users); + + $this->end_document('json'); + } + function show_single_json_group($group) { $this->init_document('json'); @@ -943,11 +986,14 @@ class TwitterapiAction extends Action function init_twitter_rss() { $this->startXML(); - $this->elementStart('rss', array('version' => '2.0')); + $this->elementStart('rss', array('version' => '2.0', 'xmlns:atom'=>'http://www.w3.org/2005/Atom')); + $this->elementStart('channel'); + Event::handle('StartApiRss', array($this)); } function end_twitter_rss() { + $this->elementEnd('channel'); $this->elementEnd('rss'); $this->endXML(); } @@ -959,6 +1005,7 @@ class TwitterapiAction extends Action $this->elementStart('feed', array('xmlns' => 'http://www.w3.org/2005/Atom', 'xml:lang' => 'en-US', 'xmlns:thr' => 'http://purl.org/syndication/thread/1.0')); + Event::handle('StartApiAtom', array($this)); } function end_twitter_atom() diff --git a/lib/twitterbasicauthclient.php b/lib/twitterbasicauthclient.php new file mode 100644 index 000000000..fd331fbdc --- /dev/null +++ b/lib/twitterbasicauthclient.php @@ -0,0 +1,236 @@ +<?php +/** + * StatusNet, the distributed open-source microblogging tool + * + * Class for doing OAuth calls against Twitter + * + * PHP version 5 + * + * LICENCE: This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @category Integration + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @copyright 2009 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET') && !defined('LACONICA')) { + exit(1); +} + +/** + * Exception wrapper for cURL errors + * + * @category Integration + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + * + */ +class BasicAuthCurlException extends Exception +{ +} + +/** + * Class for talking to the Twitter API with HTTP Basic Auth. + * + * @category Integration + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + * + */ +class TwitterBasicAuthClient +{ + var $screen_name = null; + var $password = null; + + /** + * constructor + * + * @param Foreign_link $flink a Foreign_link storing the + * Twitter user's password, etc. + */ + function __construct($flink) + { + $fuser = $flink->getForeignUser(); + $this->screen_name = $fuser->nickname; + $this->password = $flink->credentials; + } + + /** + * Calls Twitter's /statuses/update API method + * + * @param string $status text of the status + * @param int $in_reply_to_status_id optional id of the status it's + * a reply to + * + * @return mixed the status + */ + function statusesUpdate($status, $in_reply_to_status_id = null) + { + $url = 'https://twitter.com/statuses/update.json'; + $params = array('status' => $status, + 'source' => common_config('integration', 'source'), + 'in_reply_to_status_id' => $in_reply_to_status_id); + $response = $this->httpRequest($url, $params); + $status = json_decode($response); + return $status; + } + + /** + * Calls Twitter's /statuses/friends_timeline API method + * + * @param int $since_id show statuses after this id + * @param int $max_id show statuses before this id + * @param int $cnt number of statuses to show + * @param int $page page number + * + * @return mixed an array of statuses + */ + function statusesFriendsTimeline($since_id = null, $max_id = null, + $cnt = null, $page = null) + { + $url = 'https://twitter.com/statuses/friends_timeline.json'; + $params = array('since_id' => $since_id, + 'max_id' => $max_id, + 'count' => $cnt, + 'page' => $page); + $qry = http_build_query($params); + + if (!empty($qry)) { + $url .= "?$qry"; + } + + $response = $this->httpRequest($url); + $statuses = json_decode($response); + return $statuses; + } + + /** + * Calls Twitter's /statuses/friends API method + * + * @param int $id id of the user whom you wish to see friends of + * @param int $user_id numerical user id + * @param int $screen_name screen name + * @param int $page page number + * + * @return mixed an array of twitter users and their latest status + */ + function statusesFriends($id = null, $user_id = null, $screen_name = null, + $page = null) + { + $url = "https://twitter.com/statuses/friends.json"; + + $params = array('id' => $id, + 'user_id' => $user_id, + 'screen_name' => $screen_name, + 'page' => $page); + $qry = http_build_query($params); + + if (!empty($qry)) { + $url .= "?$qry"; + } + + $response = $this->httpRequest($url); + $friends = json_decode($response); + return $friends; + } + + /** + * Calls Twitter's /statuses/friends/ids API method + * + * @param int $id id of the user whom you wish to see friends of + * @param int $user_id numerical user id + * @param int $screen_name screen name + * @param int $page page number + * + * @return mixed a list of ids, 100 per page + */ + function friendsIds($id = null, $user_id = null, $screen_name = null, + $page = null) + { + $url = "https://twitter.com/friends/ids.json"; + + $params = array('id' => $id, + 'user_id' => $user_id, + 'screen_name' => $screen_name, + 'page' => $page); + $qry = http_build_query($params); + + if (!empty($qry)) { + $url .= "?$qry"; + } + + $response = $this->httpRequest($url); + $ids = json_decode($response); + return $ids; + } + + /** + * Make a HTTP request using cURL. + * + * @param string $url Where to make the request + * @param array $params post parameters + * + * @return mixed the request + */ + function httpRequest($url, $params = null, $auth = true) + { + $options = array( + CURLOPT_RETURNTRANSFER => true, + CURLOPT_FAILONERROR => true, + CURLOPT_HEADER => false, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_USERAGENT => 'StatusNet', + CURLOPT_CONNECTTIMEOUT => 120, + CURLOPT_TIMEOUT => 120, + CURLOPT_HTTPAUTH => CURLAUTH_ANY, + CURLOPT_SSL_VERIFYPEER => false, + + // Twitter is strict about accepting invalid "Expect" headers + + CURLOPT_HTTPHEADER => array('Expect:') + ); + + if (isset($params)) { + $options[CURLOPT_POST] = true; + $options[CURLOPT_POSTFIELDS] = $params; + } + + if ($auth) { + $options[CURLOPT_USERPWD] = $this->screen_name . + ':' . $this->password; + } + + $ch = curl_init($url); + curl_setopt_array($ch, $options); + $response = curl_exec($ch); + + if ($response === false) { + $msg = curl_error($ch); + $code = curl_errno($ch); + throw new BasicAuthCurlException($msg, $code); + } + + curl_close($ch); + + return $response; + } + +} diff --git a/lib/unblockform.php b/lib/unblockform.php index 6a8831b29..f1343757c 100644 --- a/lib/unblockform.php +++ b/lib/unblockform.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Form for unblocking a user * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for unblocking a user * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see BlockForm */ diff --git a/lib/unqueuemanager.php b/lib/unqueuemanager.php index 920313c0c..c5dc29d38 100644 --- a/lib/unqueuemanager.php +++ b/lib/unqueuemanager.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * A queue manager interface for just doing things immediately * @@ -20,12 +20,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category QueueManager - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ class UnQueueManager diff --git a/lib/unsubscribeform.php b/lib/unsubscribeform.php index ce91a1340..cb6a87515 100644 --- a/lib/unsubscribeform.php +++ b/lib/unsubscribeform.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Form for unsubscribing from a user * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -38,11 +38,11 @@ require_once INSTALLDIR.'/lib/form.php'; * Form for unsubscribing from a user * * @category Form - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see SubscribeForm */ diff --git a/lib/util.php b/lib/util.php index b798cfe15..0a25907c4 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -54,9 +54,9 @@ function common_init_language() $language = common_language(); // So we don't have to make people install the gettext locales $locale_set = common_init_locale($language); - bindtextdomain("laconica", common_config('site','locale_path')); - bind_textdomain_codeset("laconica", "UTF-8"); - textdomain("laconica"); + bindtextdomain("statusnet", common_config('site','locale_path')); + bind_textdomain_codeset("statusnet", "UTF-8"); + textdomain("statusnet"); setlocale(LC_CTYPE, 'C'); if(!$locale_set) { common_log(LOG_INFO,'Language requested:'.$language.' - locale could not be set:',__FILE__); @@ -404,7 +404,7 @@ function common_render_text($text) $r = preg_replace('/[\x{0}-\x{8}\x{b}-\x{c}\x{e}-\x{19}]/', '', $r); $r = common_replace_urls_callback($r, 'common_linkify'); - $r = preg_replace('/(^|\(|\[|\s+)#([\pL\pN_\-\.]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r); + $r = preg_replace('/(^|\"\;|\'|\(|\[|\{|\s+)#([\pL\pN_\-\.]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r); // XXX: machine tags return $r; } @@ -412,57 +412,107 @@ function common_render_text($text) function common_replace_urls_callback($text, $callback, $notice_id = null) { // Start off with a regex $regex = '#'. - '(?:^|\s+)('. + '(?:^|[\s\(\)\[\]\{\}\\\'\\\";]+)(?![\@\!\#])'. + '('. '(?:'. - '(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|irc)://'. - '|'. - '(?:mailto|aim|tel|xmpp):'. - ')?'. - '(?:'. - '(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'. //IPv4 - '|(?:'. - '(?:[0-9a-f]{1,4}:){1,1}(?::[0-9a-f]{1,4}){1,6}|'. //IPv6 - '(?:[0-9a-f]{1,4}:){1,2}(?::[0-9a-f]{1,4}){1,5}|'. - '(?:[0-9a-f]{1,4}:){1,3}(?::[0-9a-f]{1,4}){1,4}|'. - '(?:[0-9a-f]{1,4}:){1,4}(?::[0-9a-f]{1,4}){1,3}|'. - '(?:[0-9a-f]{1,4}:){1,5}(?::[0-9a-f]{1,4}){1,2}|'. - '(?:[0-9a-f]{1,4}:){1,6}(?::[0-9a-f]{1,4}){1,1}|'. - '(?:(?:[0-9a-f]{1,4}:){1,7}|:):|'. - ':(?::[0-9a-f]{1,4}){1,7}|'. - '(?:(?:(?:[0-9a-f]{1,4}:){6})(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3})|'. - '(?:(?:[0-9a-f]{1,4}:){5}[0-9a-f]{1,4}:(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3})|'. - '(?:[0-9a-f]{1,4}:){5}:[0-9a-f]{1,4}:(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}|'. - '(?:[0-9a-f]{1,4}:){1,1}(?::[0-9a-f]{1,4}){1,4}:(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}|'. - '(?:[0-9a-f]{1,4}:){1,2}(?::[0-9a-f]{1,4}){1,3}:(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}|'. - '(?:[0-9a-f]{1,4}:){1,3}(?::[0-9a-f]{1,4}){1,2}:(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}|'. - '(?:[0-9a-f]{1,4}:){1,4}(?::[0-9a-f]{1,4}){1,1}:(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}|'. - '(?:(?:[0-9a-f]{1,4}:){1,5}|:):(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}|'. - ':(?::[0-9a-f]{1,4}){1,5}:(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}'. - ')|'. - '(?:[^.\s/:]+\.)+'. //DNS - '(?:museum|travel|onion|[a-z]{2,4})'. + '(?:'. //Known protocols + '(?:'. + '(?:(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|irc)://)'. + '|'. + '(?:(?:mailto|aim|tel|xmpp):)'. + ')'. + '(?:[\pN\pL\-\_\+\%\~]+(?::[\pN\pL\-\_\+\%\~]+)?\@)?'. //user:pass@ + '(?:'. + '(?:'. + '\[[\pN\pL\-\_\:\.]+(?<![\.\:])\]'. //[dns] + ')|(?:'. + '[\pN\pL\-\_\:\.]+(?<![\.\:])'. //dns + ')'. + ')'. + ')'. + '|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'. //IPv4 + '|(?:'. //IPv6 + '\[?(?:(?:(?:[0-9A-Fa-f]{1,4}:){7}(?:(?:[0-9A-Fa-f]{1,4})|:))|(?:(?:[0-9A-Fa-f]{1,4}:){6}(?::|(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})|(?::[0-9A-Fa-f]{1,4})))|(?:(?:[0-9A-Fa-f]{1,4}:){5}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?:(?:[0-9A-Fa-f]{1,4}:){4}(?::[0-9A-Fa-f]{1,4}){0,1}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?:(?:[0-9A-Fa-f]{1,4}:){3}(?::[0-9A-Fa-f]{1,4}){0,2}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?:(?:[0-9A-Fa-f]{1,4}:){2}(?::[0-9A-Fa-f]{1,4}){0,3}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?:(?:[0-9A-Fa-f]{1,4}:)(?::[0-9A-Fa-f]{1,4}){0,4}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?::(?::[0-9A-Fa-f]{1,4}){0,5}(?:(?::(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|(?:(?::[0-9A-Fa-f]{1,4}){1,2})))|(?:(?:(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))\]?'. + ')|(?:'. //DNS + '(?:[\pN\pL\-\_\+\%\~]+(?:\:[\pN\pL\-\_\+\%\~]+)?\@)?'. //user:pass@ + '[\pN\pL\-\_]+(?:\.[\pN\pL\-\_]+)*\.'. + //tld list from http://data.iana.org/TLD/tlds-alpha-by-domain.txt, also added local, loc, and onion + '(?:AC|AD|AE|AERO|AF|AG|AI|AL|AM|AN|AO|AQ|AR|ARPA|AS|ASIA|AT|AU|AW|AX|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BIZ|BJ|BM|BN|BO|BR|BS|BT|BV|BW|BY|BZ|CA|CAT|CC|CD|CF|CG|CH|CI|CK|CL|CM|CN|CO|COM|COOP|CR|CU|CV|CX|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EDU|EE|EG|ER|ES|ET|EU|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GG|GH|GI|GL|GM|GN|GOV|GP|GQ|GR|GS|GT|GU|GW|GY|HK|HM|HN|HR|HT|HU|ID|IE|IL|IM|IN|INFO|INT|IO|IQ|IR|IS|IT|JE|JM|JO|JOBS|JP|KE|KG|KH|KI|KM|KN|KP|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MD|ME|MG|MH|MIL|MK|ML|MM|MN|MO|MOBI|MP|MQ|MR|MS|MT|MU|MUSEUM|MV|MW|MX|MY|MZ|NA|NAME|NC|NE|NET|NF|NG|NI|NL|NO|NP|NR|NU|NZ|OM|ORG|PA|PE|PF|PG|PH|PK|PL|PM|PN|PR|PRO|PS|PT|PW|PY|QA|RE|RO|RS|RU|RW|SA|SB|SC|SD|SE|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SR|ST|SU|SV|SY|SZ|TC|TD|TEL|TF|TG|TH|TJ|TK|TL|TM|TN|TO|TP|TR|TRAVEL|TT|TV|TW|TZ|UA|UG|UK|US|UY|UZ|VA|VC|VE|VG|VI|VN|VU|WF|WS|XN--0ZWM56D|测试|XN--11B5BS3A9AJ6G|परीक्षा|XN--80AKHBYKNJ4F|испытание|XN--9T4B11YI5A|테스트|XN--DEBA0AD|טעסט|XN--G6W251D|測試|XN--HGBK6AJ7F53BBA|آزمایشی|XN--HLCJ6AYA9ESC7A|பரிட்சை|XN--JXALPDLP|δοκιμή|XN--KGBECHTV|إختبار|XN--ZCKZAH|テスト|YE|YT|YU|ZA|ZM|ZW|local|loc|onion)'. + ')(?![\pN\pL\-\_])'. ')'. - '(?:[:/][^\s]*)?'. + '(?:'. + '(?:\:\d+)?'. //:port + '(?:/[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~]*)?'. // /path + '(?:\?[\pN\pL\$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\/]*)?'. // ?query string + '(?:\#[\pN\pL$\[\]\,\!\(\)\.\:\-\_\+\/\=\&\;\%\~\/\?\#]*)?'. // #fragment + ')(?<![\?\.\,\#\,])'. ')'. - '#ix'; - preg_match_all($regex, $text, $matches); - // Then clean up what the regex left behind - $offset = 0; - foreach($matches[1] as $url) { - // Call user specified func - if (empty($notice_id)) { - $modified_url = call_user_func($callback, $url); - } else { - $modified_url = call_user_func($callback, array($url, $notice_id)); + '#ixu'; + preg_match_all($regex,$text,$matches); + //print_r($matches); + return preg_replace_callback($regex, curry('callback_helper',$callback,$notice_id) ,$text); +} + +function callback_helper($matches, $callback, $notice_id) { + $url=$matches[1]; + $left = strpos($matches[0],$url); + $right = $left+strlen($url); + + $groupSymbolSets=array( + array( + 'left'=>'(', + 'right'=>')' + ), + array( + 'left'=>'[', + 'right'=>']' + ), + array( + 'left'=>'{', + 'right'=>'}' + ) + ); + $cannotEndWith=array('.','?',',','#'); + $original_url=$url; + do{ + $original_url=$url; + foreach($groupSymbolSets as $groupSymbolSet){ + if(substr($url,-1)==$groupSymbolSet['right']){ + $group_left_count = substr_count($url,$groupSymbolSet['left']); + $group_right_count = substr_count($url,$groupSymbolSet['right']); + if($group_left_count<$group_right_count){ + $right-=1; + $url=substr($url,0,-1); + } + } } + if(in_array(substr($url,-1),$cannotEndWith)){ + $right-=1; + $url=substr($url,0,-1); + } + }while($original_url!=$url); - // Replace it! - $start = mb_strpos($text, $url, $offset); - $text = mb_substr($text, 0, $start).$modified_url.mb_substr($text, $start + mb_strlen($url), mb_strlen($text)); - $offset = $start + mb_strlen($modified_url); + if(empty($notice_id)){ + $result = call_user_func_array($callback,$url); + }else{ + $result = call_user_func_array($callback, array(array($url,$notice_id)) ); } + return substr($matches[0],0,$left) . $result . substr($matches[0],$right); +} - return $text; +function curry($fn) { + //TODO switch to a PHP 5.3 function closure based approach if PHP 5.3 is used + $args = func_get_args(); + array_shift($args); + $id = uniqid('_partial'); + $GLOBALS[$id] = array($fn, $args); + return create_function('', + '$args = func_get_args(); '. + 'return call_user_func_array('. + '$GLOBALS["'.$id.'"][0],'. + 'array_merge('. + '$args,'. + '$GLOBALS["'.$id.'"][1]));'); } function common_linkify($url) { @@ -470,6 +520,11 @@ function common_linkify($url) { // functions $url = htmlspecialchars_decode($url); + if(strpos($url, '@') !== false && strpos($url, ':') === false) { + //url is an email address without the mailto: protocol + return XMLStringer::estring('a', array('href' => "mailto:$url", 'rel' => 'external'), $url); + } + $canon = File_redirection::_canonUrl($url); $longurl_data = File_redirection::where($url); @@ -487,42 +542,30 @@ function common_linkify($url) { $attachment_id = null; $has_thumb = false; - // Check to see whether there's a filename associated with this URL. - // If there is, it's an upload and qualifies as an attachment + // Check to see whether this is a known "attachment" URL. - $localfile = File::staticGet('url', $longurl); + $f = File::staticGet('url', $longurl); - if (!empty($localfile)) { - if (isset($localfile->filename)) { - $is_attachment = true; - $attachment_id = $localfile->id; - } + if (empty($f)) { + // XXX: this writes to the database. :< + $f = File::processNew($longurl); } - // if this URL is an attachment, then we set class='attachment' and id='attahcment-ID' - // where ID is the id of the attachment for the given URL. - // - // we need a better test telling what can be shown as an attachment - // we're currently picking up oembeds only. - // I think the best option is another file_view table in the db - // and associated dbobject. - - $query = "select file_oembed.file_id as file_id from file join file_oembed on file.id = file_oembed.file_id where file.url='$longurl'"; - $file = new File; - $file->query($query); - $file->fetch(); - - if (!empty($file->file_id)) { - $is_attachment = true; - $attachment_id = $file->file_id; - - $query = "select file_thumbnail.file_id as file_id from file join file_thumbnail on file.id = file_thumbnail.file_id where file.url='$longurl'"; - $file2 = new File; - $file2->query($query); - $file2->fetch(); - - if (!empty($file2)) { - $has_thumb = true; + if (!empty($f)) { + if (isset($f->filename)) { + $is_attachment = true; + $attachment_id = $f->id; + } else { // if it has OEmbed info, it's an attachment, too + $foe = File_oembed::staticGet('file_id', $f->id); + if (!empty($foe)) { + $is_attachment = true; + $attachment_id = $f->id; + + $thumb = File_thumbnail::staticGet('file_id', $f->id); + if (!empty($thumb)) { + $has_thumb = true; + } + } } } @@ -1270,7 +1313,7 @@ function common_cache_key($extra) $base_key = common_keyize(common_config('site', 'name')); } - return 'laconica:' . $base_key . ':' . $extra; + return 'statusnet:' . $base_key . ':' . $extra; } function common_keyize($str) @@ -1330,57 +1373,15 @@ function common_shorten_url($long_url) } else { $svc = $user->urlshorteningservice; } - - $curlh = curl_init(); - curl_setopt($curlh, CURLOPT_CONNECTTIMEOUT, 20); // # seconds to wait - curl_setopt($curlh, CURLOPT_USERAGENT, 'Laconica'); - curl_setopt($curlh, CURLOPT_RETURNTRANSFER, true); - - switch($svc) { - case 'ur1.ca': - require_once INSTALLDIR.'/lib/Shorturl_api.php'; - $short_url_service = new LilUrl; - $short_url = $short_url_service->shorten($long_url); - break; - - case '2tu.us': - $short_url_service = new TightUrl; - require_once INSTALLDIR.'/lib/Shorturl_api.php'; - $short_url = $short_url_service->shorten($long_url); - break; - - case 'ptiturl.com': - require_once INSTALLDIR.'/lib/Shorturl_api.php'; - $short_url_service = new PtitUrl; - $short_url = $short_url_service->shorten($long_url); - break; - - case 'bit.ly': - curl_setopt($curlh, CURLOPT_URL, 'http://bit.ly/api?method=shorten&long_url='.urlencode($long_url)); - $short_url = current(json_decode(curl_exec($curlh))->results)->hashUrl; - break; - - case 'is.gd': - curl_setopt($curlh, CURLOPT_URL, 'http://is.gd/api.php?longurl='.urlencode($long_url)); - $short_url = curl_exec($curlh); - break; - case 'snipr.com': - curl_setopt($curlh, CURLOPT_URL, 'http://snipr.com/site/snip?r=simple&link='.urlencode($long_url)); - $short_url = curl_exec($curlh); - break; - case 'metamark.net': - curl_setopt($curlh, CURLOPT_URL, 'http://metamark.net/api/rest/simple?long_url='.urlencode($long_url)); - $short_url = curl_exec($curlh); - break; - case 'tinyurl.com': - curl_setopt($curlh, CURLOPT_URL, 'http://tinyurl.com/api-create.php?url='.urlencode($long_url)); - $short_url = curl_exec($curlh); - break; - default: - $short_url = false; + global $_shorteners; + if(! $_shorteners[$svc]){ + //the user selected service doesn't exist, so default to ur1.ca + $svc = 'ur1.ca'; } - curl_close($curlh); + $reflectionObj = new ReflectionClass($_shorteners[$svc]['callInfo'][0]); + $short_url_service = $reflectionObj->newInstanceArgs($_shorteners[$svc]['callInfo'][1]); + $short_url = $short_url_service->shorten($long_url); return $short_url; } diff --git a/lib/webcolor.php b/lib/webcolor.php index f3ca6e94a..6fa603fa2 100644 --- a/lib/webcolor.php +++ b/lib/webcolor.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for deleting things * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Personal - * @package Laconica - * @author Zach Copley <zach@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Zach Copley <zach@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } diff --git a/lib/widget.php b/lib/widget.php index c70505c44..0258c8649 100644 --- a/lib/widget.php +++ b/lib/widget.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Base class for UI widgets * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,11 +40,11 @@ if (!defined('LACONICA')) { * lists, notice lists, navigation menus (tabsets) and common forms. * * @category Widget - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @see HTMLOutputter */ diff --git a/lib/xmloutputter.php b/lib/xmloutputter.php index 64935da40..5f06e491d 100644 --- a/lib/xmloutputter.php +++ b/lib/xmloutputter.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Low-level generator for XML * @@ -20,15 +20,15 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Output - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> - * @copyright 2008 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> + * @copyright 2008 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,11 +40,11 @@ if (!defined('LACONICA')) { * an element. * * @category Output - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @author Sarven Capadisli <csarven@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @author Sarven Capadisli <csarven@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * @see Action * @see HTMLOutputter */ diff --git a/lib/xmlstringer.php b/lib/xmlstringer.php index 951b13b67..b505e40d3 100644 --- a/lib/xmlstringer.php +++ b/lib/xmlstringer.php @@ -1,6 +1,6 @@ <?php /** - * Laconica, the distributed open-source microblogging tool + * StatusNet, the distributed open-source microblogging tool * * Generator for in-memory XML * @@ -20,14 +20,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * * @category Output - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou <evan@status.net> + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -35,10 +35,10 @@ if (!defined('LACONICA')) { * Create in-memory XML * * @category Output - * @package Laconica - * @author Evan Prodromou <evan@controlyourself.ca> + * @package StatusNet + * @author Evan Prodromou <evan@status.net> * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * @see Action * @see HTMLOutputter */ diff --git a/lib/xmppqueuehandler.php b/lib/xmppqueuehandler.php index 77d476c30..f28fc9088 100644 --- a/lib/xmppqueuehandler.php +++ b/lib/xmppqueuehandler.php @@ -1,7 +1,7 @@ <?php /* - * Laconica - a distributed open-source microblogging tool - * Copyright (C) 2008, 2009, Control Yourself, Inc. + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2008, 2009, StatusNet, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,7 +17,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/queuehandler.php'); @@ -38,14 +38,20 @@ class XmppQueueHandler extends QueueHandler function start() { # Low priority; we don't want to receive messages + $this->log(LOG_INFO, "INITIALIZE"); $this->conn = jabber_connect($this->_id.$this->transport()); - if ($this->conn) { - $this->conn->addEventHandler('message', 'forward_message', $this); - $this->conn->addEventHandler('reconnect', 'handle_reconnect', $this); - $this->conn->setReconnectTimeout(600); - jabber_send_presence("Send me a message to post a notice", 'available', null, 'available', -1); + + if (empty($this->conn)) { + $this->log(LOG_ERR, "Couldn't connect to server."); + return false; } + + $this->conn->addEventHandler('message', 'forward_message', $this); + $this->conn->addEventHandler('reconnect', 'handle_reconnect', $this); + $this->conn->setReconnectTimeout(600); + jabber_send_presence("Send me a message to post a notice", 'available', null, 'available', -1); + return !is_null($this->conn); } @@ -56,6 +62,8 @@ class XmppQueueHandler extends QueueHandler function handle_reconnect(&$pl) { + $this->log(LOG_NOTICE, 'reconnected'); + $this->conn->processUntil('session_start'); $this->conn->presence(null, 'available', null, 'available', -1); } |