Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions lib/Activity/ProviderParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
use OCA\Circles\Model\FederatedLink;
use OCA\Circles\Model\Member;
use OCA\Circles\Service\MiscService;
use OCA\Circles\Service\ConfigService;
use OCP\Activity\IEvent;
use OCP\Activity\IManager;
use OCP\IL10N;
use OCP\IURLGenerator;

class ProviderParser {


/** @var MiscService */
protected $miscService;

Expand All @@ -52,13 +52,28 @@ class ProviderParser {
/** @var IManager */
protected $activityManager;

/** @var ConfigService */
protected $configService;

/**
* @param IURLGenerator $url
* @param IManager $activityManager
* @param IL10N $l10n
* @param MiscService $miscService
* @param ConfigService $configService
*/
public function __construct(
IURLGenerator $url, IManager $activityManager, IL10N $l10n, MiscService $miscService
IURLGenerator $url,
IManager $activityManager,
IL10N $l10n,
MiscService $miscService,
ConfigService $configService
) {
$this->url = $url;
$this->activityManager = $activityManager;
$this->l10n = $l10n;
$this->miscService = $miscService;
$this->configService = $configService;
}


Expand Down
8 changes: 6 additions & 2 deletions lib/Activity/ProviderSubjectMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public function parseSubjectMemberJoin(IEvent $event, Circle $circle, Member $me
* @throws FakeException
*/
private function parseSubjectMemberJoinClosedCircle(IEvent $event, Circle $circle, Member $member) {
if ($circle->getType() !== Circle::CIRCLES_CLOSED) {
if ($circle->getType() !== Circle::CIRCLES_CLOSED ||
$this->configService->isInvitationSkipped()
) {
return;
}

Expand Down Expand Up @@ -141,7 +143,9 @@ private function parseSubjectMemberAddNotLocalMember(IEvent $event, Circle $circ
* @throws FakeException
*/
private function parseSubjectMemberAddClosedCircle(IEvent $event, Circle $circle, Member $member) {
if ($circle->getType() !== Circle::CIRCLES_CLOSED) {
if ($circle->getType() !== Circle::CIRCLES_CLOSED ||
$this->configService->isInvitationSkipped()
) {
return;
}

Expand Down
3 changes: 1 addition & 2 deletions lib/Model/Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public function inviteToCircle($circleType) {
public function joinCircle($circleType) {

switch ($circleType) {
case Circle::CIRCLES_PERSONAL:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why one should be able to join a Personal Circle ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary when you want to add someone to your own personal circle when the skip_invitation_to_closed_circles option is enabled

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this part, #416 fix this issue

case Circle::CIRCLES_SECRET:
case Circle::CIRCLES_PUBLIC:
return $this->addMemberToCircle();
Expand Down Expand Up @@ -264,5 +265,3 @@ public function hasToBeInviteAble() {
}

}