Merge pull request #527 from nextcloud/bugfix/noid/follow-process

small bugfixes during the follow process
pull/528/head
Maxence Lange 2019-05-17 13:34:58 -01:00 zatwierdzone przez GitHub
commit 8f1f3a41b6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 5 dodań i 6 usunięć

Wyświetl plik

@ -61,7 +61,8 @@ class FollowsRequest extends FollowsRequestBuilder {
->setValue('actor_id', $qb->createNamedParameter($follow->getActorId())) ->setValue('actor_id', $qb->createNamedParameter($follow->getActorId()))
->setValue('type', $qb->createNamedParameter($follow->getType())) ->setValue('type', $qb->createNamedParameter($follow->getType()))
->setValue('object_id', $qb->createNamedParameter($follow->getObjectId())) ->setValue('object_id', $qb->createNamedParameter($follow->getObjectId()))
->setValue('follow_id', $qb->createNamedParameter($follow->getFollowId())); ->setValue('follow_id', $qb->createNamedParameter($follow->getFollowId()))
->setValue('accepted', $qb->createNamedParameter(($follow->isAccepted()) ? '1' : '0'));
try { try {
$qb->setValue( $qb->setValue(
@ -98,7 +99,7 @@ class FollowsRequest extends FollowsRequestBuilder {
* @return Follow * @return Follow
* @throws FollowDoesNotExistException * @throws FollowDoesNotExistException
*/ */
public function getByPersons(string $actorId, string $remoteActorId) { public function getByPersons(string $actorId, string $remoteActorId): Follow {
$qb = $this->getFollowsSelectSql(); $qb = $this->getFollowsSelectSql();
$this->limitToActorId($qb, $actorId); $this->limitToActorId($qb, $actorId);
$this->limitToObjectId($qb, $remoteActorId); $this->limitToObjectId($qb, $remoteActorId);

Wyświetl plik

@ -129,7 +129,7 @@ class Follow extends ACore implements JsonSerializable {
$result = parent::jsonSerialize(); $result = parent::jsonSerialize();
if ($this->isCompleteDetails()) { if ($this->isCompleteDetails()) {
array_merge( $result = array_merge(
$result, $result,
[ [
'follow_id' => $this->getFollowId(), 'follow_id' => $this->getFollowId(),

Wyświetl plik

@ -48,7 +48,7 @@ class Stream extends ACore implements JsonSerializable {
/** @var string */ /** @var string */
private $activityId; private $activityId = '';
/** @var string */ /** @var string */
private $content = ''; private $content = '';

Wyświetl plik

@ -149,8 +149,6 @@ class FollowService {
$this->followsRequest->getByPersons($actor->getId(), $remoteActor->getId()); $this->followsRequest->getByPersons($actor->getId(), $remoteActor->getId());
} catch (FollowDoesNotExistException $e) { } catch (FollowDoesNotExistException $e) {
$this->followsRequest->save($follow); $this->followsRequest->save($follow);
// TODO - Remove this auto-accepted.
$this->followsRequest->accepted($follow);
$follow->addInstancePath( $follow->addInstancePath(
new InstancePath( new InstancePath(