diff options
author | Christian Kamm <mail@ckamm.de> | 2017-11-10 11:22:41 +0300 |
---|---|---|
committer | ckamm <mail@ckamm.de> | 2017-11-14 14:14:11 +0300 |
commit | 18091f99d489fbabf6db5b0963e081033f6e1317 (patch) | |
tree | b7c9102c96a44f29a2d4e4fc67aef306dbc577d7 /src/gui/sharedialog.cpp | |
parent | 3ae2071129dbeb2d7df0263157c4f3e924d5f48a (diff) |
Private links: Retrieve numeric file id property #6146
Some servers have non-compliant instance ids (that start with a number)
and thereby make deducing the numeric file id from the full id
unreliable.
To circumvent this problem we retrieve the fileid property from the
server with a PROPFIND.
Diffstat (limited to 'src/gui/sharedialog.cpp')
-rw-r--r-- | src/gui/sharedialog.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp index a81d20894..5c070a125 100644 --- a/src/gui/sharedialog.cpp +++ b/src/gui/sharedialog.cpp @@ -133,6 +133,7 @@ ShareDialog::ShareDialog(QPointer<AccountState> accountState, job->setProperties( QList<QByteArray>() << "http://open-collaboration-services.org/ns:share-permissions" + << "http://owncloud.org/ns:fileid" // numeric file id for fallback private link generation << "http://owncloud.org/ns:privatelink"); job->setTimeout(10 * 1000); connect(job, &PropfindJob::result, this, &ShareDialog::slotPropfindReceived); @@ -160,9 +161,13 @@ void ShareDialog::slotPropfindReceived(const QVariantMap &result) qCInfo(lcSharing) << "Received sharing permissions for" << _sharePath << _maxSharingPermissions; } auto privateLinkUrl = result["privatelink"].toString(); + auto numericFileId = result["fileid"].toByteArray(); if (!privateLinkUrl.isEmpty()) { qCInfo(lcSharing) << "Received private link url for" << _sharePath << privateLinkUrl; _privateLinkUrl = privateLinkUrl; + } else if (!numericFileId.isEmpty()) { + qCInfo(lcSharing) << "Received numeric file id for" << _sharePath << numericFileId; + _privateLinkUrl = _accountState->account()->deprecatedPrivateLinkUrl(numericFileId).toString(QUrl::FullyEncoded); } showSharingUi(); |