From 3232df7a8c0e7e203b9df610412130530a80be79 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Tue, 4 Dec 2018 23:37:08 -0100 Subject: [PATCH 1/2] exception when following yourself Signed-off-by: Maxence Lange --- lib/Exceptions/FollowSameAccountException.php | 8 ++++++++ lib/Service/ActivityPub/FollowService.php | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 lib/Exceptions/FollowSameAccountException.php diff --git a/lib/Exceptions/FollowSameAccountException.php b/lib/Exceptions/FollowSameAccountException.php new file mode 100644 index 00000000..cdf5140a --- /dev/null +++ b/lib/Exceptions/FollowSameAccountException.php @@ -0,0 +1,8 @@ +personService->getFromAccount($account); + if ($remoteActor->getId() === $actor->getId()) { + throw new FollowSameAccountException("Don't follow yourself, be your own lead"); + } + $follow = new Follow(); $follow->setUrlCloud($this->configService->getCloudAddress()); $follow->generateUniqueId(); From 8184dbd70583e79686322f5b551167168e283392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 5 Dec 2018 09:48:02 +0100 Subject: [PATCH 2/2] Hide follow actions for own account MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/ProfileInfo.vue | 8 ++++++-- src/components/UserEntry.vue | 18 +++++++++++------- src/mixins/currentUserMixin.js | 9 ++++++--- src/mixins/follow.js | 4 ++-- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/components/ProfileInfo.vue b/src/components/ProfileInfo.vue index 983a7fe1..9a4ba0f1 100644 --- a/src/components/ProfileInfo.vue +++ b/src/components/ProfileInfo.vue @@ -27,7 +27,7 @@

{{ displayName }}

{{ accountInfo.account }}

Website: {{ accountInfo.website.value }}

-