Skip to content

Commit cf9c643

Browse files
authored
Merge pull request #23390 from nextcloud/backport/23379/stable20
[stable20] Expose CLOUD federation for local users in the recent addressbook
2 parents 830d911 + a9425c7 commit cf9c643

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@ private function generateCard(RecentContact $contact): string {
156156
'CATEGORIES' => $this->l10n->t('Recently contacted'),
157157
];
158158

159-
if ($contact->getUid() !== null) {
160-
$props['X-NEXTCLOUD-UID'] = $contact->getUid();
161-
}
162159
if ($contact->getEmail() !== null) {
163160
$props['EMAIL'] = $contact->getEmail();
164161
}

apps/contactsinteraction/tests/Db/RecentContactMapperTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ protected function createRecentContact(string $email = null, string $federatedCl
110110
'URI' => UUIDUtil::getUUID(),
111111
'FN' => 'Foo Bar',
112112
'CATEGORIES' => 'Recently contacted',
113-
'X-NEXTCLOUD-UID' => 'foobar',
114113
];
115114

116115
$time = $this->time->getDateTime();

apps/files_sharing/lib/Listener/ShareInteractionListener.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public function handle(Event $event): void {
7272
return;
7373
}
7474
$actor = $this->userManager->get($share->getSharedBy());
75+
$sharedWith = $this->userManager->get($share->getSharedWith());
7576
if ($actor === null) {
7677
$this->logger->warning('Share was not created by a user, can\'t emit interaction event');
7778
return;
@@ -80,6 +81,9 @@ public function handle(Event $event): void {
8081
switch ($share->getShareType()) {
8182
case IShare::TYPE_USER:
8283
$interactionEvent->setUid($share->getSharedWith());
84+
if ($sharedWith !== null) {
85+
$interactionEvent->setFederatedCloudId($sharedWith->getCloudId());
86+
}
8387
break;
8488
case IShare::TYPE_EMAIL:
8589
$interactionEvent->setEmail($share->getSharedWith());

0 commit comments

Comments
 (0)