default:
// TRANS: Client exception thrown when using an unsupported HTTP method.
$this->clientError(_('HTTP method not supported.'), 405);
- return;
}
return;
$feed->addNamespace('media',
'http://purl.org/syndication/atommedia');
+ $feed->addNamespace('georss',
+ 'http://www.georss.org/georss');
+
$feed->id = $url;
$feed->setUpdated('now');
$dom->documentElement->localName != 'entry') {
// TRANS: Client error displayed when not using an Atom entry.
$this->clientError(_('Atom post must be an Atom entry.'));
- return;
}
$activity = new Activity($dom->documentElement);
if ($activity->verb != ActivityVerb::FOLLOW) {
// TRANS: Client error displayed when not using the follow verb.
$this->clientError(_('Can only handle Follow activities.'));
- return;
}
$person = $activity->objects[0];
if ($person->type != ActivityObject::PERSON) {
// TRANS: Client exception thrown when subscribing to an object that is not a person.
$this->clientError(_('Can only follow people.'));
- return;
}
// XXX: OStatus discovery (maybe)
-
- $profile = Profile::fromURI($person->id);
-
- if (empty($profile)) {
+ try {
+ $profile = Profile::fromUri($person->id);
+ } catch (UnknownUriException $e) {
// TRANS: Client exception thrown when subscribing to a non-existing profile.
// TRANS: %s is the unknown profile ID.
$this->clientError(sprintf(_('Unknown profile %s.'), $person->id));
- return;
}
if (Subscription::exists($this->_profile, $profile)) {
$this->clientError(sprintf(_('Already subscribed to %s.'),
$person->id),
409);
- return;
}
if (Subscription::start($this->_profile, $profile)) {