diff options
author | fenn-cs <fenn25.fn@gmail.com> | 2024-08-22 23:25:42 +0100 |
---|---|---|
committer | fenn-cs <fenn25.fn@gmail.com> | 2024-10-30 15:16:00 +0100 |
commit | 2e31d35134b5238254570d5522695df7c430578b (patch) | |
tree | b2e1a4f2a8f5f2d7824c2e61d03955fca66c5fd1 /apps | |
parent | 9fde83cbeb3caaffc0a1a40edb4b8b3b6b199522 (diff) | |
download | nextcloud-server-2e31d35134b5238254570d5522695df7c430578b.tar.gz nextcloud-server-2e31d35134b5238254570d5522695df7c430578b.zip |
fix(Federation): Show some icon for federated users on shares
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/Connector/Sabre/FilesPlugin.php | 7 | ||||
-rw-r--r-- | apps/files/src/init.ts | 1 | ||||
-rw-r--r-- | apps/files_sharing/src/actions/sharingStatusAction.ts | 2 | ||||
-rw-r--r-- | apps/files_sharing/src/utils/AccountIcon.ts | 1 |
4 files changed, 10 insertions, 1 deletions
diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 040a6a035fc..fb8f6328683 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -57,6 +57,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'; @@ -118,6 +119,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 @@ -412,6 +414,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 \OCA\DAV\Connector\Sabre\File) { diff --git a/apps/files/src/init.ts b/apps/files/src/init.ts index db4aec7fa06..c12d4f193f3 100644 --- a/apps/files/src/init.ts +++ b/apps/files/src/init.ts @@ -66,5 +66,6 @@ registerPreviewServiceWorker() registerDavProperty('nc:hidden', { nc: 'http://nextcloud.org/ns' }) registerDavProperty('nc:is-mount-root', { nc: 'http://nextcloud.org/ns' }) +registerDavProperty('nc:is-federated', { nc: 'http://nextcloud.org/ns' }) initLivePhotos() diff --git a/apps/files_sharing/src/actions/sharingStatusAction.ts b/apps/files_sharing/src/actions/sharingStatusAction.ts index 635e9e0d572..fc155985eee 100644 --- a/apps/files_sharing/src/actions/sharingStatusAction.ts +++ b/apps/files_sharing/src/actions/sharingStatusAction.ts @@ -18,7 +18,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" /> |