From 698d4f55f21978972adf2edcef947d04d025ea10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?=
 <skjnldsv@protonmail.com>
Date: Mon, 12 Oct 2020 14:55:02 +0200
Subject: [PATCH] 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) <skjnldsv@protonmail.com>
---
 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 e698d16d823..67c5e04b1e3 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());
-- 
GitLab