mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-11 02:36:42 +02:00
fix(activitypub): add conditions for possibly missing actor properties + add user-agent to requests
This commit is contained in:
parent
3a0a20d59c
commit
8fbf948fbb
3 changed files with 49 additions and 15 deletions
|
|
@ -108,12 +108,13 @@ class ActorController extends Controller
|
|||
if ($replyToPost !== null) {
|
||||
// TODO: strip content from html to retrieve message
|
||||
// remove all html tags and reconstruct message with mentions?
|
||||
extract_text_from_html($payload->object->content);
|
||||
$message = get_message_from_object($payload->object);
|
||||
|
||||
$reply = new Post([
|
||||
'uri' => $payload->object->id,
|
||||
'actor_id' => $payloadActor->id,
|
||||
'in_reply_to_id' => $replyToPost->id,
|
||||
'message' => $payload->object->content,
|
||||
'message' => $message,
|
||||
'published_at' => Time::parse($payload->object->published),
|
||||
]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue