summaryrefslogtreecommitdiff
path: root/plugins/OStatus/classes/Ostatus_profile.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-08-02 16:08:54 -0700
committerBrion Vibber <brion@status.net>2010-08-10 12:57:40 -0700
commit9a53be4669e53ba343f4c6433405ae8de747a86f (patch)
tree73c8352d16ba24ecce6a543e679b4bc77f8ee476 /plugins/OStatus/classes/Ostatus_profile.php
parent6a2659ed67577b3f33c5c4d55067744a4b812a06 (diff)
Initial support for third-party fallback hub such as Superfeedr for feed subscriptions.
If set up, this hub will be used to subscribe to feeds that don't specify a hub of their own. Assumes that the fallback hub will, in fact, handle polling and updates for any feed we throw at it! Authentication may be specified for the fallback hub. Example: $config['feedsub']['fallback_hub'] = 'https://superfeedr.com/hubbub'; $config['feedsub']['hub_user'] = 'abcd'; $config['feedsub']['hub_pass'] = 'ckcmdkmckdmkcdk'; Also: * Fix for WordPress-RSS-via-Superfeedr-Atom; if we have <author> info but no ID from a native ActivityStreams actor, don't freak out in the low-level processing code that checks for identity matches. * enhanced messages for low-level FeedSub exceptions if they make it to outside display
Diffstat (limited to 'plugins/OStatus/classes/Ostatus_profile.php')
-rw-r--r--plugins/OStatus/classes/Ostatus_profile.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index 2d7c632e6..77a5e22cc 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -493,8 +493,14 @@ class Ostatus_profile extends Memcached_DataObject
// OK here! assume the default
} else if ($actor->id == $this->uri || $actor->link == $this->uri) {
$this->updateFromActivityObject($actor);
- } else {
+ } 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}");
+ } else {
+ // Plain <author> without ActivityStreams actor info.
+ // We'll just ignore this info for now and save the update under the feed's identity.
}
$oprofile = $this;
@@ -869,12 +875,12 @@ class Ostatus_profile extends Memcached_DataObject
$feeduri = $discover->discoverFromFeedURL($feed_url);
$hints['feedurl'] = $feeduri;
- $huburi = $discover->getAtomLink('hub');
+ $huburi = $discover->getHubLink();
$hints['hub'] = $huburi;
$salmonuri = $discover->getAtomLink(Salmon::NS_REPLIES);
$hints['salmon'] = $salmonuri;
- if (!$huburi) {
+ if (!$huburi && !common_config('feedsub', 'fallback_hub')) {
// We can only deal with folks with a PuSH hub
throw new FeedSubNoHubException();
}
@@ -1270,10 +1276,10 @@ class Ostatus_profile extends Memcached_DataObject
$discover = new FeedDiscovery();
$discover->discoverFromFeedURL($hints['feedurl']);
}
- $huburi = $discover->getAtomLink('hub');
+ $huburi = $discover->getHubLink();
}
- if (!$huburi) {
+ if (!$huburi && !common_config('feedsub', 'fallback_hub')) {
// We can only deal with folks with a PuSH hub
throw new FeedSubNoHubException();
}