summaryrefslogtreecommitdiffstats
path: root/lib/Db/FollowsRequest.php
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2018-11-19 11:10:24 -0100
committerMaxence Lange <maxence@artificial-owl.com>2018-11-19 11:10:24 -0100
commit31b729f5d4224a6401cb9ff9bab5836cf0b3c765 (patch)
tree821a60c0e225fac83378c89167cc042bf2b178a4 /lib/Db/FollowsRequest.php
parent596669104e13fd1057120efe95ebbfe460e697ae (diff)
fixing verification on source
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Db/FollowsRequest.php')
-rw-r--r--lib/Db/FollowsRequest.php25
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/Db/FollowsRequest.php b/lib/Db/FollowsRequest.php
index 66058064..c5e2e8f1 100644
--- a/lib/Db/FollowsRequest.php
+++ b/lib/Db/FollowsRequest.php
@@ -33,7 +33,6 @@ namespace OCA\Social\Db;
use OCA\Social\Exceptions\FollowDoesNotExistException;
use OCA\Social\Model\ActivityPub\Follow;
-use OCA\Social\Model\ActivityPub\Person;
/**
@@ -74,22 +73,22 @@ class FollowsRequest extends FollowsRequestBuilder {
/**
- * @param Person $actor
- * @param Person $remote
+ * @param string $actorId
+ * @param string $remoteActorId
*
* @return Follow
* @throws FollowDoesNotExistException
*/
- public function getByPersons(Person $actor, Person $remote) {
+ public function getByPersons(string $actorId, string $remoteActorId) {
$qb = $this->getFollowsSelectSql();
- $this->limitToActorId($qb, $actor->getId());
- $this->limitToObjectId($qb, $remote->getId());
+ $this->limitToActorId($qb, $actorId);
+ $this->limitToObjectId($qb, $remoteActorId);
$cursor = $qb->execute();
$data = $cursor->fetch();
$cursor->closeCursor();
-
if ($data === false) {
+ $this->miscService->log('does not exisst ?');
throw new FollowDoesNotExistException();
}
@@ -108,5 +107,17 @@ class FollowsRequest extends FollowsRequestBuilder {
}
+ /**
+ * @param Follow $follow
+ */
+ public function deleteByPersons(Follow $follow) {
+ $qb = $this->getFollowsDeleteSql();
+ $this->limitToActorId($qb, $follow->getActorId());
+ $this->limitToObjectId($qb, $follow->getObjectId());
+
+ $qb->execute();
+ }
+
+
}