Merge pull request #23390 from nextcloud/backport/23379/stable20
[stable20] Expose CLOUD federation for local users in the recent addressbook
This commit is contained in:
commit
cf9c643793
|
@ -156,9 +156,6 @@ class ContactInteractionListener implements IEventListener {
|
||||||
'CATEGORIES' => $this->l10n->t('Recently contacted'),
|
'CATEGORIES' => $this->l10n->t('Recently contacted'),
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($contact->getUid() !== null) {
|
|
||||||
$props['X-NEXTCLOUD-UID'] = $contact->getUid();
|
|
||||||
}
|
|
||||||
if ($contact->getEmail() !== null) {
|
if ($contact->getEmail() !== null) {
|
||||||
$props['EMAIL'] = $contact->getEmail();
|
$props['EMAIL'] = $contact->getEmail();
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,6 @@ class RecentContactMapperTest extends TestCase {
|
||||||
'URI' => UUIDUtil::getUUID(),
|
'URI' => UUIDUtil::getUUID(),
|
||||||
'FN' => 'Foo Bar',
|
'FN' => 'Foo Bar',
|
||||||
'CATEGORIES' => 'Recently contacted',
|
'CATEGORIES' => 'Recently contacted',
|
||||||
'X-NEXTCLOUD-UID' => 'foobar',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$time = $this->time->getDateTime();
|
$time = $this->time->getDateTime();
|
||||||
|
|
|
@ -72,6 +72,7 @@ class ShareInteractionListener implements IEventListener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$actor = $this->userManager->get($share->getSharedBy());
|
$actor = $this->userManager->get($share->getSharedBy());
|
||||||
|
$sharedWith = $this->userManager->get($share->getSharedWith());
|
||||||
if ($actor === null) {
|
if ($actor === null) {
|
||||||
$this->logger->warning('Share was not created by a user, can\'t emit interaction event');
|
$this->logger->warning('Share was not created by a user, can\'t emit interaction event');
|
||||||
return;
|
return;
|
||||||
|
@ -80,6 +81,9 @@ class ShareInteractionListener implements IEventListener {
|
||||||
switch ($share->getShareType()) {
|
switch ($share->getShareType()) {
|
||||||
case IShare::TYPE_USER:
|
case IShare::TYPE_USER:
|
||||||
$interactionEvent->setUid($share->getSharedWith());
|
$interactionEvent->setUid($share->getSharedWith());
|
||||||
|
if ($sharedWith !== null) {
|
||||||
|
$interactionEvent->setFederatedCloudId($sharedWith->getCloudId());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case IShare::TYPE_EMAIL:
|
case IShare::TYPE_EMAIL:
|
||||||
$interactionEvent->setEmail($share->getSharedWith());
|
$interactionEvent->setEmail($share->getSharedWith());
|
||||||
|
|
Loading…
Reference in New Issue