kopia lustrzana https://github.com/nextcloud/social
Merge pull request #527 from nextcloud/bugfix/noid/follow-process
small bugfixes during the follow processpull/528/head
commit
8f1f3a41b6
|
@ -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);
|
||||||
|
|
|
@ -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(),
|
||||||
|
|
|
@ -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 = '';
|
||||||
|
|
|
@ -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(
|
||||||
|
|
Ładowanie…
Reference in New Issue