mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-07 04:40:05 -06:00
use existing mountpoint on auto accept
Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
5
changelog/unreleased/fix-mountpoint-autoaccept.md
Normal file
5
changelog/unreleased/fix-mountpoint-autoaccept.md
Normal file
@@ -0,0 +1,5 @@
|
||||
Bugfix: set existing mountpoint on auto accept
|
||||
|
||||
When already having a share for a specific resource, auto accept would use custom mountpoints which lead to other errors. Now auto-accept is using the existing mountpoint of a share.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/7592
|
||||
@@ -162,11 +162,19 @@ func getMountpoint(ctx context.Context, itemid *provider.ResourceId, uid *user.U
|
||||
// we need to sort the received shares by mount point in order to make things easier to evaluate.
|
||||
base := path.Base(info.GetPath())
|
||||
mount := base
|
||||
var mountedShares []*collaboration.ReceivedShare
|
||||
mountedShares := make([]*collaboration.ReceivedShare, 0, len(lrs.Shares))
|
||||
for _, s := range lrs.Shares {
|
||||
if !utils.ResourceIDEqual(s.Share.ResourceId, itemid) && s.State == collaboration.ShareState_SHARE_STATE_ACCEPTED {
|
||||
mountedShares = append(mountedShares, s)
|
||||
if s.State != collaboration.ShareState_SHARE_STATE_ACCEPTED {
|
||||
// we don't care about unaccepted shares
|
||||
continue
|
||||
}
|
||||
|
||||
if utils.ResourceIDEqual(s.Share.ResourceId, itemid) {
|
||||
// a share to the same resource already exists and is mounted
|
||||
return s.MountPoint.Path, nil
|
||||
}
|
||||
|
||||
mountedShares = append(mountedShares, s)
|
||||
}
|
||||
|
||||
sort.Slice(mountedShares, func(i, j int) bool {
|
||||
|
||||
Reference in New Issue
Block a user