Browse Source

Improved ID detection

pull/6476/head
Michael 2 years ago
parent
commit
9e7c59481f
1 changed files with 11 additions and 2 deletions
  1. +11
    -2
      src/Protocol/ActivityPub/Transmitter.php

+ 11
- 2
src/Protocol/ActivityPub/Transmitter.php View File

@ -1029,8 +1029,17 @@ class Transmitter
return self::createNote($item);
}
/// @todo Better fetch the real object url.
return $announce['plink'];
// Fetch the original id of the object
$activity = ActivityPub::fetchContent($announce['plink'], $item['uid']);
if (!empty($activity)) {
$ldactivity = JsonLD::compact($activity);
$id = JsonLD::fetchElement($ldactivity, '@id');
if (!empty($id)) {
return $id;
}
}
return self::createNote($item);
}
/**


Loading…
Cancel
Save