Merge branch 'master' of gitorious.org:statusnet/mainline

This commit is contained in:
Evan Prodromou 2012-02-07 16:27:40 +01:00
commit 710febfba1
9 changed files with 78 additions and 12 deletions

View File

@ -159,6 +159,11 @@ class PublicAction extends Action
$this->element('link', array('rel' => 'EditURI', $this->element('link', array('rel' => 'EditURI',
'type' => 'application/rsd+xml', 'type' => 'application/rsd+xml',
'href' => $rsd)); 'href' => $rsd));
if ($this->page != 1) {
$this->element('link', array('rel' => 'canonical',
'href' => common_local_url('public')));
}
} }
/** /**

View File

@ -233,4 +233,12 @@ class ShowgroupAction extends GroupAction
$this->raw(common_markup_to_html($m)); $this->raw(common_markup_to_html($m));
$this->elementEnd('div'); $this->elementEnd('div');
} }
function extraHead()
{
if ($this->page != 1) {
$this->element('link', array('rel' => 'canonical',
'href' => $this->group->homeUrl()));
}
}
} }

View File

@ -212,6 +212,11 @@ class ShowstreamAction extends ProfileAction
$this->element('link', array('rel' => 'EditURI', $this->element('link', array('rel' => 'EditURI',
'type' => 'application/rsd+xml', 'type' => 'application/rsd+xml',
'href' => $rsd)); 'href' => $rsd));
if ($this->page != 1) {
$this->element('link', array('rel' => 'canonical',
'href' => $this->profile->profileurl));
}
} }
function showEmptyListMessage() function showEmptyListMessage()

View File

@ -505,6 +505,7 @@ class BlacklistPlugin extends Plugin
} }
} }
if (!empty($actor->poco)) {
$nickname = strtolower($actor->poco->preferredUsername); $nickname = strtolower($actor->poco->preferredUsername);
if (!empty($nickname)) { if (!empty($nickname)) {
@ -515,6 +516,7 @@ class BlacklistPlugin extends Plugin
throw new ClientException($msg); throw new ClientException($msg);
} }
} }
}
return true; return true;
} }

View File

@ -0,0 +1,41 @@
#!/usr/bin/env php
<?php
/*
* StatusNet - a distributed open-source microblogging tool
* Copyright (C) 2010, 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
* 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/>.
*/
define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
$helptext = <<<END_OF_HELP
gcfeeds.php [options]
Clean up feeds that no longer have subscribers.
END_OF_HELP;
require_once INSTALLDIR.'/scripts/commandline.inc';
$feedsub = new FeedSub();
while ($feedsub->fetch()) {
print $feedsub->uri . "(" . $feedsub->sub_state . ")";
$result = $feedsub->garbageCollect();
if ($result) {
print " INACTIVE\n";
} else {
print " ACTIVE\n";
}
}

View File

@ -157,6 +157,10 @@ class SubMirrorPlugin extends Plugin
*/ */
function onOstatus_profileSubscriberCount($oprofile, &$count) function onOstatus_profileSubscriberCount($oprofile, &$count)
{ {
if (empty($oprofile) || !($oprofile instanceof Ostatus_profile)) {
return true;
}
if ($oprofile->profile_id) { if ($oprofile->profile_id) {
$mirror = new SubMirror(); $mirror = new SubMirror();
$mirror->subscribed = $oprofile->profile_id; $mirror->subscribed = $oprofile->profile_id;
@ -166,6 +170,7 @@ class SubMirrorPlugin extends Plugin
} }
} }
} }
return true; return true;
} }

View File

@ -157,7 +157,7 @@ class SubMirror extends Memcached_DataObject
{ {
$profile = Profile::staticGet('id', $this->subscriber); $profile = Profile::staticGet('id', $this->subscriber);
if (!$profile) { if (!$profile) {
common_log(LOG_ERROR, "SubMirror plugin skipping auto-repeat of notice $notice->id for missing user $profile->id"); common_log(LOG_ERR, "SubMirror plugin skipping auto-repeat of notice $notice->id for missing user $profile->id");
return false; return false;
} }

View File

@ -339,7 +339,7 @@ class TwitterBridgePlugin extends Plugin
$versions[] = array( $versions[] = array(
'name' => 'TwitterBridge', 'name' => 'TwitterBridge',
'version' => self::VERSION, 'version' => self::VERSION,
'author' => 'Zach Copley, Julien C', 'author' => 'Zach Copley, Julien C, Jean Baptiste Favre',
'homepage' => 'http://status.net/wiki/Plugin:TwitterBridge', 'homepage' => 'http://status.net/wiki/Plugin:TwitterBridge',
// TRANS: Plugin description. // TRANS: Plugin description.
'rawdescription' => _m('The Twitter "bridge" plugin allows integration ' . 'rawdescription' => _m('The Twitter "bridge" plugin allows integration ' .

View File

@ -120,9 +120,9 @@ function is_twitter_bound($notice, $flink) {
// If it's not a Twitter-style reply, or if the user WANTS to send replies, // If it's not a Twitter-style reply, or if the user WANTS to send replies,
// or if it's in reply to a twitter notice // or if it's in reply to a twitter notice
if (!preg_match('/^@[a-zA-Z0-9_]{1,15}\b/u', $notice->content) || if ( (($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) == FOREIGN_NOTICE_SEND_REPLY) ||
(($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) == FOREIGN_NOTICE_SEND_REPLY) || (is_twitter_notice($notice->reply_to) || is_twitter_notice($notice->repeat_of)) ||
is_twitter_notice($notice->reply_to)) { (empty($notice->reply_to) && !preg_match('/^@[a-zA-Z0-9_]{1,15}\b/u', $notice->content)) ){
return true; return true;
} }
} }