forked from mirror/pixelfed
Update Inbox
This commit is contained in:
parent
5d2f93bd6d
commit
8c230b2793
|
@ -122,13 +122,16 @@ class Inbox
|
||||||
{
|
{
|
||||||
$activity = $this->payload['object'];
|
$activity = $this->payload['object'];
|
||||||
$actor = $this->actorFirstOrCreate($this->payload['actor']);
|
$actor = $this->actorFirstOrCreate($this->payload['actor']);
|
||||||
|
if(!$actor || $actor->domain == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$inReplyTo = $activity['inReplyTo'];
|
$inReplyTo = $activity['inReplyTo'];
|
||||||
$url = $activity['id'];
|
$url = $activity['id'];
|
||||||
|
|
||||||
if(!Helpers::statusFirstOrFetch($url, true)) {
|
Helpers::statusFirstOrFetch($url, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public function handleNoteCreate()
|
public function handleNoteCreate()
|
||||||
{
|
{
|
||||||
|
@ -139,7 +142,6 @@ class Inbox
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Helpers::userInAudience($this->profile, $this->payload) == false) {
|
if(Helpers::userInAudience($this->profile, $this->payload) == false) {
|
||||||
//Log::error('AP:inbox:userInAudience:false - Activity#'.$this->logger->id);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,21 +149,8 @@ class Inbox
|
||||||
if(Status::whereUrl($url)->exists()) {
|
if(Status::whereUrl($url)->exists()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Helpers::statusFirstOrFetch($url, false);
|
||||||
$status = DB::transaction(function() use($activity, $actor, $url) {
|
return;
|
||||||
$caption = str_limit(strip_tags($activity['content']), config('pixelfed.max_caption_length'));
|
|
||||||
$status = new Status;
|
|
||||||
$status->profile_id = $actor->id;
|
|
||||||
$status->caption = strip_tags($caption);
|
|
||||||
$status->rendered = Purify::clean($caption);
|
|
||||||
$status->visibility = $status->scope = 'public';
|
|
||||||
$status->uri = $url;
|
|
||||||
$status->url = $url;
|
|
||||||
$status->save();
|
|
||||||
return $status;
|
|
||||||
});
|
|
||||||
|
|
||||||
Helpers::importNoteAttachment($activity, $status);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleFollowActivity()
|
public function handleFollowActivity()
|
||||||
|
|
Loading…
Reference in New Issue