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

This commit is contained in:
Zach Copley 2010-08-13 20:53:19 +00:00
commit 61ab21b711
5 changed files with 24 additions and 11 deletions

View File

@ -456,8 +456,10 @@ class Ostatus_profile extends Memcached_DataObject
case ActivityObject::NOTE:
case ActivityObject::STATUS:
case ActivityObject::COMMENT:
case null: // Unspecified type is assumed to be a blog post; as we get from RSS.
break;
default:
common_log(LOG_INFO, "Aborting processing for unrecognized activity type " . $activity->objects[0]->type);
throw new ClientException("Can't handle that kind of post.");
}
@ -496,8 +498,11 @@ class Ostatus_profile extends Memcached_DataObject
} else if ($actor->id) {
// We have an ActivityStreams actor with an explicit ID that doesn't match the feed owner.
// This isn't what we expect from mainline OStatus person feeds!
// Group feeds go down another path, with different validation.
throw new Exception("Got an actor '{$actor->title}' ({$actor->id}) on single-user feed for {$this->uri}");
// Group feeds go down another path, with different validation...
// Most likely this is a plain ol' blog feed of some kind which
// doesn't match our expectations. We'll take the entry, but ignore
// the <author> info.
common_log(LOG_WARNING, "Got an actor '{$actor->title}' ({$actor->id}) on single-user feed for {$this->uri}");
} else {
// Plain <author> without ActivityStreams actor info.
// We'll just ignore this info for now and save the update under the feed's identity.

View File

@ -114,9 +114,10 @@ class DiscoveryHints {
static function _hcard($body, $url)
{
// DOMDocument::loadHTML may throw warnings on unrecognized elements.
// DOMDocument::loadHTML may throw warnings on unrecognized elements,
// and notices on unrecognized namespaces.
$old = error_reporting(error_reporting() & ~E_WARNING);
$old = error_reporting(error_reporting() & ~(E_WARNING | E_NOTICE));
$doc = new DOMDocument();
$doc->loadHTML($body);

View File

@ -196,8 +196,9 @@ class FeedDiscovery
*/
function discoverFromHTML($url, $body)
{
// DOMDocument::loadHTML may throw warnings on unrecognized elements.
$old = error_reporting(error_reporting() & ~E_WARNING);
// DOMDocument::loadHTML may throw warnings on unrecognized elements,
// and notices on unrecognized namespaces.
$old = error_reporting(error_reporting() & ~(E_WARNING | E_NOTICE));
$dom = new DOMDocument();
$ok = $dom->loadHTML($body);
error_reporting($old);

View File

@ -92,7 +92,13 @@ abstract class BaseMirrorAction extends Action
*/
protected function profileForFeed($url)
{
$oprofile = Ostatus_profile::ensureProfileURL($url);
try {
// Maybe we got a web page?
$oprofile = Ostatus_profile::ensureProfileURL($url);
} catch (Exception $e) {
// Direct feed URL?
$oprofile = Ostatus_profile::ensureFeedURL($url);
}
if ($oprofile->isGroup()) {
$this->clientError(_m("Can't mirror a StatusNet group at this time."));
}

View File

@ -94,15 +94,15 @@ function do_translatewiki_plugin($basedir, $plugin)
BASIC:
id: out-statusnet-{$pluginlc}
label: StatusNet - {$plugin}
description: "{{int:bw-desc-statusnet-plugin-{$pluginlc}}}"
namespace: NS_STATUSNET
description: "{{int:bw-desc-statusnet-plugin}}"
class: FileBasedMessageGroup
display: out/statusnet/{$pluginlc}
class: GettextMessageGroup
FILES:
class: GettextFFS
sourcePattern: %GROUPROOT%/plugins/{$plugin}/locale/%CODE%/LC_MESSAGES/{$plugin}.po
targetPattern: plugins/{$plugin}/locale/%CODE%/LC_MESSAGES/{$plugin}.po
sourcePattern: %GROUPROOT%/statusnet/plugins/{$plugin}/locale/{$plugin}.pot
targetPattern: statusnet/plugins/{$plugin}/locale/%CODE%/LC_MESSAGES/{$plugin}.po
codeMap:
en-gb: en_GB
no: nb