From a2f9ba47fb40972fad962ef0022511d24be6ed48 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 17 Jul 2015 09:23:55 +0200 Subject: [PATCH] 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. --- src/gui/sharedialog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/sharedialog.cpp b/src/gui/sharedialog.cpp index 19274c55d..f3e123f7d 100644 --- a/src/gui/sharedialog.cpp +++ b/src/gui/sharedialog.cpp @@ -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> queryArgs;