Merge pull request #49024 from nextcloud/backport/48294/master

This commit is contained in:
John Molakvoæ 2024-11-09 11:23:42 +01:00 committed by GitHub
commit b5afb7805c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 12 additions and 4 deletions

View file

@ -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) {

View file

@ -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({

View file

@ -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" />

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long