accepted field in db

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/35/head
Maxence Lange 2018-11-19 09:32:52 -01:00
rodzic ee7e735722
commit 9f388e59cf
3 zmienionych plików z 22 dodań i 2 usunięć

Wyświetl plik

@ -91,6 +91,13 @@
<notnull>true</notnull>
</field>
<field>
<name>accepted</name>
<type>boolean</type>
<default>false</default>
<notnull>true</notnull>
</field>
<field>
<name>creation</name>
<type>timestamp</type>

Wyświetl plik

@ -5,7 +5,7 @@
<name>Social</name>
<summary>🎉 Nextcloud becomes part of the federated social networks!</summary>
<description><![CDATA[test]]></description>
<version>0.0.33</version>
<version>0.0.34</version>
<licence>agpl</licence>
<author mail="maxence@artificial-owl.com">Maxence Lange</author>
<author mail="jus@bitgrid.net">Julius Härtl</author>

Wyświetl plik

@ -31,7 +31,6 @@ declare(strict_types=1);
namespace OCA\Social\Db;
use Exception;
use OCA\Social\Exceptions\FollowDoesNotExistException;
use OCA\Social\Model\ActivityPub\Follow;
use OCA\Social\Model\ActivityPub\Person;
@ -60,6 +59,20 @@ class FollowsRequest extends FollowsRequestBuilder {
}
/**
* @param Follow $follow
*/
public function accepted(Follow $follow) {
$qb = $this->getFollowsUpdateSql();
$qb->set('accepted', $qb->createNamedParameter('1'));
$this->limitToIdString($qb, $follow->getId());
$this->limitToActorId($qb, $follow->getActorId());
$this->limitToObjectId($qb, $follow->getObjectId());
$qb->execute();
}
/**
* @param Person $actor
* @param Person $remote