Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/Chat/Parser/SystemMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,8 @@ protected function getFileFromShare(Participant $participant, string $shareId):
'size' => $size,
'path' => $path,
'link' => $url,
'etag' => $node->getEtag(),
'permissions' => $node->getPermissions(),
'mimetype' => $node->getMimeType(),
'preview-available' => $this->previewManager->isAvailable($node) ? 'yes' : 'no',
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,20 @@ export default {
type: String,
default: '',
},
/**
* File ETag
*/
etag: {
type: String,
default: '',
},
/**
* File ETag
*/
permissions: {
type: Number,
default: 0,
},
/**
* Whether a preview is available, string "yes" for yes
* otherwise the string "no"
Expand Down Expand Up @@ -448,6 +462,25 @@ export default {
OCA.Files.Sidebar.state.file = this.internalAbsolutePath
}

let permissions = ''
if (this.permissions) {
if (this.permissions & OC.PERMISSION_CREATE) {
permissions += 'CK'
}
if (this.permissions & OC.PERMISSION_READ) {
permissions += 'G'
}
if (this.permissions & OC.PERMISSION_UPDATE) {
permissions += 'W'
}
if (this.permissions & OC.PERMISSION_DELETE) {
permissions += 'D'
}
if (this.permissions & OC.PERMISSION_SHARE) {
permissions += 'R'
}
}

OCA.Viewer.open({
// Viewer expects an internal absolute path starting with "/".
path: this.internalAbsolutePath,
Expand All @@ -458,6 +491,8 @@ export default {
basename: this.name,
mime: this.mimetype,
hasPreview: this.previewAvailable === 'yes',
etag: this.etag,
permissions,
},
],
})
Expand Down