diff options
author | Evan Prodromou <evan@status.net> | 2010-03-20 08:25:56 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-03-20 08:25:56 -0500 |
commit | 25cb9175231f1515c357035c797cb25ec0b01b44 (patch) | |
tree | fba91f081092cfda06a7422e7ed2ba579ec4de96 | |
parent | f55850878450b27b00bd18b140f2be1357d9713c (diff) |
Allow PuSH posts without author information
Superfeedr (sp.?) posts entries without author information. We can
assume that this is intended to be by the original author.
Re-structured the checks for entries that come in by PuSH so they can
either have no author or an empty author, but not a different author.
-rw-r--r-- | plugins/OStatus/classes/Ostatus_profile.php | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 6885bb953..79e20adbd 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -468,17 +468,16 @@ class Ostatus_profile extends Memcached_DataObject return false; } } else { - // Individual user feeds may contain only posts from themselves. - // Authorship is validated against the profile URI on upper layers, - // through PuSH setup or Salmon signature checks. - $actorUri = self::getActorProfileURI($activity); - if ($actorUri == $this->uri) { - // Check if profile info has changed and update it - $this->updateFromActivityObject($activity->actor); + $actor = $activity->actor; + + if (empty($actor)) { + // OK here! assume the default + } else if ($actor->id == $this->uri || $actor->link == $this->uri) { + $this->updateFromActivityObject($actor); } else { - common_log(LOG_WARNING, "OStatus: skipping post with bad author: got $actorUri expected $this->uri"); - return false; + throw new Exception("Got an actor '{$actor->title}' ({$actor->id}) on single-user feed for {$this->uri}"); } + $oprofile = $this; } |