-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(invitations): Allow importing CSV email lists
Signed-off-by: Joas Schilling <[email protected]>
- Loading branch information
1 parent
347edd4
commit 505cde5
Showing
6 changed files
with
260 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
|
||
namespace OCA\Talk\Exceptions; | ||
|
||
class GuestImportException extends \Exception { | ||
public const REASON_ROOM = 'room'; | ||
public const REASON_ROWS = 'rows'; | ||
public const REASON_HEADER_EMAIL = 'header-email'; | ||
public const REASON_HEADER_NAME = 'header-name'; | ||
|
||
/** | ||
* @param self::REASON_* $reason | ||
* @param non-negative-int|null $invites | ||
* @param non-negative-int|null $duplicates | ||
*/ | ||
public function __construct( | ||
protected string $reason, | ||
protected ?string $errorMessage = null, | ||
protected ?array $invalidLines = null, | ||
protected ?int $invites = null, | ||
protected ?int $duplicates = null, | ||
) { | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* @return self::REASON_* | ||
*/ | ||
public function getReason(): string { | ||
return $this->reason; | ||
} | ||
|
||
public function getErrorMessage(): ?string { | ||
return $this->errorMessage; | ||
} | ||
|
||
/** | ||
* @return non-negative-int|null | ||
*/ | ||
public function getInvites(): ?int { | ||
return $this->invites; | ||
} | ||
|
||
/** | ||
* @return non-negative-int|null | ||
*/ | ||
public function getDuplicates(): ?int { | ||
return $this->duplicates; | ||
} | ||
|
||
/** | ||
* @return non-negative-int|null | ||
*/ | ||
public function getInvalid(): ?int { | ||
return $this->invalidLines === null ? null : count($this->invalidLines); | ||
} | ||
|
||
public function getInvalidLines(): ?array { | ||
return $this->invalidLines; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters