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:
Roeland Jago Douma 2015-07-17 09:23:55 +02:00
parent 951c9812f1
commit a2f9ba47fb

View file

@ -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;