Skip to content

Commit

Permalink
sharing by mail
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Apr 21, 2020
1 parent 013c0fe commit 1b6ea8b
Show file tree
Hide file tree
Showing 16 changed files with 807 additions and 145 deletions.
1 change: 1 addition & 0 deletions lib/Circles/FileSharingBroadcaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use OCA\Circles\AppInfo\Application;
use OCA\Circles\Db\SharesRequest;
use OCA\Circles\Db\TokensRequest;
use OCA\Circles\Exceptions\TokenDoesNotExistException;
use OCA\Circles\IBroadcaster;
use OCA\Circles\Model\Circle;
use OCA\Circles\Model\Member;
Expand Down
9 changes: 8 additions & 1 deletion lib/Db/MembersRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,23 @@ public function forceGetMemberById(string $memberId): Member {
*
* @param string $circleUniqueId
* @param int $level
* @param int $type
* @param bool $incGroup
*
* @return Member[]
*/
public function forceGetMembers($circleUniqueId, $level = Member::LEVEL_MEMBER, $incGroup = false) {
public function forceGetMembers(
$circleUniqueId, $level = Member::LEVEL_MEMBER, int $type = 0, $incGroup = false
) {

$qb = $this->getMembersSelectSql();
$this->limitToMembersAndAlmost($qb);
$this->limitToLevel($qb, $level);

if ($type > 0) {
$this->limitToUserType($qb, $type);
}

$this->limitToCircleId($qb, $circleUniqueId);

$members = [];
Expand Down
21 changes: 21 additions & 0 deletions lib/GlobalScale/AGlobalScaleEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@
use OCA\Circles\Service\EventsService;
use OCA\Circles\Service\MembersService;
use OCA\Circles\Service\MiscService;
use OCP\Defaults;
use OCP\Files\IRootFolder;
use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\Mail\IMailer;


/**
Expand All @@ -62,6 +65,15 @@ abstract class AGlobalScaleEvent {
/** @var IRootFolder */
protected $rootFolder;

/** @var IURLGenerator */
protected $urlGenerator;

/** @var IMailer */
protected $mailer;

/** @var Defaults */
protected $defaults;

/** @var IUserManager */
protected $userManager;

Expand Down Expand Up @@ -100,6 +112,9 @@ abstract class AGlobalScaleEvent {
* AGlobalScaleEvent constructor.
*
* @param IRootFolder $rootFolder
* @param IURLGenerator $urlGenerator
* @param IMailer $mailer
* @param Defaults $defaults
* @param IUserManager $userManager
* @param SharesRequest $sharesRequest
* @param TokensRequest $tokensRequest
Expand All @@ -114,6 +129,9 @@ abstract class AGlobalScaleEvent {
*/
public function __construct(
IRootFolder $rootFolder,
IURLGenerator $urlGenerator,
IMailer $mailer,
Defaults $defaults,
IUserManager $userManager,
SharesRequest $sharesRequest,
TokensRequest $tokensRequest,
Expand All @@ -127,6 +145,9 @@ public function __construct(
MiscService $miscService
) {
$this->rootFolder = $rootFolder;
$this->urlGenerator = $urlGenerator;
$this->mailer = $mailer;
$this->defaults = $defaults;
$this->userManager = $userManager;
$this->sharesRequest = $sharesRequest;
$this->tokensRequest = $tokensRequest;
Expand Down
Loading

0 comments on commit 1b6ea8b

Please sign in to comment.