From a9a552ec95697768c99f70e1b4f860fb4cfe7512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Mon, 12 Oct 2020 14:55:02 +0200 Subject: [PATCH 1/2] Expose CLOUD federation for local users as well MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files_sharing/lib/Listener/ShareInteractionListener.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/files_sharing/lib/Listener/ShareInteractionListener.php b/apps/files_sharing/lib/Listener/ShareInteractionListener.php index e698d16d82..67c5e04b1e 100644 --- a/apps/files_sharing/lib/Listener/ShareInteractionListener.php +++ b/apps/files_sharing/lib/Listener/ShareInteractionListener.php @@ -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()); From a9425c7ebfb6998d144ee863e6df6ef4680c759b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Mon, 12 Oct 2020 16:56:20 +0200 Subject: [PATCH 2/2] Drop X-NEXTCLOUD-UID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- .../lib/Listeners/ContactInteractionListener.php | 3 --- apps/contactsinteraction/tests/Db/RecentContactMapperTest.php | 1 - 2 files changed, 4 deletions(-) diff --git a/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php b/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php index 4bcc13a97a..4135d83b5a 100644 --- a/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php +++ b/apps/contactsinteraction/lib/Listeners/ContactInteractionListener.php @@ -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(); } diff --git a/apps/contactsinteraction/tests/Db/RecentContactMapperTest.php b/apps/contactsinteraction/tests/Db/RecentContactMapperTest.php index 1fb5345162..026859168f 100644 --- a/apps/contactsinteraction/tests/Db/RecentContactMapperTest.php +++ b/apps/contactsinteraction/tests/Db/RecentContactMapperTest.php @@ -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();