From d90fabd15eff8d33f3eb323b45912c41cc6b1ca5 Mon Sep 17 00:00:00 2001 From: Diogo Cordeiro Date: Tue, 31 Jul 2018 20:25:47 +0100 Subject: [PATCH] Fix Notice typo and follow request system --- classes/Activitypub_notice.php | 2 +- utils/postman.php | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/classes/Activitypub_notice.php b/classes/Activitypub_notice.php index 2f5a5cf..01b8a3e 100755 --- a/classes/Activitypub_notice.php +++ b/classes/Activitypub_notice.php @@ -77,7 +77,7 @@ class Activitypub_notice extends Managed_DataObject 'type' => 'Note', 'published' => str_replace(' ', 'T', $notice->getCreated()).'Z', 'url' => $notice->getUrl(), - 'atributedTo' => ActivityPubPlugin::actor_uri($profile), + 'atributtedTo' => ActivityPubPlugin::actor_uri($profile), 'to' => $to, 'cc' => common_local_url('apActorFollowers', ['id' => $profile->getID()]), 'atomUri' => $notice->getUrl(), diff --git a/utils/postman.php b/utils/postman.php index 6b7b684..05c3653 100755 --- a/utils/postman.php +++ b/utils/postman.php @@ -118,17 +118,13 @@ class Activitypub_postman if ($res->getStatusCode() == 200 || $res->getStatusCode() == 409) { $pending_list = new Activitypub_pending_follow_requests($this->actor->getID(), $this->to[0]->getID()); - if (! ($res->getStatusCode() == 409 || $res_body->type == "Accept")) { - $pending_list->add(); - throw new Exception("Your follow request is pending acceptation."); - } - $pending_list->remove(); + $pending_list->add(); return true; } elseif (isset($res_body[0]->error)) { throw new Exception($res_body[0]->error); + } else { + throw new Exception("An unknown error occurred."); } - - throw new Exception("An unknown error occurred."); } /**