diff options
-rw-r--r-- | apps/dav/lib/Connector/Sabre/FilesPlugin.php | 7 | ||||
-rw-r--r-- | apps/files_sharing/src/files_actions/sharingStatusAction.ts | 2 | ||||
-rw-r--r-- | apps/files_sharing/src/utils/AccountIcon.ts | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index dbd4e522517..ded3f321e13 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -58,6 +58,7 @@ class FilesPlugin extends ServerPlugin { public const HAS_PREVIEW_PROPERTYNAME = '{http://nextcloud.org/ns}has-preview'; public const MOUNT_TYPE_PROPERTYNAME = '{http://nextcloud.org/ns}mount-type'; public const MOUNT_ROOT_PROPERTYNAME = '{http://nextcloud.org/ns}is-mount-root'; + public const IS_FEDERATED_PROPERTYNAME = '{http://nextcloud.org/ns}is-federated'; public const METADATA_ETAG_PROPERTYNAME = '{http://nextcloud.org/ns}metadata_etag'; public const UPLOAD_TIME_PROPERTYNAME = '{http://nextcloud.org/ns}upload_time'; public const CREATION_TIME_PROPERTYNAME = '{http://nextcloud.org/ns}creation_time'; @@ -119,6 +120,7 @@ class FilesPlugin extends ServerPlugin { $server->protectedProperties[] = self::DATA_FINGERPRINT_PROPERTYNAME; $server->protectedProperties[] = self::HAS_PREVIEW_PROPERTYNAME; $server->protectedProperties[] = self::MOUNT_TYPE_PROPERTYNAME; + $server->protectedProperties[] = self::IS_FEDERATED_PROPERTYNAME; $server->protectedProperties[] = self::SHARE_NOTE; // normally these cannot be changed (RFC4918), but we want them modifiable through PROPPATCH @@ -414,6 +416,11 @@ class FilesPlugin extends ServerPlugin { $propFind->handle(self::DISPLAYNAME_PROPERTYNAME, function () use ($node) { return $node->getName(); }); + + $propFind->handle(self::IS_FEDERATED_PROPERTYNAME, function () use ($node) { + return $node->getFileInfo()->getMountPoint() + instanceof \OCA\Files_Sharing\External\Mount; + }); } if ($node instanceof File) { diff --git a/apps/files_sharing/src/files_actions/sharingStatusAction.ts b/apps/files_sharing/src/files_actions/sharingStatusAction.ts index bd9448689a2..ef9d7e207e0 100644 --- a/apps/files_sharing/src/files_actions/sharingStatusAction.ts +++ b/apps/files_sharing/src/files_actions/sharingStatusAction.ts @@ -19,7 +19,7 @@ import { generateAvatarSvg } from '../utils/AccountIcon' import './sharingStatusAction.scss' const isExternal = (node: Node) => { - return node.attributes.remote_id !== undefined + return node.attributes?.['is-federated'] ?? false } export const action = new FileAction({ diff --git a/apps/files_sharing/src/utils/AccountIcon.ts b/apps/files_sharing/src/utils/AccountIcon.ts index 504bb43540e..21732f08f68 100644 --- a/apps/files_sharing/src/utils/AccountIcon.ts +++ b/apps/files_sharing/src/utils/AccountIcon.ts @@ -20,6 +20,7 @@ export const generateAvatarSvg = (userId: string, isGuest = false) => { const url = `${basePath}/32${darkModePath}${guestFallback}` const avatarUrl = generateUrl(url, { userId }) + return `<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" class="sharing-status__avatar"> <image href="${avatarUrl}" height="32" width="32" /> |