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);
|
$payload = json_decode($this->payload, true, 8);
|
||||||
|
|
||||||
if(isset($payload['id'])) {
|
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) {
|
if(Cache::get($lockKey) !== null) {
|
||||||
// Job processed already
|
// Job processed already
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -57,7 +57,7 @@ class InboxWorker implements ShouldQueue
|
||||||
$payload = json_decode($this->payload, true, 8);
|
$payload = json_decode($this->payload, true, 8);
|
||||||
|
|
||||||
if(isset($payload['id'])) {
|
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) {
|
if(Cache::get($lockKey) !== null) {
|
||||||
// Job processed already
|
// Job processed already
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -373,6 +373,10 @@ class Helpers {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!isset($activity['object']['attributedTo'])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$attributedTo = is_string($activity['object']['attributedTo']) ?
|
$attributedTo = is_string($activity['object']['attributedTo']) ?
|
||||||
$activity['object']['attributedTo'] :
|
$activity['object']['attributedTo'] :
|
||||||
(is_array($activity['object']['attributedTo']) ?
|
(is_array($activity['object']['attributedTo']) ?
|
||||||
|
|
|
@ -180,6 +180,8 @@ class Inbox
|
||||||
StoryFetch::dispatchNow($this->payload);
|
StoryFetch::dispatchNow($this->payload);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleCreateActivity()
|
public function handleCreateActivity()
|
||||||
|
@ -267,14 +269,23 @@ class Inbox
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($actor->followers()->count() == 0) {
|
if($actor->followers_count == 0) {
|
||||||
return;
|
if(FollowerService::followerCount($actor->id, true) == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hasUrl = isset($activity['url']);
|
||||||
$url = isset($activity['url']) ? $activity['url'] : $activity['id'];
|
$url = isset($activity['url']) ? $activity['url'] : $activity['id'];
|
||||||
|
|
||||||
if(Status::whereUrl($url)->exists()) {
|
if($hasUrl) {
|
||||||
return;
|
if(Status::whereUri($url)->exists()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(Status::whereObjectUrl($url)->exists()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Helpers::storeStatus(
|
Helpers::storeStatus(
|
||||||
|
|
Loading…
Reference in a new issue