diff options
author | Evan Prodromou <evan@status.net> | 2010-02-20 11:38:05 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-02-20 11:38:05 -0500 |
commit | ab4ec095e811f86c50fbc1cd71144b11d6b86d50 (patch) | |
tree | d2dfdd6d45a9ed263173c7ef44926b1ef52b0f7e /plugins/OStatus/classes | |
parent | 81ea0f81173030c73cfc8dd46946d126d3d41622 (diff) |
adjust URI, URL, and location in Ostatus_profile::processPost
Diffstat (limited to 'plugins/OStatus/classes')
-rw-r--r-- | plugins/OStatus/classes/Ostatus_profile.php | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 9f5c60561..4dd565288 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -457,28 +457,33 @@ class Ostatus_profile extends Memcached_DataObject $oprofile = $this; } - if ($activity->object->link) { - $sourceUri = $activity->object->link; - } else if (preg_match('!^https?://!', $activity->object->id)) { - $sourceUri = $activity->object->id; - } else { - common_log(LOG_INFO, "OStatus: ignoring post with no source link: id $activity->object->id"); - return; - } + $sourceUri = $activity->object->id; $dupe = Notice::staticGet('uri', $sourceUri); + if ($dupe) { - common_log(LOG_INFO, "OStatus: ignoring duplicate post: $noticeLink"); + common_log(LOG_INFO, "OStatus: ignoring duplicate post: $sourceUri"); return; } + $sourceUrl = null; + + if ($activity->object->link) { + $sourceUrl = $activity->object->link; + } else if (preg_match('!^https?://!', $activity->object->id)) { + $sourceUrl = $activity->object->id; + } + // @fixme sanitize and save HTML content if available + $content = $activity->object->title; $params = array('is_local' => Notice::REMOTE_OMB, + 'url' => $sourceUrl, 'uri' => $sourceUri); - $location = $this->getEntryLocation($activity->entry); + $location = $activity->context->location; + if ($location) { $params['lat'] = $location->lat; $params['lon'] = $location->lon; |