From b5dc7d5209e5a534966f35445c43809a606f01fc Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Wed, 14 Jun 2023 11:05:14 -0100 Subject: [PATCH] always save action Signed-off-by: Maxence Lange --- lib/Interfaces/Object/AnnounceInterface.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/Interfaces/Object/AnnounceInterface.php b/lib/Interfaces/Object/AnnounceInterface.php index e27ad929..46d94e78 100644 --- a/lib/Interfaces/Object/AnnounceInterface.php +++ b/lib/Interfaces/Object/AnnounceInterface.php @@ -101,18 +101,6 @@ class AnnounceInterface extends AbstractActivityPubInterface implements IActivit $item->checkOrigin($item->getId()); $item->checkOrigin($item->getActorId()); - try { - $this->actionsRequest->getActionFromItem($item); - } catch (ActionDoesNotExistException $e) { - $this->actionsRequest->save($item); - - try { - $post = $this->streamRequest->getStreamById($item->getObjectId()); - $this->updateDetails($post); - } catch (Exception $e) { - } - } - $this->save($item); } @@ -191,6 +179,12 @@ class AnnounceInterface extends AbstractActivityPubInterface implements IActivit return; // should not happen. } + try { + $this->actionsRequest->getActionFromItem($item); + } catch (ActionDoesNotExistException $e) { + $this->actionsRequest->save($item); + } + $this->updateDetails($post); $this->generateNotification($post, $actor); }