Skip to content
Draft
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
33 changes: 28 additions & 5 deletions lib/Controller/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use OCA\Calendar\Service\ContactsService;
use OCA\Calendar\Service\ServiceException;
use OCA\Circles\Exceptions\CircleNotFoundException;
use OCA\Circles\Model\Member;
use OCP\App\IAppManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
Expand Down Expand Up @@ -222,21 +223,43 @@
$circleMembers = $circle->getInheritedMembers();

foreach ($circleMembers as $circleMember) {
$email = "";
if ($circleMember->isLocal()) {

$circleMemberUserId = $circleMember->getUserId();

$user = $this->userManager->get($circleMemberUserId);
switch ($circleMember->getUserType()) {
case Member::TYPE_USER:

Check failure on line 232 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable32

UndefinedClass

lib/Controller/ContactController.php:232:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)

Check failure on line 232 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

UndefinedClass

lib/Controller/ContactController.php:232:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)

Check failure on line 232 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable33

UndefinedClass

lib/Controller/ContactController.php:232:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)
$user = $this->userManager->get($circleMemberUserId);
$email = $user ? $user->getEMailAddress() : "";
break;

if ($user === null) {
throw new ServiceException('Could not find organizer');
case Member::TYPE_GROUP:

Check failure on line 237 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable32

UndefinedClass

lib/Controller/ContactController.php:237:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)

Check failure on line 237 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

UndefinedClass

lib/Controller/ContactController.php:237:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)

Check failure on line 237 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable33

UndefinedClass

lib/Controller/ContactController.php:237:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)
// Ignored, as `getInheritedMembers` already fetches all members
continue 2;

case Member::TYPE_MAIL:

Check failure on line 241 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable32

UndefinedClass

lib/Controller/ContactController.php:241:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)

Check failure on line 241 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

UndefinedClass

lib/Controller/ContactController.php:241:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)

Check failure on line 241 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable33

UndefinedClass

lib/Controller/ContactController.php:241:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)
$email = $circleMemberUserId;
break;

case Member::TYPE_CONTACT:

Check failure on line 245 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable32

UndefinedClass

lib/Controller/ContactController.php:245:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)

Check failure on line 245 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

UndefinedClass

lib/Controller/ContactController.php:245:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)

Check failure on line 245 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable33

UndefinedClass

lib/Controller/ContactController.php:245:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)
// Currently you can't add contacts to circles, just mails of contacts
continue 2;

case Member::TYPE_CIRCLE:

Check failure on line 249 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable32

UndefinedClass

lib/Controller/ContactController.php:249:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)

Check failure on line 249 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-master

UndefinedClass

lib/Controller/ContactController.php:249:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)

Check failure on line 249 in lib/Controller/ContactController.php

View workflow job for this annotation

GitHub Actions / static-psalm-analysis dev-stable33

UndefinedClass

lib/Controller/ContactController.php:249:11: UndefinedClass: Class, interface or enum named OCA\Circles\Model\Member does not exist (see https://psalm.dev/019)
// Ignored, as `getInheritedMembers` already fetches all members
continue 2;

default:
$this->logger->warning("Unknown usertype for circle member with ID: {$circleMemberUserId}");
continue 2;
}

$contacts[] = [
'commonName' => $circleMember->getDisplayName(),
'calendarUserType' => 'INDIVIDUAL',
'email' => $user->getEMailAddress(),
'isUser' => true,
'email' => $email,
'isUser' => $circleMember->getUserType() === 1,
'avatar' => $circleMemberUserId,
'hasMultipleEMails' => false,
'dropdownName' => $circleMember->getDisplayName(),
Expand Down
Loading