1
0
Fork 0
forked from mirror/pixelfed

Update Inbox, add more validators

This commit is contained in:
Daniel Supernault 2020-04-29 20:52:48 -06:00
parent 5c5931200b
commit f3ed2462a7
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -18,10 +18,11 @@ use App\Util\ActivityPub\Helpers;
use App\Jobs\LikePipeline\LikePipeline;
use App\Jobs\FollowPipeline\FollowPipeline;
use App\Util\ActivityPub\Validator\{
Accept,
Follow
};
use App\Util\ActivityPub\Validator\Accept as AcceptValidator;
use App\Util\ActivityPub\Validator\Announce as AnnounceValidator;
use App\Util\ActivityPub\Validator\Follow as FollowValidator;
use App\Util\ActivityPub\Validator\Like as LikeValidator;
use App\Util\ActivityPub\Validator\UndoFollow as UndoFollowValidator;
class Inbox
{
@ -65,11 +66,12 @@ class Inbox
break;
case 'Announce':
if(AnnounceValidator::validate($this->payload) == false) { return; }
$this->handleAnnounceActivity();
break;
case 'Accept':
if(Accept::validate($this->payload) == false) { return; }
if(AcceptValidator::validate($this->payload) == false) { return; }
$this->handleAcceptActivity();
break;