mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-25 05:45:42 +03:00
If the OCS Share API returns an url use that
To avoid us having to construct the URL for public shares just rely on the server to do it. This makes it easier to maintain. For example if (in the not do distat future) the index.php part is removed the server would just server this new url.
This commit is contained in:
parent
951c9812f1
commit
a2f9ba47fb
1 changed files with 5 additions and 2 deletions
|
@ -329,8 +329,11 @@ void ShareDialog::slotSharesFetched(const QVariantMap &reply)
|
|||
}
|
||||
|
||||
QString url;
|
||||
// From ownCloud server version 8 on, a different share link scheme is used.
|
||||
if (versionString.contains('.') && versionString.split('.')[0].toInt() >= 8) {
|
||||
// From ownCloud server 8.2 the url field is always set for public shares
|
||||
if (data.contains("url")) {
|
||||
url = data.value("url").toString();
|
||||
} else if (versionString.contains('.') && versionString.split('.')[0].toInt() >= 8) {
|
||||
// From ownCloud server version 8 on, a different share link scheme is used.
|
||||
url = Account::concatUrlPath(_account->url(), QString("index.php/s/%1").arg(data.value("token").toString())).toString();
|
||||
} else {
|
||||
QList<QPair<QString, QString>> queryArgs;
|
||||
|
|
Loading…
Reference in a new issue