Merge pull request #23379 from nextcloud/fix/recent-contacts-federated

This commit is contained in:
John Molakvoæ 2020-10-12 18:40:22 +02:00 committed by GitHub
commit ff84fc400a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -156,9 +156,6 @@ class ContactInteractionListener implements IEventListener {
'CATEGORIES' => $this->l10n->t('Recently contacted'),
];
if ($contact->getUid() !== null) {
$props['X-NEXTCLOUD-UID'] = $contact->getUid();
}
if ($contact->getEmail() !== null) {
$props['EMAIL'] = $contact->getEmail();
}

View File

@ -110,7 +110,6 @@ class RecentContactMapperTest extends TestCase {
'URI' => UUIDUtil::getUUID(),
'FN' => 'Foo Bar',
'CATEGORIES' => 'Recently contacted',
'X-NEXTCLOUD-UID' => 'foobar',
];
$time = $this->time->getDateTime();

View File

@ -72,6 +72,7 @@ class ShareInteractionListener implements IEventListener {
return;
}
$actor = $this->userManager->get($share->getSharedBy());
$sharedWith = $this->userManager->get($share->getSharedWith());
if ($actor === null) {
$this->logger->warning('Share was not created by a user, can\'t emit interaction event');
return;
@ -80,6 +81,9 @@ class ShareInteractionListener implements IEventListener {
switch ($share->getShareType()) {
case IShare::TYPE_USER:
$interactionEvent->setUid($share->getSharedWith());
if ($sharedWith !== null) {
$interactionEvent->setFederatedCloudId($sharedWith->getCloudId());
}
break;
case IShare::TYPE_EMAIL:
$interactionEvent->setEmail($share->getSharedWith());