mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-21 20:43:18 +00:00
commit
def5ac8a28
4 changed files with 21 additions and 6 deletions
|
@ -60,7 +60,7 @@ class InboxValidator implements ShouldQueue
|
|||
$payload = json_decode($this->payload, true, 8);
|
||||
|
||||
if(isset($payload['id'])) {
|
||||
$lockKey = 'ap:icid:' . hash('sha256', $payload['id']);
|
||||
$lockKey = 'pf:ap:user-inbox:activity:' . hash('sha256', $payload['id']);
|
||||
if(Cache::get($lockKey) !== null) {
|
||||
// Job processed already
|
||||
return 1;
|
||||
|
|
|
@ -57,7 +57,7 @@ class InboxWorker implements ShouldQueue
|
|||
$payload = json_decode($this->payload, true, 8);
|
||||
|
||||
if(isset($payload['id'])) {
|
||||
$lockKey = 'ap:icid:' . hash('sha256', $payload['id']);
|
||||
$lockKey = 'pf:ap:user-inbox:activity:' . hash('sha256', $payload['id']);
|
||||
if(Cache::get($lockKey) !== null) {
|
||||
// Job processed already
|
||||
return 1;
|
||||
|
|
|
@ -373,6 +373,10 @@ class Helpers {
|
|||
return;
|
||||
}
|
||||
|
||||
if(!isset($activity['object']['attributedTo'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$attributedTo = is_string($activity['object']['attributedTo']) ?
|
||||
$activity['object']['attributedTo'] :
|
||||
(is_array($activity['object']['attributedTo']) ?
|
||||
|
|
|
@ -180,6 +180,8 @@ class Inbox
|
|||
StoryFetch::dispatchNow($this->payload);
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
public function handleCreateActivity()
|
||||
|
@ -267,14 +269,23 @@ class Inbox
|
|||
return;
|
||||
}
|
||||
|
||||
if($actor->followers()->count() == 0) {
|
||||
return;
|
||||
if($actor->followers_count == 0) {
|
||||
if(FollowerService::followerCount($actor->id, true) == 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$hasUrl = isset($activity['url']);
|
||||
$url = isset($activity['url']) ? $activity['url'] : $activity['id'];
|
||||
|
||||
if(Status::whereUrl($url)->exists()) {
|
||||
return;
|
||||
if($hasUrl) {
|
||||
if(Status::whereUri($url)->exists()) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if(Status::whereObjectUrl($url)->exists()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Helpers::storeStatus(
|
||||
|
|
Loading…
Reference in a new issue