From 60fa7ea91e23b4097fa35f7fd0fed48e3eab8b25 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 17 Jun 2019 09:20:18 +0200 Subject: [PATCH] Sharing: Fix fast share creation with enforced expiry and 10.2.0 Fixes the "Copy public link to clipboard" context menu action for newer servers. Previously the server would fill the expiration date for us, since version 10.2.0 it reports an error. To workaround that the action now always sends an expiration date if default expiration is enabled in the settings. For #7245 --- src/gui/socketapi.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp index 624a5cda472..52a8869092e 100644 --- a/src/gui/socketapi.cpp +++ b/src/gui/socketapi.cpp @@ -522,8 +522,11 @@ private slots: auto shareName = SocketApi::tr("Context menu share"); // If shares will expire, create a new one every day. + QDate expireDate; if (_account->capabilities().sharePublicLinkDefaultExpire()) { shareName = SocketApi::tr("Context menu share %1").arg(QDate::currentDate().toString(Qt::ISODate)); + expireDate = QDate::currentDate().addDays( + _account->capabilities().sharePublicLinkDefaultExpireDateDays()); } // If there already is a context menu share, reuse it @@ -540,7 +543,8 @@ private slots: // otherwise create a new one qCDebug(lcPublicLink) << "Creating new share"; - _shareManager.createLinkShare(_localFile, shareName); + QString noPassword; + _shareManager.createLinkShare(_localFile, shareName, noPassword, expireDate); } void linkShareCreated(const QSharedPointer &share)