summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-01-15 12:29:14 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-01-15 12:29:14 -0100
commitdaf473c9a0d7e46a38576419f00e81e7221e6a0a (patch)
treef2c9c578f24be01f0a220d4a417e3227a4daa18e
parent6ad5dcfd12d991be6d08c315368651c5de6ae450 (diff)
cleaning
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r--lib/Controller/SocialPubController.php6
-rw-r--r--lib/Db/NotesRequestBuilder.php3
-rw-r--r--lib/Interfaces/Activity/DeleteInterface.php2
-rw-r--r--lib/Interfaces/Object/NoteInterface.php1
-rw-r--r--lib/Service/AccountService.php8
5 files changed, 14 insertions, 6 deletions
diff --git a/lib/Controller/SocialPubController.php b/lib/Controller/SocialPubController.php
index ce9f131b..49d291dd 100644
--- a/lib/Controller/SocialPubController.php
+++ b/lib/Controller/SocialPubController.php
@@ -94,6 +94,12 @@ class SocialPubController extends Controller {
$this->navigationController = $navigationController;
}
+ /**
+ * @param $username
+ *
+ * @return Response
+ * @throws UrlCloudException
+ */
private function renderPage($username): Response {
if ($this->userId) {
return $this->navigationController->navigate('');
diff --git a/lib/Db/NotesRequestBuilder.php b/lib/Db/NotesRequestBuilder.php
index 5995560c..5d770ddd 100644
--- a/lib/Db/NotesRequestBuilder.php
+++ b/lib/Db/NotesRequestBuilder.php
@@ -31,11 +31,10 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools;
-use DateTime;
use Doctrine\DBAL\Query\QueryBuilder;
use OCA\Social\Exceptions\InvalidResourceException;
-use OCA\Social\Model\ActivityPub\Object\Note;
use OCA\Social\Model\ActivityPub\Actor\Person;
+use OCA\Social\Model\ActivityPub\Object\Note;
use OCA\Social\Model\InstancePath;
use OCP\DB\QueryBuilder\ICompositeExpression;
use OCP\DB\QueryBuilder\IQueryBuilder;
diff --git a/lib/Interfaces/Activity/DeleteInterface.php b/lib/Interfaces/Activity/DeleteInterface.php
index ce963115..5d57ffc9 100644
--- a/lib/Interfaces/Activity/DeleteInterface.php
+++ b/lib/Interfaces/Activity/DeleteInterface.php
@@ -77,8 +77,8 @@ class DeleteInterface implements IActivityPubInterface {
$interface->delete($object);
return;
- } catch (UnknownItemException $e) {
} catch (ItemNotFoundException $e) {
+ } catch (ItemUnknownException $e) {
}
}
}
diff --git a/lib/Interfaces/Object/NoteInterface.php b/lib/Interfaces/Object/NoteInterface.php
index 7c4b7ae7..612d2081 100644
--- a/lib/Interfaces/Object/NoteInterface.php
+++ b/lib/Interfaces/Object/NoteInterface.php
@@ -38,7 +38,6 @@ use OCA\Social\Exceptions\NoteNotFoundException;
use OCA\Social\Interfaces\IActivityPubInterface;
use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Model\ActivityPub\Activity\Create;
-use OCA\Social\Model\ActivityPub\Activity\Update;
use OCA\Social\Model\ActivityPub\Object\Note;
use OCA\Social\Service\ConfigService;
use OCA\Social\Service\CurlService;
diff --git a/lib/Service/AccountService.php b/lib/Service/AccountService.php
index ff868350..f94bd965 100644
--- a/lib/Service/AccountService.php
+++ b/lib/Service/AccountService.php
@@ -38,6 +38,7 @@ use OCA\Social\Db\FollowsRequest;
use OCA\Social\Db\NotesRequest;
use OCA\Social\Exceptions\AccountAlreadyExistsException;
use OCA\Social\Exceptions\ActorDoesNotExistException;
+use OCA\Social\Exceptions\ItemUnknownException;
use OCA\Social\Exceptions\SocialAppConfigException;
use OCA\Social\Exceptions\UrlCloudException;
use OCA\Social\Model\ActivityPub\Actor\Person;
@@ -245,8 +246,11 @@ class AccountService {
return;
}
- $iconId = $this->documentService->cacheLocalAvatarByUsername($actor);
- $actor->setIconId($iconId);
+ try {
+ $iconId = $this->documentService->cacheLocalAvatarByUsername($actor);
+ $actor->setIconId($iconId);
+ } catch (ItemUnknownException $e) {
+ }
$count = [
'followers' => $this->followsRequest->countFollowers($actor->getId()),