kopia lustrzana https://github.com/nextcloud/social
setAccepted()
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>pull/1634/head
rodzic
b39fb7f90f
commit
be6c6f19bb
|
@ -318,21 +318,25 @@ class FollowService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $actorNid
|
* @param int $objectNid
|
||||||
* @param string $actorId
|
* @param string $objectId
|
||||||
* @param Follow[] $follows
|
* @param Follow[] $follows
|
||||||
*
|
*
|
||||||
* @return Relationship
|
* @return Relationship
|
||||||
*/
|
*/
|
||||||
private function generateRelationship(int $actorNid, string $actorId, array $follows): Relationship {
|
private function generateRelationship(int $objectNid, string $objectId, array $follows): Relationship {
|
||||||
$relationship = new Relationship($actorNid);
|
$relationship = new Relationship($objectNid);
|
||||||
|
|
||||||
foreach ($follows as $follow) {
|
foreach ($follows as $follow) {
|
||||||
if ($follow->getType() === Follow::TYPE) {
|
if ($follow->getType() === Follow::TYPE) {
|
||||||
if ($follow->getObjectId() === $actorId) {
|
if ($follow->getObjectId() === $objectId) {
|
||||||
$relationship->setFollowing(true);
|
if ($follow->isAccepted()) {
|
||||||
|
$relationship->setFollowing(true);
|
||||||
|
} else {
|
||||||
|
$relationship->setRequested(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($follow->getActorId() === $actorId) {
|
if ($follow->getActorId() === $objectId && $follow->isAccepted()) {
|
||||||
$relationship->setFollowedBy(true);
|
$relationship->setFollowedBy(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue