adjust URI, URL, and location in Ostatus_profile::processPost
This commit is contained in:
parent
81ea0f8117
commit
ab4ec095e8
@ -457,28 +457,33 @@ class Ostatus_profile extends Memcached_DataObject
|
|||||||
$oprofile = $this;
|
$oprofile = $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($activity->object->link) {
|
|
||||||
$sourceUri = $activity->object->link;
|
|
||||||
} else if (preg_match('!^https?://!', $activity->object->id)) {
|
|
||||||
$sourceUri = $activity->object->id;
|
$sourceUri = $activity->object->id;
|
||||||
} else {
|
|
||||||
common_log(LOG_INFO, "OStatus: ignoring post with no source link: id $activity->object->id");
|
$dupe = Notice::staticGet('uri', $sourceUri);
|
||||||
|
|
||||||
|
if ($dupe) {
|
||||||
|
common_log(LOG_INFO, "OStatus: ignoring duplicate post: $sourceUri");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dupe = Notice::staticGet('uri', $sourceUri);
|
$sourceUrl = null;
|
||||||
if ($dupe) {
|
|
||||||
common_log(LOG_INFO, "OStatus: ignoring duplicate post: $noticeLink");
|
if ($activity->object->link) {
|
||||||
return;
|
$sourceUrl = $activity->object->link;
|
||||||
|
} else if (preg_match('!^https?://!', $activity->object->id)) {
|
||||||
|
$sourceUrl = $activity->object->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @fixme sanitize and save HTML content if available
|
// @fixme sanitize and save HTML content if available
|
||||||
|
|
||||||
$content = $activity->object->title;
|
$content = $activity->object->title;
|
||||||
|
|
||||||
$params = array('is_local' => Notice::REMOTE_OMB,
|
$params = array('is_local' => Notice::REMOTE_OMB,
|
||||||
|
'url' => $sourceUrl,
|
||||||
'uri' => $sourceUri);
|
'uri' => $sourceUri);
|
||||||
|
|
||||||
$location = $this->getEntryLocation($activity->entry);
|
$location = $activity->context->location;
|
||||||
|
|
||||||
if ($location) {
|
if ($location) {
|
||||||
$params['lat'] = $location->lat;
|
$params['lat'] = $location->lat;
|
||||||
$params['lon'] = $location->lon;
|
$params['lon'] = $location->lon;
|
||||||
|
Loading…
Reference in New Issue
Block a user